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

Last change on this file since 63790 was 63790, checked in by ryandesign@…, 7 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: 4.7 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
10conflicts               mysql5-devel mysql4
11version                 5.1.43
12revision                1
13set branch              [join [lrange [split ${version} .] 0 1] .]
14homepage                http://www.mysql.com/
15categories              databases
16platforms               darwin
17maintainers             ryandesign
18license                 GPLv2
19distname                mysql-${version}
20use_parallel_build      yes
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
36checksums \
37    md5     451fd3e8c55eecdf4c3ed109dce62f01 \
38    sha1    fff98e59f17487d646998662409bc894a422b7e9 \
39    rmd160  51aa017edc165f13f2cb696ee210505b8f2a21ee
40
41depends_lib \
42    port:zlib \
43    port:openssl
44
45archcheck.files         lib/libz.dylib \
46                        lib/libssl.dylib
47
48set major_version       [strsed ${version} {s/\..*$//}]
49set mysql               mysql${major_version}
50set libdir              ${prefix}/lib/${mysql}
51set bindir              ${libdir}/bin
52set dbdir               ${prefix}/var/db/${mysql}
53set sysconfdir          ${prefix}/etc/${mysql}
54
55if {"darwin" == ${os.platform} && ${os.major} > 8} {
56    set mysqluser       _mysql
57} else {
58    set mysqluser       mysql
59}
60
61patchfiles \
62    patch-Makefile.in.diff \
63    patch-mysql_secure_installation.sh.diff
64
65post-patch {
66    reinplace s%@BINDIR@%${bindir}%g ${worksrcpath}/scripts/mysql_secure_installation.sh
67}
68
69configure.args \
70    --mandir=${prefix}/share/man \
71    --infodir=${prefix}/share/info \
72    --localstatedir=${dbdir} \
73    --libdir=${libdir} \
74    --bindir=${bindir} \
75    --includedir=${prefix}/include/${mysql} \
76    --datadir=${prefix}/share/${mysql} \
77    --sysconfdir=${sysconfdir} \
78    --with-zlib-dir=${prefix} \
79    --with-ssl=${prefix} \
80    --with-extra-charsets=complex \
81    --with-unix-socket-path=${prefix}/var/run/${mysql}/mysqld.sock \
82    --with-mysqld-user=${mysqluser} \
83    --without-docs \
84    --with-plugins=all \
85    --enable-thread-safe-client
86# the following is in store for future
87#    --program-suffix=5
88
89# Add readline support.
90# "--without-readline" has the peculiar meaning "do not use the bundled copy
91# of readline but use the system's (i.e. MacPorts') copy of readline"
92depends_lib-append      port:readline
93archcheck.files-append  lib/libreadline.dylib
94configure.args-append   --without-readline
95
96# Build libmysqld embedded server.
97configure.cflags-append -fPIC
98configure.cxxflags-append -fPIC
99configure.args-append --with-embedded-server --with-pic
100
101post-build {
102    if {[variant_isset universal]} {
103        set dirs {}
104        foreach arch ${universal_archs_to_use} {
105            lappend dirs ${worksrcpath}-${arch}
106        }
107    } else {
108        set dirs ${worksrcpath}
109    }
110    foreach dir ${dirs} {
111        reinplace -E {s|-arch [a-z0-9_]+||g} \
112            ${dir}/scripts/mysql_config \
113            ${dir}/scripts/mysqlbug
114    }
115}
116
117pre-destroot {
118    xinstall -m 755 -d ${destroot}${sysconfdir}
119    destroot.keepdirs-append ${destroot}${sysconfdir}
120}
121
122post-destroot {
123    # Fix paths in manpages and sample configuration files
124    foreach manpage [glob -type f ${destroot}${prefix}/share/man/man\[1-9\]/*] {
125        reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${manpage}
126    }
127    foreach samp_conffile [glob -type f ${destroot}${prefix}/share/${mysql}/mysql/my-*.cnf] {
128        reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${samp_conffile}
129    }
130   
131    # Symlink mysql binaries into bin directory, with ${major_version} appended to the name
132    foreach f [glob -tails -directory ${destroot}${bindir} my*] {
133        ln -sf ${bindir}/${f} ${destroot}${prefix}/bin/${f}${major_version}
134    }
135}
136
137post-install {
138    if {![file exists ${prefix}/etc/LaunchDaemons/org.macports.${mysql}/org.macports.${mysql}.plist]} {
139        ui_msg "The MySQL client has been installed."
140        ui_msg "If you also want a MySQL server, install the mysql5-server port."
141    }
142}
143
144livecheck.type          regex
145livecheck.version       [lindex [split ${version} -] 0]
146livecheck.url           http://dev.mysql.com/
147livecheck.regex         "<a href=\"http://dev.mysql.com/downloads/mysql/\[^\"\]+\">(${branch}(\.\[0-9.\]+)?)\[^<\]*</a>"
Note: See TracBrowser for help on using the repository browser.