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

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

mysql5: add pixilla as comaintainer

  • 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 91846 2012-04-11 22:12:34Z 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.61
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}
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://mirror.facebook.net/mysql/Downloads/MySQL-${branch}/ \
35    http://ftp.plusline.de/mysql/Downloads/MySQL-${branch}/
36
37checksums               rmd160  392b7394a0f7821134f177a3ba4580a29d60e3f4 \
38                        sha256  879c6424282e38eb1ba9b1910db98b378a5574ceed431a69e344643a5524f918
39
40depends_lib \
41    port:zlib \
42    port:openssl
43
44archcheck.files         lib/libz.dylib \
45                        lib/libssl.dylib
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
92archcheck.files-append  lib/libreadline.dylib
93configure.args-append   --without-readline
94
95# Build libmysqld embedded server.
96configure.cflags-append -fPIC
97configure.cxxflags-append -fPIC
98configure.args-append --with-embedded-server --with-pic
99
100# BUILD FIX TODO: clang, build system
101# doesn't build with clang as of 2011.06.27
102# This looks like a bug in mysql's build system
103if {${configure.compiler} == "clang"} {
104    configure.compiler llvm-gcc-4.2
105}
106
107post-build {
108    if {[variant_isset universal]} {
109        set dirs {}
110        foreach arch ${universal_archs_to_use} {
111            lappend dirs ${worksrcpath}-${arch}
112        }
113    } else {
114        set dirs ${worksrcpath}
115    }
116    foreach dir ${dirs} {
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 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.