Ticket #29499: Portfile

File Portfile, 5.1 KB (added by zquestz (Josh Ellithorpe), 12 years ago)

Updated Portfile with mariadb conflict.

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
3PortSystem              1.0
4PortGroup               archcheck 1.0
5PortGroup               cmake 1.0
6
7name                    percona-devel
8conflicts               mysql5 mysql4 mysql5-devel mariadb
9version                 5.5.17-rel22.1
10revision                0
11set branch              [regsub rel $version ""]
12homepage                http://www.percona.com/
13categories              databases
14platforms               darwin
15maintainers             quest
16license                 GPL-2
17distname                Percona-Server-${version}
18dist_subdir             mysql5
19use_parallel_build      yes
20
21description \
22    Multithreaded SQL database server
23
24long_description \
25    Percona is an open-source, multi-threaded SQL database \
26    with a command syntax very similar to mSQL.
27
28master_sites \
29    http://www.percona.com/redir/downloads/Percona-Server-5.5/Percona-Server-${branch}/source/
30
31checksums md5     77e2ff68ff3ffa60a48a1ee045056f15 \
32          sha1    e945653232925f85a4dddaf02647ec80bb03fa07 \
33          rmd160  f29d6983bd1685ca4c76e42ab926aefbecc0e4bb
34
35depends_lib \
36    port:zlib \
37    port:openssl \
38    port:readline \
39    port:cmake
40
41archcheck.files         lib/libz.dylib \
42                        lib/libssl.dylib \
43                        lib/libreadline.dylib
44
45set major_version       [strsed ${version} {s/\..*$//}]
46set mysql               mysql${major_version}
47set libdir              ${prefix}/lib/${mysql}
48set bindir              ${libdir}/bin
49set dbdir               ${prefix}/var/db/${mysql}
50set sysconfdir          ${prefix}/etc/${mysql}
51set sockfile            ${prefix}/var/run/mysql5/mysqld.sock
52
53if {"darwin" == ${os.platform} && ${os.major} > 8} {
54    set mysqluser       _mysql
55} else {
56    set mysqluser       mysql
57}
58
59configure.args-append       -DINSTALL_MANDIR:STRING=share/man \
60                            -DINSTALL_INFODIR:STRING=share/info \
61                            -DMYSQL_DATADIR:PATH=${dbdir} \
62                            -DFEATURE_SET:STRING=community \
63                            -DINSTALL_BINDIR:STRING=lib/${mysql}/bin \
64                            -DINSTALL_SCRIPTDIR:STRING=lib/${mysql}/bin \
65                            -DINSTALL_SBINDIR:STRING=lib/${mysql}/libexec \
66                            -DINSTALL_INCLUDEDIR:STRING=include/${mysql}/mysql \
67                            -DINSTALL_LIBDIR:STRING=lib/${mysql}/mysql \
68                            -DINSTALL_PLUGINDIR:STRING=lib/${mysql}/mysql/plugin \
69                            -DINSTALL_DOCDIR:STRING=share/doc/${mysql} \
70                            -DINSTALL_DOCREADMEDIR:STRING=share/doc/${mysql} \
71                            -DINSTALL_MYSQLDATADIR:STRING=share/${mysql} \
72                            -DINSTALL_MYSQLSHAREDIR:STRING=share/${mysql}/mysql \
73                            -DINSTALL_SHAREDIR:STRING=share/${mysql} \
74                            -DINSTALL_SUPPORTFILESDIR:STRING=share/${mysql}/mysql \
75                            -DDEFAULT_CHARSET:STRING=utf8 \
76                            -DDEFAULT_COLLATION:STRING=utf8_general_ci \
77                            -DMYSQL_UNIX_ADDR:PATH=${sockfile} \
78                            -DSYSCONFDIR:PATH=${sysconfdir} \
79                            -DWITH_EMBEDDED_SERVER:BOOL=OFF \
80                            -DWITH_READLINE:BOOL=ON \
81                            -DWITH_SSL:STRING=yes \
82                            -DWITH_ZLIB:STRING=system \
83                            -DWITH_UNIT_TESTS:BOOL=OFF \
84                            -DENABLE_GCOV:BOOL=OFF \
85                            -DENABLE_DTRACE:BOOL=OFF
86
87# verbose configure output -- remove me
88configure.args-append       -LAH
89
90# Set compiler
91configure.compiler apple-gcc-4.2
92
93post-build {
94    set dirs ${worksrcpath} 
95    foreach dir ${dirs} {
96        reinplace -E {s|-arch [a-z0-9_]+||g} \
97            ${dir}/scripts/mysql_config \
98            ${dir}/scripts/mysqlbug
99    }
100}
101
102pre-destroot {
103    xinstall -m 755 -d ${destroot}${sysconfdir}
104    destroot.keepdirs-append ${destroot}${sysconfdir}
105}
106
107post-destroot {
108    # Delete directories we don't want
109    delete ${destroot}${prefix}/data ${destroot}${prefix}/mysql-test ${destroot}${prefix}/sql-bench
110
111    # Fix paths in manpages and sample configuration files
112    foreach manpage [glob -type f ${destroot}${prefix}/share/man/man\[1-9\]/*] {
113        reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${manpage}
114    }
115    foreach samp_conffile [glob -type f ${destroot}${prefix}/share/${mysql}/mysql/my-*.cnf] {
116        reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${samp_conffile}
117    }
118   
119    # Symlink mysql binaries into bin directory, with ${major_version} appended to the name
120    foreach f [glob -tails -directory ${destroot}${bindir} my*] {
121        ln -sf ${bindir}/${f} ${destroot}${prefix}/bin/${f}${major_version}
122    }
123}
124
125post-install {
126    if {![file exists ${prefix}/etc/LaunchDaemons/org.macports.${mysql}/org.macports.${mysql}.plist]} {
127        ui_msg "The Percona client has been installed."
128        ui_msg "If you also want a Percona server, install the percona-server-devel port."
129    }
130}