source: trunk/dports/databases/mysql4/Portfile

Last change on this file was 146517, checked in by raimue@…, 21 months ago

Mass rev-bump dependents of port openssl due to ABI change

Disabling SSLv2 in r146162 changed the ABI of the library, leading to loading
errors for binaries with references to SSLv2 symbols.

https://lists.macosforge.org/pipermail/macports-dev/2016-March/032531.html

  • 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 146517 2016-03-10 17:49:28Z ryandesign@macports.org $
3
4PortSystem              1.0
5
6name                    mysql4
7conflicts               mysql5 mysql5-devel
8version                 4.1.22
9revision        2
10homepage                http://www.mysql.com/
11categories              databases
12platforms               darwin
13maintainers             ryandesign openmaintainer
14license                 GPL-2
15distname                mysql-${version}
16use_parallel_build      yes
17
18description \
19    Multithreaded SQL database server
20
21long_description \
22    MySQL is an open-source, multi-threaded SQL database \
23    with a command syntax very similar to mSQL.
24
25set sitedir             Downloads/MySQL-4.1/
26master_sites \
27    http://www.mirrorservice.org/sites/ftp.mysql.com/${sitedir} \
28    http://www.softagency.co.jp/MySQL/${sitedir} \
29    http://mirrors.tilian.co.uk/mysql.com/${sitedir} \
30    ftp://planetmirror.com/pub/mysql/${sitedir} \
31    ftp://sunsite.dk/mirrors/mysql/${sitedir} \
32    http://mirror.facebook.net/mysql/${sitedir} \
33    http://mysql.mediatraffic.fi/${sitedir} \
34    ftp://filepile.tiscali.de/mirror/mysql/${sitedir} \
35    ftp://ftp.rtfm.no/pub/mysql/${sitedir} \
36    http://www.mysql.cz/${sitedir} \
37    ftp://ftp.u-paris10.fr/mysql.com/${sitedir} \
38    http://mysql.oms-net.nl/${sitedir} \
39    ftp://ftp.free.fr/pub/MySQL\${sitedir}
40
41checksums \
42    md5 37b4479951fa0cf052269d27c41ca200
43
44depends_lib \
45    path:lib/libssl.dylib:openssl
46
47set dbdir               ${prefix}/var/db/mysql
48
49post-patch {
50    reinplace "s%/etc/my.cnf%${prefix}/etc/${name}/my.cnf%g" \
51        ${worksrcpath}/scripts/mysqlaccess.sh \
52        ${worksrcpath}/scripts/mysqld_multi.sh \
53        ${worksrcpath}/scripts/mysqldumpslow.sh \
54        ${worksrcpath}/scripts/mysqlhotcopy.sh \
55        ${worksrcpath}/sql-bench/bench-init.pl.sh \
56        ${worksrcpath}/support-files/my-huge.cnf.sh \
57        ${worksrcpath}/support-files/my-innodb-heavy-4G.cnf.sh \
58        ${worksrcpath}/support-files/my-large.cnf.sh \
59        ${worksrcpath}/support-files/my-medium.cnf.sh \
60        ${worksrcpath}/support-files/my-small.cnf.sh \
61        ${worksrcpath}/support-files/mysql.server.sh
62    reinplace "s%/etc/%${prefix}/etc/${name}/%g" \
63        ${worksrcpath}/mysys/default.c
64}
65
66configure.args \
67    --mandir=${prefix}/share/man \
68    --infodir=${prefix}/share/info \
69    --localstatedir=${dbdir} \
70    --sysconfdir=${prefix}/etc/${name} \
71    --with-openssl=${prefix} \
72    --with-extra-charsets=complex \
73    --with-innodb \
74    --with-unix-socket-path=${prefix}/var/run/mysqld/mysqld.sock \
75    --with-mysqld-user=mysql \
76    --without-debug \
77    --without-bench \
78    --enable-thread-safe-client
79
80variant server {
81    # Create a startupitem to start/stop the server
82    startupitem.create  yes
83    startupitem.start   "${prefix}/share/mysql/mysql.server start"
84    startupitem.stop    "${prefix}/share/mysql/mysql.server stop"
85}
86
87pre-destroot {
88    xinstall -m 755 -d ${destroot}${prefix}/var/log/mysql
89    destroot.keepdirs ${destroot}${prefix}/var/log/mysql
90   
91    if { [variant_isset server] } {
92        addgroup mysql
93        set gid [existsgroup mysql]
94        adduser mysql gid=${gid} realname=MySQL\ Server
95       
96        system "chown mysql:mysql ${destroot}${prefix}/var/log/mysql"
97    }
98}
99
100post-destroot {
101    system "rm -rf ${destroot}${prefix}/mysql-test"
102   
103    xinstall -m 775 -d ${destroot}${dbdir}
104    xinstall -m 755 -d ${destroot}${prefix}/var/run/mysqld
105    destroot.keepdirs-append ${destroot}${dbdir}
106    destroot.keepdirs-append ${destroot}${prefix}/var/run/mysqld
107    if { [variant_isset server] } {
108        xinstall -o root -m 755 -d ${destroot}${prefix}/etc/${name}
109        xinstall -o root -m 644 -c ${filespath}/my.cnf ${destroot}${prefix}/etc/${name}/my.cnf.sample
110        reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc/${name}/my.cnf.sample
111        xinstall -o mysql -g mysql -m 775 -d ${destroot}${dbdir}
112        destroot.keepdirs-append ${destroot}${dbdir}
113        system "chown -R mysql:mysql ${destroot}${dbdir}"
114       
115        xinstall -o mysql -g mysql -m 755 -d ${destroot}${prefix}/var/run/mysqld
116        destroot.keepdirs-append ${destroot}${prefix}/var/run/mysqld
117        system "chown -R mysql:mysql ${destroot}${prefix}/var/run/mysqld"
118    }
119}
120
121post-install {
122    ui_msg "******************************************************"
123    ui_msg "* You might want to run                              *"
124    ui_msg "* sudo -u mysql mysql_install_db                     *"
125    ui_msg "* if this is a new install                           *"
126    ui_msg "*                                                    *"
127    ui_msg "* If you did not choose the server variant you may   *"
128    ui_msg "* add a mysql user and you will need to change the   *"
129    ui_msg "* ownership to that user for the following:          *"
130    ui_msg "*    ${dbdir}                                        *"
131    ui_msg "*    ${prefix}/var/run/mysqld                        *"
132    ui_msg "*    ${prefix}/var/log/mysql                         *"
133    ui_msg "******************************************************"
134}
135
136livecheck.type          none
Note: See TracBrowser for help on using the repository browser.