source: trunk/dports/databases/mysql5/Portfile @ 36258

Last change on this file since 36258 was 36258, checked in by ryandesign@…, 12 years ago

mysql5: update to 5.0.51a. Closes #15119. This update fixes some security issues. See http://dev.mysql.com/doc/refman/5.0/en/releasenotes-cs-5-0-51a.html

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.2 KB
Line 
1# $Id: Portfile 36258 2008-04-24 21:40:28Z ryandesign@macports.org $
2
3PortSystem              1.0
4
5name                    mysql5
6version                 5.0.51a
7set branch              [join [lrange [split ${version} .] 0 1] .]
8homepage                http://www.mysql.com/
9categories              databases
10platforms               darwin
11maintainers             ryandesign
12distname                mysql-${version}
13
14description \
15    Multithreaded SQL database server
16
17long_description \
18    MySQL is an open-source, multi-threaded SQL database \
19    with a command syntax very similar to mSQL.
20
21master_sites \
22    http://mysql.mirrors.pair.com/Downloads/MySQL-${branch}/ \
23    http://mysql.he.net/Downloads/MySQL-${branch}/ \
24    http://mysql.orst.edu/Downloads/MySQL-${branch} \
25    http://mysql.oss.eznetsols.org/Downloads/MySQL-${branch}/ \
26    http://mirrors.sunsite.dk/mysql/Downloads/MySQL-${branch}/ \
27    http://sunsite.informatik.rwth-aachen.de/mysql/Downloads/MySQL-${branch}/ \
28    http://ftp.plusline.de/mysql/Downloads/MySQL-${branch}/
29
30checksums \
31    md5 a83dbdbb91267daf73d2297a9c283dd1 \
32    sha1 adc83bcae6d04fccd6360dc3aa37c64aaa479a3d \
33    rmd160 869754150ea42f2fbad36f77eb9a0e7bb6e3892b
34
35depends_lib \
36    port:zlib \
37    port:openssl
38
39set major_version       [strsed ${version} {s/\..*$//}]
40set mysql               mysql${major_version}
41set dbdir               ${prefix}/var/db/${mysql}
42set sysconfdir          ${prefix}/etc/${mysql}
43set mysqluser           mysql
44
45configure.args \
46    --mandir=${prefix}/share/man \
47    --infodir=${prefix}/share/info \
48    --localstatedir=${dbdir} \
49    --libdir=${prefix}/lib/${mysql} \
50    --bindir=${prefix}/lib/${mysql}/bin \
51    --includedir=${prefix}/include/${mysql} \
52    --datadir=${prefix}/share/${mysql} \
53    --sysconfdir=${sysconfdir} \
54    --with-zlib-dir=${prefix} \
55    --with-openssl=${prefix} \
56    --with-extra-charsets=complex \
57    --with-federated-storage-engine \
58    --with-unix-socket-path=${prefix}/var/run/${mysql}/mysqld.sock \
59    --with-mysqld-user=${mysqluser} \
60    --without-bench \
61    --enable-thread-safe-client
62
63variant server {
64    # Create a startupitem to start/stop the server
65    startupitem.create  yes
66    startupitem.start   "${prefix}/share/${mysql}/mysql/mysql.server start"
67    startupitem.stop    "${prefix}/share/${mysql}/mysql/mysql.server stop"
68}
69
70pre-destroot {
71    # Some directories we must have in all cases
72    xinstall -m 755 -d ${destroot}${sysconfdir}
73    destroot.keepdirs-append ${destroot}${sysconfdir}
74   
75    # Setup only for server
76    if { [variant_isset server] } {
77        addgroup ${mysqluser}
78        set gid [existsgroup ${mysqluser}]
79        adduser ${mysqluser} gid=${gid} realname=MySQL\ Server
80       
81        # Some directories we must have only if we're running as a server
82        xinstall -m 755 -o root -d ${destroot}${prefix}/var/run
83       
84        xinstall -m 755 -o ${mysqluser} -g ${mysqluser} -d \
85            ${destroot}${dbdir} \
86            ${destroot}${prefix}/var/run/${mysql}
87        destroot.keepdirs-append  \
88            ${destroot}${dbdir} \
89            ${destroot}${prefix}/var/run/${mysql}
90    }
91}
92
93post-destroot {
94    delete ${destroot}${prefix}/mysql-test
95   
96    # Fix paths in manpages and sample configuration files
97    foreach manpage [glob -type f ${destroot}${prefix}/share/man/man\[1-9\]/*] {
98        reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${manpage}
99    }
100    foreach samp_conffile [glob -type f ${destroot}${prefix}/share/${mysql}/mysql/my-*.cnf] {
101        reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${samp_conffile}
102    }
103   
104    # Symlink mysql binaries into bin directory, with ${major_version} appended to the name
105    foreach f [glob -tails -directory ${destroot}${prefix}/lib/${mysql}/bin my*] {
106        ln -sf ../lib/${mysql}/bin/${f} ${destroot}${prefix}/bin/${f}${major_version}
107    }
108}
109
110post-install {
111    if { [variant_isset server] } {
112        ui_msg "******************************************************"
113        ui_msg "* In order to setup the database, you might want to run"
114        ui_msg "* sudo -u ${mysqluser} mysql_install_db5"
115        ui_msg "* if this is a new install"
116        ui_msg "******************************************************"
117    }
118}
119
120livecheck.check         regex
121livecheck.url           http://dev.mysql.com/
122livecheck.regex         >GA (${major_version}\\.\[0-9.\]+)<
Note: See TracBrowser for help on using the repository browser.