Projects
New Ticket     Wiki     Browse Source     Timeline     Roadmap     Bug Reports     Search

Ticket #12313: mysql5-client.diff

File mysql5-client.diff, 4.5 KB (added by ryandesign@…, 15 months ago)
  • Portfile

     
    22 
    33PortSystem          1.0 
    44 
    5 name                mysql5 
     5name                mysql5-client 
    66version             5.0.45 
    77homepage            http://www.mysql.com/ 
    88categories          databases 
     
    1111distname            mysql-${version} 
    1212 
    1313description \ 
    14         Multithreaded SQL database server 
     14        The world's most popular open-source database 
    1515 
    1616long_description \ 
    17         MySQL is an open-source, multi-threaded SQL database \ 
    18         with a command syntax very similar to mSQL. 
     17        MySQL is the world's most popular open-source database. This port \ 
     18        installs the client libraries and binaries for connecting to an \ 
     19        existing MySQL server. If you want to run your own server, see \ 
     20        mysql5-server. 
    1921 
    2022master_sites \ 
    2123        http://mysql.mirrors.pair.com/Downloads/MySQL-5.0/ \ 
     
    3840patchfiles \ 
    3941        patch-mysys-base64.c.diff 
    4042 
    41 set dbdir           ${prefix}/var/db/${name} 
     43set major_version   5 
     44set mysql           mysql${major_version} 
     45set dbdir           ${prefix}/var/db/${mysql} 
    4246set mysqluser       mysql 
    4347 
     48dist_subdir         ${mysql} 
     49 
    4450configure.args \ 
    4551        --mandir=${prefix}/share/man \ 
    4652        --infodir=${prefix}/share/info \ 
    4753        --localstatedir=${dbdir} \ 
    48         --libdir=${prefix}/lib/${name} \ 
    49         --bindir=${prefix}/lib/${name}/bin \ 
    50         --includedir=${prefix}/include/${name} \ 
    51         --datadir=${prefix}/share/${name} \ 
    52         --sysconfdir=${prefix}/etc/${name} \ 
     54        --libdir=${prefix}/lib/${mysql} \ 
     55        --bindir=${prefix}/lib/${mysql}/bin \ 
     56        --includedir=${prefix}/include/${mysql} \ 
     57        --datadir=${prefix}/share/${mysql} \ 
     58        --sysconfdir=${prefix}/etc/${mysql} \ 
    5359        --with-zlib-dir=${prefix} \ 
    5460        --with-openssl=${prefix} \ 
    5561        --with-extra-charsets=complex \ 
    56         --with-unix-socket-path=${prefix}/var/run/${name}/mysqld.sock \ 
     62        --with-unix-socket-path=${prefix}/var/run/${mysql}/mysqld.sock \ 
    5763        --with-mysqld-user=${mysqluser} \ 
    5864        --without-bench \ 
    5965        --enable-thread-safe-client 
     
    6268        configure.compiler      gcc-4.0 
    6369} 
    6470 
    65 variant server { 
    66         # Create a startupitem to start/stop the server 
    67         startupitem.create      yes 
    68         startupitem.start       "${prefix}/share/mysql5/mysql/mysql.server start" 
    69         startupitem.stop        "${prefix}/share/mysql5/mysql/mysql.server stop" 
    70 } 
    71  
    7271pre-destroot { 
    73         # Some directories we must have in all cases 
    74         xinstall -m 755 -d ${destroot}${prefix}/etc/${name} 
    75         destroot.keepdirs-append ${destroot}${prefix}/etc/${name} 
    76          
    77         # Setup only for server 
    78         if { [variant_isset server] } { 
    79                 addgroup ${mysqluser} 
    80                 set gid [existsgroup ${mysqluser}] 
    81                 adduser ${mysqluser} gid=${gid} realname=MySQL\ Server 
    82                  
    83                 # Some directories we must have only if we're running as a server 
    84                 xinstall -m 755 -o root -d ${destroot}${prefix}/var/run 
    85                  
    86                 xinstall -m 755 -o ${mysqluser} -g ${mysqluser} -d \ 
    87                         ${destroot}${dbdir} \ 
    88                         ${destroot}${prefix}/var/run/${name} 
    89                 destroot.keepdirs-append  \ 
    90                         ${destroot}${dbdir} \ 
    91                         ${destroot}${prefix}/var/run/${name} 
    92         } 
     72        xinstall -m 755 -d ${destroot}${prefix}/etc/${mysql} 
     73        destroot.keepdirs-append ${destroot}${prefix}/etc/${mysql} 
    9374} 
    9475 
    9576post-destroot { 
    9677        delete ${destroot}${prefix}/mysql-test 
    9778         
    98         # Symlink mysql binaries into bin directory, with a 5 appended to the name 
     79        # Symlink mysql binaries into bin directory, with ${major_version} appended to the name 
    9980        cd ${destroot}${prefix}/bin 
    100         foreach f [glob -tails -directory ${destroot}${prefix}/lib/${name}/bin my*] { 
    101                 ln -sf ../lib/${name}/bin/${f} ${f}5 
     81        foreach f [glob -tails -directory ${destroot}${prefix}/lib/${mysql}/bin my*] { 
     82                ln -sf ../lib/${mysql}/bin/${f} ${f}${major_version} 
    10283        } 
    10384} 
    10485 
    10586post-install { 
    106         if { [variant_isset server] } { 
    107                 ui_msg "******************************************************" 
    108                 ui_msg "* In order to setup the database, you might want to run" 
    109                 ui_msg "* sudo -u ${mysqluser} mysql_install_db5" 
    110                 ui_msg "* if this is a new install"  
    111                 ui_msg "******************************************************" 
    112         } 
     87        ui_msg "****************************************************************" 
     88        ui_msg "${name} installs only the client libraries to connect to" 
     89        ui_msg "an existing MySQL server. If you want to run a MySQL server of" 
     90        ui_msg "your own on this machine, you should also install ${mysql}-server." 
     91        ui_msg "****************************************************************" 
    11392} 
    11493 
    11594livecheck.check     regex 
    11695livecheck.url       http://dev.mysql.com/ 
    117 livecheck.regex     "Generally Available (\[0-9\.\]+)" 
     96livecheck.regex     "Generally Available (${major_version}\\.\[0-9.\]+)"