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

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

mysql5, mysql5-server: update to 5.1.62

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.1 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 92492 2012-04-30 05:48:48Z ryandesign@macports.org $
3
4PortSystem              1.0
5PortGroup               archcheck 1.0
6
7# http://bugs.mysql.com/bug.php?id=47360
8PortGroup               muniversal 1.0
9
10name                    mysql5
11conflicts               mysql5-devel mysql55 mysql4 mariadb
12version                 5.1.62
13set branch              [join [lrange [split ${version} .] 0 1] .]
14homepage                http://www.mysql.com/
15categories              databases
16platforms               darwin
17maintainers             ryandesign pixilla
18license                 GPL-2
19distname                mysql-${version}
20dist_subdir             mysql51
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://mirror.facebook.net/mysql/Downloads/MySQL-${branch}/ \
36    http://ftp.plusline.de/mysql/Downloads/MySQL-${branch}/
37
38checksums               rmd160  c5720deee2b04a40a20f56a3b305b37fecb343fe \
39                        sha256  97c07b2478e25892fe915b2c46e99083973f541ecdf06672241f0c22f79fead3
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
101# BUILD FIX TODO: clang, build system
102# doesn't build with clang as of 2011.06.27
103# This looks like a bug in mysql's build system
104if {${configure.compiler} == "clang"} {
105    configure.compiler llvm-gcc-4.2
106}
107
108post-build {
109    if {[variant_isset universal]} {
110        set dirs {}
111        foreach arch ${universal_archs_to_use} {
112            lappend dirs ${worksrcpath}-${arch}
113        }
114    } else {
115        set dirs ${worksrcpath}
116    }
117    foreach dir ${dirs} {
118        reinplace -E {s|-arch [a-z0-9_]+||g} \
119            ${dir}/scripts/mysql_config \
120            ${dir}/scripts/mysqlbug
121    }
122}
123
124pre-destroot {
125    xinstall -m 755 -d ${destroot}${sysconfdir}
126    destroot.keepdirs-append ${destroot}${sysconfdir}
127}
128
129post-destroot {
130    # Fix paths in manpages and sample configuration files
131    foreach manpage [glob -type f ${destroot}${prefix}/share/man/man\[1-9\]/*] {
132        reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${manpage}
133    }
134    foreach samp_conffile [glob -type f ${destroot}${prefix}/share/${mysql}/mysql/my-*.cnf] {
135        reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${samp_conffile}
136    }
137   
138    # Symlink mysql binaries into bin directory, with ${major_version} appended to the name
139    foreach f [glob -tails -directory ${destroot}${bindir} my*] {
140        ln -sf ${bindir}/${f} ${destroot}${prefix}/bin/${f}${major_version}
141    }
142}
143
144post-install {
145    if {![file exists ${prefix}/etc/LaunchDaemons/org.macports.${mysql}/org.macports.${mysql}.plist]} {
146        ui_msg "The MySQL client has been installed."
147        ui_msg "If you also want a MySQL server, install the mysql5-server port."
148    }
149}
150
151livecheck.type          regex
152livecheck.version       [lindex [split ${version} -] 0]
153livecheck.url           http://dev.mysql.com/
154livecheck.regex         "<a href=\"http://dev.mysql.com/downloads/mysql/\[^\"\]+\">(${branch}(\.\[0-9.\]+)?)\[^<\]*</a>"
Note: See TracBrowser for help on using the repository browser.