Ticket #29169: Portfile

File Portfile, 4.8 KB (added by jogwtr@…, 13 years ago)
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$
3
4PortSystem              1.0
5
6name                    mariadb52
7conflicts               mysql5-devel mysql5 mysql4 mysql5-server mysql5-server-devel
8version                 5.2.5
9set branch              [join [lrange [split ${version} .] 0 1] .]
10homepage                http://mariadb.org/
11categories              databases
12platforms               darwin
13maintainers             jogwtr@googlemail.com
14license                 GPL-2
15distname                mariadb-${version}
16use_parallel_build      yes
17
18description \
19    A database server that offers drop-in replacement functionality for MySQL
20
21long_description \
22    MariaDB is a database server that offers drop-in replacement functionality for \
23        MySQL1. MariaDB is built by some of the original authors of MySQL, with \
24        assistance from the broader community of Free and open source software \
25        developers. In addition to the core functionality of MySQL, MariaDB offers a \
26        rich set of feature enhancements including alternate storage engines, server \
27        optimizations, and patches.
28       
29
30master_sites \
31    http://mirrors.supportex.net/mariadb/mariadb-5.2.5/kvm-tarbake-jaunty-x86/ \
32        http://www.percona.com/downloads/MariaDB/${distname}/kvm-tarbake-jaunty-x86/ \
33        http://ftp.osuosl.org/pub/mariadb/${distname}/kvm-tarbake-jaunty-x86/ \
34        http://mirrors.supportex.net/mariadb/${distname}/kvm-tarbake-jaunty-x86/ \
35        http://technocation.org/mirror/mariadb/${distname}/kvm-tarbake-jaunty-x86/ \
36        http://mirror.aarnet.edu.au/pub/MariaDB/${distname}/kvm-tarbake-jaunty-x86/ \
37        http://ftp-stud.hs-esslingen.de/pub/Mirrors/mariadb/${distname}/kvm-tarbake-jaunty-x86/ \
38        http://gd.tuwien.ac.at/db/mariadb/${distname}/kvm-tarbake-jaunty-x86/ \
39        http://mirrors.fe.up.pt/pub/mariadb/${distname}/kvm-tarbake-jaunty-x86/
40       
41
42checksums               md5    a1c09a0cd1934a7a9432106123cb5a5c
43
44depends_lib \
45    port:zlib \
46    port:openssl
47
48set major_version       [strsed ${version} {s/\..*$//}]
49set mariadb             mysql5
50set libdir              ${prefix}/lib/${mariadb}
51set bindir              ${libdir}/bin
52set dbdir               ${prefix}/var/db/${mariadb}
53set sysconfdir          ${prefix}/etc/${mariadb}
54
55if {"darwin" == ${os.platform} && ${os.major} > 8} {
56    set mariadbuser       _mysql
57} else {
58    set mariadbuser       mysql
59}
60
61patchfiles \
62    patch-Makefile.in.diff
63
64configure.args \
65    --mandir=${prefix}/share/man \
66    --infodir=${prefix}/share/info \
67    --localstatedir=${dbdir} \
68    --libdir=${libdir} \
69    --bindir=${bindir} \
70    --includedir=${prefix}/include/${mariadb} \
71    --datadir=${prefix}/share/${mariadb} \
72    --sysconfdir=${sysconfdir} \
73    --with-zlib-dir=bundled \
74    --with-ssl=${prefix} \
75    --with-extra-charsets=complex \
76    --with-unix-socket-path=${prefix}/var/run/${mariadb}/mysqld.sock \
77    --with-mysqld-user=${mariadbuser} \
78    --without-docs \
79    --with-plugins=max \
80    --enable-thread-safe-client \
81        --enable-assembler \
82        --enable-thread-safe-client \
83        --with-big-tables \
84        --with-plugin-aria \
85        --with-aria-tmp-tables \
86        --without-plugin-innodb_plugin \
87        --with-libevent \
88        --enable-local-infile
89
90# Add readline support.
91# "--without-readline" has the peculiar meaning "do not use the bundled copy
92# of readline but use the system's (i.e. MacPorts') copy of readline"
93depends_lib-append      port:readline
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    set dirs ${worksrcpath}
103    foreach dir ${dirs} {
104        reinplace -E {s|-arch [a-z0-9_]+||g} \
105            ${dir}/scripts/mysql_config \
106            ${dir}/scripts/mysqlbug
107    }
108}
109
110pre-destroot {
111        xinstall -m 755 -d ${destroot}${sysconfdir}
112        destroot.keepdirs-append ${destroot}${sysconfdir}
113}
114
115post-destroot {
116    # Fix paths in manpages and sample configuration files
117    foreach manpage [glob -type f ${destroot}${prefix}/share/man/man\[1-9\]/*] {
118        reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${manpage}
119    }
120    foreach samp_conffile [glob -type f ${destroot}${prefix}/share/${mariadb}/mysql/my-*.cnf] {
121        reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${samp_conffile}
122    }
123   
124    # Symlink mysql binaries into bin directory, with ${major_version} appended to the name
125    foreach f [glob -tails -directory ${destroot}${bindir} my*] {
126        ln -sf ${bindir}/${f} ${destroot}${prefix}/bin/${f}${major_version}
127    }
128}
129
130post-install {
131    if {![file exists ${prefix}/etc/LaunchDaemons/org.macports.${mariadb}/org.macports.${mariadb}.plist]} {
132        ui_msg "The MariaDB client has been installed."
133        ui_msg "If you also want a MariaDB server, install the mariadb52-server port."
134    }
135}
136