source: trunk/dports/databases/mysql5/Portfile

Last change on this file was 146276, checked in by pixilla@…, 19 months ago

databases/mysql(s): rebump due to openssl update r146162.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.3 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 146276 2016-03-03 07:25:10Z ryandesign@macports.org $
3
4PortSystem              1.0
5
6name                    mysql5
7version                 5.1.72
8# Please set revision_client and revision_server to 0 if you bump version.
9set revision_client     1
10set revision_server     0
11set version_branch      [join [lrange [split ${version} .] 0 1] .]
12homepage                http://www.mysql.com/
13categories              databases
14platforms               darwin
15maintainers             ryandesign pixilla
16license                 GPL-2
17distname                mysql-${version}
18dist_subdir             mysql51
19use_parallel_build      yes
20
21description \
22    Multithreaded SQL database server
23
24long_description \
25    MySQL is an open-source, multi-threaded SQL database \
26    with a command syntax very similar to mSQL.
27
28master_sites            mysql:MySQL-${version_branch}
29
30checksums           rmd160  a5ba8bedf4027af90a4612a1a7f3a848999cfbf5 \
31                    sha256  c414a64722ffa89d315152a030661d34764894e293e33792809cea61c8a5303e
32
33set major_version       [strsed ${version} {s/\..*$//}]
34set mysql               mysql${major_version}
35set libdir              ${prefix}/lib/${mysql}
36set bindir              ${libdir}/bin
37set dbdir               ${prefix}/var/db/${mysql}
38set sysconfdir          ${prefix}/etc/${mysql}
39
40if {"darwin" eq ${os.platform} && ${os.major} > 8} {
41    set mysqluser       _mysql
42} else {
43    set mysqluser       mysql
44}
45add_users ${mysqluser} group=${mysqluser} realname=MySQL\ Server
46
47if {${name} eq ${subport}} {
48    # http://bugs.mysql.com/bug.php?id=47360
49    PortGroup               muniversal 1.0
50
51    revision                ${revision_client}
52    conflicts               mysql5-devel mysql4
53    depends_lib \
54        port:zlib \
55        path:lib/libssl.dylib:openssl \
56        port:tcp_wrappers
57
58    patch.pre_args      -p1
59    patchfiles          patch-Makefile.in.diff \
60                        patch-scripts-mysql_secure_installation.sh.diff
61   
62    post-patch {
63        reinplace s%@BINDIR@%${bindir}%g ${worksrcpath}/scripts/mysql_secure_installation.sh
64    }
65   
66    configure.args \
67        --mandir=${prefix}/share/man \
68        --infodir=${prefix}/share/info \
69        --localstatedir=${dbdir} \
70        --libdir=${libdir} \
71        --bindir=${bindir} \
72        --includedir=${prefix}/include/${mysql} \
73        --datadir=${prefix}/share/${mysql} \
74        --sysconfdir=${sysconfdir} \
75        --with-zlib-dir=${prefix} \
76        --with-ssl=${prefix} \
77        --with-extra-charsets=complex \
78        --with-unix-socket-path=${prefix}/var/run/${mysql}/mysqld.sock \
79        --with-mysqld-user=${mysqluser} \
80        --without-docs \
81        --with-plugins=all \
82        --enable-thread-safe-client
83    # the following is in store for future
84    #    --program-suffix=5
85   
86    # Add readline support.
87    # "--without-readline" has the peculiar meaning "do not use the bundled copy
88    # of readline but use the system's (i.e. MacPorts') copy of readline"
89    depends_lib-append      port:readline
90    configure.args-append   --without-readline
91   
92    # Build libmysqld embedded server.
93    configure.cflags-append -fPIC
94    configure.cxxflags-append -fPIC
95    configure.args-append --with-embedded-server --with-pic
96   
97    # doesn't build with clang as of 2011.06.27
98    # This is a bug in mysql's build system, fixed in 5.5
99    compiler.blacklist-append *clang*
100   
101    post-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   
117    pre-destroot {
118        xinstall -m 755 -d ${destroot}${sysconfdir}
119        destroot.keepdirs-append ${destroot}${sysconfdir}
120    }
121   
122    post-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   
137    post-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}
144
145subport mysql5-server {
146   
147    revision                ${revision_server}
148    conflicts               mysql5-server-devel
149    supported_archs         noarch
150   
151    depends_run \
152        port:mysql5
153   
154    distfiles
155   
156    use_configure           no
157   
158    build {}
159   
160    destroot {
161
162        xinstall -m 755 -o root -d ${destroot}${prefix}/var/run
163       
164        xinstall -m 755 -o ${mysqluser} -g ${mysqluser} -d \
165            ${destroot}${dbdir} \
166            ${destroot}${prefix}/var/log/${mysql} \
167            ${destroot}${prefix}/var/run/${mysql}
168        destroot.keepdirs-append  \
169            ${destroot}${dbdir} \
170            ${destroot}${prefix}/var/log/${mysql} \
171            ${destroot}${prefix}/var/run/${mysql}
172    }
173   
174   
175    startupitem.create      yes
176    startupitem.name        ${mysql}
177    startupitem.start       "${prefix}/share/${mysql}/mysql/mysql.server start"
178    startupitem.stop        "${prefix}/share/${mysql}/mysql/mysql.server stop"
179   
180    notes "If this is a new install, in order to setup the database you might want to run:" \
181        "sudo -u ${mysqluser} mysql_install_db5"
182}
183
184livecheck.type          regex
185livecheck.url           http://dev.mysql.com/downloads/mysql/${version_branch}.html
186livecheck.regex         "<h1>MySQL Community Server (${version_branch}(\.\[0-9.\]+)?)</h1>"
Note: See TracBrowser for help on using the repository browser.