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

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

make port lint clean

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.5 KB
Line 
1# $Id: Portfile 33253 2008-01-22 10:55:12Z jwa@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.compiler  gcc-4.0
78    configure.cppflags-append   -I${worksrcpath}/include
79}
80
81variant server description {add a startup item} {
82    configure.args-delete --without-server
83    # Create a startupitem to start/stop the server
84    startupitem.create  yes
85    startupitem.start   "${prefix}/share/${name}/mysql/mysql.server start"
86    startupitem.stop    "${prefix}/share/${name}/mysql/mysql.server stop"
87}
88
89# the directories ${prefix}/sql-bench ${prefix}/mysql-test
90destroot.violate_mtree  yes
91
92pre-destroot {
93    # Some directories we must have in all cases
94    xinstall -m 755 -d ${destroot}${prefix}/etc/${name}
95    destroot.keepdirs-append ${destroot}${prefix}/etc/${name}
96
97    # Setup only for server
98    if { [variant_isset server] } {
99        addgroup ${mysqluser}
100        set gid [existsgroup ${mysqluser}]
101        adduser ${mysqluser} gid=${gid} realname=MySQL\ Server
102
103        # Some directories we must have only if we're running as a server
104        xinstall -m 755 -o root -d ${destroot}${prefix}/var/run
105
106        xinstall -m 755 -o ${mysqluser} -g ${mysqluser} -d \
107            ${destroot}${dbdir} \
108            ${destroot}${prefix}/var/run/${name}
109        destroot.keepdirs-append  \
110            ${destroot}${dbdir} \
111            ${destroot}${prefix}/var/run/${name}
112    }
113}
114
115post-destroot {
116    delete ${destroot}${prefix}/mysql-test
117
118    # Fix paths in manpages and sample configuration files
119    foreach manpage [glob -type f ${destroot}${prefix}/share/man/man\[1-9\]/*] {
120        reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${manpage}
121    }
122    foreach samp_conffile [glob -type f ${destroot}${prefix}/share/${name}/mysql/my-*.cnf] {
123        reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${samp_conffile}
124    }
125
126    # Symlink mysql binaries into bin directory
127    foreach f [glob -tails -directory ${destroot}${prefix}/lib/${name}/bin my*] {
128        ln -sf ${prefix}/lib/${name}/bin/${f} ${destroot}${prefix}/bin/${f}${major_version}
129    }
130}
131
132post-install {
133    if { [variant_isset server] } {
134        ui_msg "******************************************************"
135        ui_msg "* In order to setup the database, you might want to run"
136        ui_msg "* sudo -u ${mysqluser} mysql_install_db5"
137        ui_msg "* if this is a new install"
138        ui_msg "******************************************************"
139    }
140}
141
142livecheck.check         regex
143livecheck.url           http://dev.mysql.com/
144livecheck.version       ${vers}
145livecheck.regex         "(5\\.1\\.\[0-9\.\]+)"
Note: See TracBrowser for help on using the repository browser.