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

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

move mysql5-devel to 5.4 branch, makefile still drops mysql-test and sql-bench (see #19415)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.1 KB
Line 
1# $Id: Portfile 61511 2009-12-13 14:37:22Z jwa@macports.org $
2
3PortSystem              1.0
4
5name                    mysql5-devel
6conflicts               mysql5 mysql4
7version                 5.4.3-beta
8
9set branch              [join [lrange [split ${version} .] 0 1] .]
10homepage                http://www.mysql.com/
11categories              databases
12platforms               darwin
13maintainers             jwa ryandesign
14license                 GPLv2
15distname                mysql-${version}
16dist_subdir             mysql5
17use_parallel_build      yes
18
19# http://bugs.mysql.com/bug.php?id=47360
20universal_variant       no
21
22description \
23    Multithreaded SQL database server
24
25long_description \
26    MySQL is an open-source, multi-threaded SQL database \
27    with a command syntax very similar to mSQL.
28
29master_sites \
30    http://mysql.mirrors.pair.com/Downloads/MySQL-${branch}/ \
31    http://mysql.he.net/Downloads/MySQL-${branch}/ \
32    http://mirrors.sunsite.dk/mysql/Downloads/MySQL-${branch}/ \
33    http://sunsite.informatik.rwth-aachen.de/mysql/Downloads/MySQL-${branch}/ \
34    http://ftp.plusline.de/mysql/Downloads/MySQL-${branch}/ \
35    http://www.innodb.com/download/innodb_plugin/:plugin
36
37checksums \
38    [suffix ${distname}] \
39    md5     9ea08558d51b1d56d3784028d57c2b08 \
40    sha1    daf96fb8adcdad23afed921727fe767ff0939711 \
41    rmd160  dc191579cc429441da7d20a1f50b25754fe37ad0
42
43depends_lib \
44    port:zlib \
45    port:openssl
46
47set major_version       [strsed ${version} {s/\..*$//}]
48set mysql               mysql${major_version}
49set libdir              ${prefix}/lib/${mysql}
50set bindir              ${libdir}/bin
51set dbdir               ${prefix}/var/db/${mysql}
52set sysconfdir          ${prefix}/etc/${mysql}
53
54if {"darwin" == ${os.platform} && ${os.major} > 8} {
55    set mysqluser       _mysql
56} else {
57    set mysqluser       mysql
58}
59
60patchfiles \
61    patch-Makefile.in.diff \
62    patch-mysql_secure_installation.sh.diff
63
64post-patch {
65    reinplace s%@BINDIR@%${bindir}%g ${worksrcpath}/scripts/mysql_secure_installation.sh
66}
67
68configure.args \
69    --mandir=${prefix}/share/man \
70    --infodir=${prefix}/share/info \
71    --localstatedir=${dbdir} \
72    --libdir=${libdir} \
73    --bindir=${bindir} \
74    --includedir=${prefix}/include/${mysql} \
75    --datadir=${prefix}/share/${mysql} \
76    --sysconfdir=${sysconfdir} \
77    --with-zlib-dir=${prefix} \
78    --with-ssl=${prefix} \
79    --with-extra-charsets=complex \
80    --with-unix-socket-path=${prefix}/var/run/${mysql}/mysqld.sock \
81    --with-mysqld-user=${mysqluser} \
82    --without-docs \
83    --with-plugins=all \
84    --enable-thread-safe-client
85# the following is in store for future
86#    --program-suffix=5
87
88# Add readline support.
89# "--without-readline" has the peculiar meaning "do not use the bundled copy
90# of readline but use the system's (i.e. MacPorts') copy of readline"
91depends_lib-append      port:readline
92configure.args-append   --without-readline
93
94# Build libmysqld embedded server
95configure.cflags-append -fPIC
96configure.cxxflags-append -fPIC
97configure.args-append --with-embedded-server --with-pic
98
99post-configure {
100    reinplace "s;openssl_includes = -I;openssl_includes_includes = -I${prefix}/include/openssl;" ${worksrcpath}/tests/Makefile
101}
102
103set plugin_version      1.0.4
104set plugin_distname     innodb_plugin-${plugin_version}
105set plugin_distfile     [suffix ${plugin_distname}]
106set plugin_worksrcdir   ${plugin_distname}
107set plugin_worksrcpath  ${workpath}/${plugin_worksrcdir}
108set innobase_dir        storage/innobase
109
110variant innodb_plugin description "Use the InnoDB Plugin ${plugin_version} instead of the built-in InnoDB support" {
111    distfiles-append        ${plugin_distfile}:plugin
112   
113    checksums-append \
114        ${plugin_distfile} \
115            md5     4350ba7c1520edce35635f982449efb3 \
116            sha1    c39e2a9cfa18b9f103c930d0c4a8edced81ed4ee \
117            rmd160  bd0467a10781677a7a7bb2e58ad38e0a43841d7f
118   
119    post-extract {
120        delete ${worksrcpath}/${innobase_dir}
121        move ${plugin_worksrcpath} ${worksrcpath}/${innobase_dir}
122    }
123}
124
125pre-destroot {
126    xinstall -m 755 -d ${destroot}${sysconfdir}
127    destroot.keepdirs-append ${destroot}${sysconfdir}
128}
129
130post-destroot {
131    # Fix paths in manpages and sample configuration files
132    foreach manpage [glob -type f ${destroot}${prefix}/share/man/man\[1-9\]/*] {
133        reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${manpage}
134    }
135    foreach samp_conffile [glob -type f ${destroot}${prefix}/share/${mysql}/mysql/my-*.cnf] {
136        reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${samp_conffile}
137    }
138   
139    # Symlink mysql binaries into bin directory, with ${major_version} appended to the name
140    foreach f [glob -tails -directory ${destroot}${bindir} my*] {
141        ln -sf ${bindir}/${f} ${destroot}${prefix}/bin/${f}${major_version}
142    }
143}
144
145post-install {
146    if {![file exists ${prefix}/etc/LaunchDaemons/org.macports.${mysql}/org.macports.${mysql}.plist]} {
147        ui_msg "The MySQL client has been installed."
148        ui_msg "If you also want a MySQL server, install the mysql5-server-devel port."
149    }
150}
151
152livecheck.type          regex
153livecheck.version       [lindex [split ${version} -] 0]
154livecheck.url           http://dev.mysql.com/
155livecheck.regex         {(5\.4\.[0-9.]+)}
Note: See TracBrowser for help on using the repository browser.