Ticket #12313: mysql5-server.diff

File mysql5-server.diff, 5.1 KB (added by ryandesign (Ryan Carsten Schmidt), 17 years ago)
  • Portfile

     
    22
    33PortSystem          1.0
    44
    5 name                mysql5
     5name                mysql5-server
    66version             5.0.45
    77homepage            http://www.mysql.com/
    88categories          databases
    99platforms           darwin
    1010maintainers         ryandesign
    11 distname            mysql-${version}
     11distfiles
    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 server configuration enabling you to run your own \
     19        MySQL server. If you only want to connect to an existing server, \
     20        you can just use mysql5-client.
    1921
    20 master_sites \
    21         http://mysql.mirrors.pair.com/Downloads/MySQL-5.0/ \
    22         http://mysql.he.net/Downloads/MySQL-5.0/ \
    23         http://mysql.orst.edu/Downloads/MySQL-5.0 \
    24         http://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/ \
    25         http://mirrors.sunsite.dk/mysql/Downloads/MySQL-5.0/ \
    26         http://sunsite.informatik.rwth-aachen.de/mysql/Downloads/MySQL-5.0/ \
    27         http://ftp.plusline.de/mysql/Downloads/MySQL-5.0/
     22depends_build       port:mysql5-client
    2823
    29 checksums \
    30         md5 a2a1c5a82bb22b45ab76a8ecab94e10d \
    31         sha1 a5fba8e004acc43ac1a576d728f10215f54ebe20 \
    32         rmd160 ee6717c65dc7bb6b5b596b90ef6c47c7fdebf5fb
    33 
    34 depends_lib \
    35         port:zlib \
    36         port:openssl
    37 
    38 patchfiles \
    39         patch-mysys-base64.c.diff
    40 
    41 set dbdir           ${prefix}/var/db/${name}
     24set major_version   5
     25set mysql           mysql${major_version}
     26set dbdir           ${prefix}/var/db/${mysql}
    4227set mysqluser       mysql
    4328
    44 configure.args \
    45         --mandir=${prefix}/share/man \
    46         --infodir=${prefix}/share/info \
    47         --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} \
    53         --with-zlib-dir=${prefix} \
    54         --with-openssl=${prefix} \
    55         --with-extra-charsets=complex \
    56         --with-unix-socket-path=${prefix}/var/run/${name}/mysqld.sock \
    57         --with-mysqld-user=${mysqluser} \
    58         --without-bench \
    59         --enable-thread-safe-client
     29use_configure       no
     30build               {}
    6031
    61 platform darwin 8 {
    62         configure.compiler      gcc-4.0
    63 }
     32# Create a startupitem to start/stop the server
     33startupitem.create      yes
     34startupitem.start       "${prefix}/share/${mysql}/mysql/mysql.server start"
     35startupitem.stop        "${prefix}/share/${mysql}/mysql/mysql.server stop"
    6436
    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 
    72 pre-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}
     37destroot {
     38        addgroup ${mysqluser}
     39        set gid [existsgroup ${mysqluser}]
     40        adduser ${mysqluser} gid=${gid} realname=MySQL\ Server
    7641       
    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         }
    93 }
    94 
    95 post-destroot {
    96         delete ${destroot}${prefix}/mysql-test
     42        xinstall -m 755 -o root -d ${destroot}${prefix}/var/run
    9743       
    98         # Symlink mysql binaries into bin directory, with a 5 appended to the name
    99         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
    102         }
     44        xinstall -m 755 -o ${mysqluser} -g ${mysqluser} -d \
     45                ${destroot}${dbdir} \
     46                ${destroot}${prefix}/var/run/${mysql}
     47        destroot.keepdirs-append  \
     48                ${destroot}${dbdir} \
     49                ${destroot}${prefix}/var/run/${mysql}
    10350}
    10451
    10552post-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         }
     53        ui_msg "****************************************************************"
     54        ui_msg "If this is a new MySQL server install, you might want to run:"
     55        ui_msg "sudo -u ${mysqluser} mysql_install_db${major_version}"
     56        ui_msg "to create the mysql and test databases"
     57        ui_msg "****************************************************************"
    11358}
    11459
    115 livecheck.check     regex
    116 livecheck.url       http://dev.mysql.com/
    117 livecheck.regex     "Generally Available (\[0-9\.\]+)"
     60livecheck.check     none