source: trunk/dports/databases/mysql5-devel/Portfile @ 33301

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

For all nomaintainer and openmaintainer ports, remove configure.compiler gcc-4.0
from all platform darwin 8 sections. MacPorts 1.6 already ensures that GCC 4.0
is used by default on Tiger. See #14046.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.5 KB
Line 
1# $Id: Portfile 33301 2008-01-23 10:58:09Z ryandesign@macports.org $
2
3PortSystem 1.0
4
5name                    mysql5-devel
6set vers 5.1.22
7version                 ${vers}-rc
8
9categories              databases
10platforms               darwin
11
12maintainers             jwa openmaintainer
13
14description             Multithreaded SQL database server
15long_description        MySQL is an open-source, multi-threaded SQL database \
16                                with a command syntax very similar to mSQL.
17
18homepage                http://www.mysql.com/
19master_sites            http://dev.mysql.com/get/Downloads/MySQL-5.1/ \
20    http://mysql.mirrors.pair.com/Downloads/MySQL-5.1/ \
21    http://mysql.he.net/Downloads/MySQL-5.1/ \
22    http://mysql.orst.edu/Downloads/MySQL-5.1 \
23    http://mysql.oss.eznetsols.org/Downloads/MySQL-5.1/ \
24    http://mirrors.sunsite.dk/mysql/Downloads/MySQL-5.1/ \
25    http://sunsite.informatik.rwth-aachen.de/mysql/Downloads/MySQL-5.1/ \
26    http://ftp.plusline.de/mysql/Downloads/MySQL-5.1/
27
28distname mysql-${version}
29
30checksums md5 87be813d1b2d76b1c756de0a16fa29fb \
31    sha1 97c1396e0f0561485df120cce2092192aecd12a0 \
32    rmd160 f4bd9dc6a161b4479ac09d26727ea5713c57d1b3
33
34depends_lib port:zlib \
35    port:openssl
36
37#set major_version   [strsed ${version} {s/\..*$//}]
38set major_version   [strsed ${vers} {s/\..*$//}]
39set mysql           mysql${major_version}
40#set dbdir           ${prefix}/var/db/${mysql}
41set sysconfdir      ${prefix}/etc/${name}
42set dbdir       ${prefix}/var/db/${name}
43set mysqluser   mysql
44
45configure.args  --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=${sysconfdir} \
53    --with-zlib-dir=${prefix} \
54    --with-ssl=${prefix} \
55    --with-extra-charsets=complex \
56    --with-unix-socket-path=${prefix}/var/run/${name}/mysqld.sock \
57    --with-mysqld-user=${mysqluser} \
58    --without-docs \
59    --without-bench \
60    --with-plugins=all \
61    --without-server \
62    --enable-thread-safe-client
63# the following is in store for future
64#    --program-suffix=5
65
66post-configure {
67    reinplace "s;openssl_includes = -I;openssl_includes_includes = -I${prefix}/include/openssl;" ${worksrcpath}/tests/Makefile
68}
69
70platform darwin 6 {
71    pre-fetch {
72        return -code error "no support for systems prior to 10.3"
73    }
74}
75
76platform darwin 8 {
77    configure.cppflags-append   -I${worksrcpath}/include
78}
79
80variant server description {add a startup item} {
81    configure.args-delete --without-server
82    # Create a startupitem to start/stop the server
83    startupitem.create  yes
84    startupitem.start   "${prefix}/share/${name}/mysql/mysql.server start"
85    startupitem.stop    "${prefix}/share/${name}/mysql/mysql.server stop"
86}
87
88# the directories ${prefix}/sql-bench ${prefix}/mysql-test
89destroot.violate_mtree  yes
90
91pre-destroot {
92    # Some directories we must have in all cases
93    xinstall -m 755 -d ${destroot}${prefix}/etc/${name}
94    destroot.keepdirs-append ${destroot}${prefix}/etc/${name}
95
96    # Setup only for server
97    if { [variant_isset server] } {
98        addgroup ${mysqluser}
99        set gid [existsgroup ${mysqluser}]
100        adduser ${mysqluser} gid=${gid} realname=MySQL\ Server
101
102        # Some directories we must have only if we're running as a server
103        xinstall -m 755 -o root -d ${destroot}${prefix}/var/run
104
105        xinstall -m 755 -o ${mysqluser} -g ${mysqluser} -d \
106            ${destroot}${dbdir} \
107            ${destroot}${prefix}/var/run/${name}
108        destroot.keepdirs-append  \
109            ${destroot}${dbdir} \
110            ${destroot}${prefix}/var/run/${name}
111    }
112}
113
114post-destroot {
115    delete ${destroot}${prefix}/mysql-test
116
117    # Fix paths in manpages and sample configuration files
118    foreach manpage [glob -type f ${destroot}${prefix}/share/man/man\[1-9\]/*] {
119        reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${manpage}
120    }
121    foreach samp_conffile [glob -type f ${destroot}${prefix}/share/${name}/mysql/my-*.cnf] {
122        reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${samp_conffile}
123    }
124
125    # Symlink mysql binaries into bin directory
126    foreach f [glob -tails -directory ${destroot}${prefix}/lib/${name}/bin my*] {
127        ln -sf ${prefix}/lib/${name}/bin/${f} ${destroot}${prefix}/bin/${f}${major_version}
128    }
129}
130
131post-install {
132    if { [variant_isset server] } {
133        ui_msg "******************************************************"
134        ui_msg "* In order to setup the database, you might want to run"
135        ui_msg "* sudo -u ${mysqluser} mysql_install_db5"
136        ui_msg "* if this is a new install"
137        ui_msg "******************************************************"
138    }
139}
140
141livecheck.check         regex
142livecheck.url           http://dev.mysql.com/
143livecheck.version       ${vers}
144livecheck.regex         "(5\\.1\\.\[0-9\.\]+)"
Note: See TracBrowser for help on using the repository browser.