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

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

mysql5, mysql5-devel: remove -arch flags from mysql_config and mysqlbug scripts, which unbreaks these scripts for those using universal builds (they were broken by switching to the muniversal portgroup)

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