source: trunk/dports/databases/percona/Portfile @ 87459

Last change on this file since 87459 was 87459, checked in by pixilla@…, 9 years ago

databases/percona:

  • Add percona database ports.
  • 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 87459 2011-11-22 16:19:55Z pixilla@macports.org $
3
4PortSystem              1.0
5PortGroup               archcheck 1.0
6PortGroup               cmake 1.0
7
8name                    percona
9conflicts               mysql4 mysql5 mysql5-devel mariadb
10version                 5.5.17-rel22.1
11set branch              [regsub rel $version ""]
12homepage                http://www.percona.com/
13categories              databases
14platforms               darwin
15maintainers             mac.com:quest openmaintainer
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 meconfigure.args-append       -LAH
88
89# Set compiler
90configure.compiler apple-gcc-4.2
91
92post-build {
93    set dirs ${worksrcpath}    foreach dir ${dirs} {
94        reinplace -E {s|-arch [a-z0-9_]+||g} \
95            ${dir}/scripts/mysql_config \
96            ${dir}/scripts/mysqlbug
97    }
98}
99
100pre-destroot {
101    xinstall -m 755 -d ${destroot}${sysconfdir}
102    destroot.keepdirs-append ${destroot}${sysconfdir}
103}
104
105post-destroot {
106    # Delete directories we don't want    delete ${destroot}${prefix}/data ${destroot}${prefix}/mysql-test ${destroot}${prefix}/sql-bench
107
108    # Fix paths in manpages and sample configuration files
109    foreach manpage [glob -type f ${destroot}${prefix}/share/man/man\[1-9\]/*] {
110        reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${manpage}
111    }
112    foreach samp_conffile [glob -type f ${destroot}${prefix}/share/${mysql}/mysql/my-*.cnf] {
113        reinplace "s|/etc/my.cnf|${sysconfdir}/my.cnf|g" ${samp_conffile}
114    }
115    # Symlink mysql binaries into bin directory, with ${major_version} appended to the name
116    foreach f [glob -tails -directory ${destroot}${bindir} my*] {
117        ln -sf ${bindir}/${f} ${destroot}${prefix}/bin/${f}${major_version}
118    }
119}
120
121post-install {
122    if {![file exists ${prefix}/etc/LaunchDaemons/org.macports.${mysql}/org.macports.${mysql}.plist]} {
123        ui_msg "The Percona client has been installed."
124        ui_msg "If you also want a Percona server, install the percona-server-devel port."
125    }
126}
Note: See TracBrowser for help on using the repository browser.