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

Last change on this file since 26683 was 26683, checked in by jmpp@…, 13 years ago

Rework the post-destroot stage (you only need to cd into the dir once, not in every iteration of the loop)
and get rid of unnecessary system calls. Also while at it, enable building of the documentation, it adds
no extra deps and the more the better, always! (as long, of course, as it's good quality ;-).

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