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 | |
---|
3 | PortSystem 1.0 |
---|
4 | PortGroup archcheck 1.0 |
---|
5 | PortGroup cmake 1.0 |
---|
6 | |
---|
7 | name percona-devel |
---|
8 | conflicts mysql5 mysql4 mysql5-devel mariadb |
---|
9 | version 5.5.17-rel22.1 |
---|
10 | revision 0 |
---|
11 | set branch [regsub rel $version ""] |
---|
12 | homepage http://www.percona.com/ |
---|
13 | categories databases |
---|
14 | platforms darwin |
---|
15 | maintainers quest |
---|
16 | license GPL-2 |
---|
17 | distname Percona-Server-${version} |
---|
18 | dist_subdir mysql5 |
---|
19 | use_parallel_build yes |
---|
20 | |
---|
21 | description \ |
---|
22 | Multithreaded SQL database server |
---|
23 | |
---|
24 | long_description \ |
---|
25 | Percona is an open-source, multi-threaded SQL database \ |
---|
26 | with a command syntax very similar to mSQL. |
---|
27 | |
---|
28 | master_sites \ |
---|
29 | http://www.percona.com/redir/downloads/Percona-Server-5.5/Percona-Server-${branch}/source/ |
---|
30 | |
---|
31 | checksums md5 77e2ff68ff3ffa60a48a1ee045056f15 \ |
---|
32 | sha1 e945653232925f85a4dddaf02647ec80bb03fa07 \ |
---|
33 | rmd160 f29d6983bd1685ca4c76e42ab926aefbecc0e4bb |
---|
34 | |
---|
35 | depends_lib \ |
---|
36 | port:zlib \ |
---|
37 | port:openssl \ |
---|
38 | port:readline \ |
---|
39 | port:cmake |
---|
40 | |
---|
41 | archcheck.files lib/libz.dylib \ |
---|
42 | lib/libssl.dylib \ |
---|
43 | lib/libreadline.dylib |
---|
44 | |
---|
45 | set major_version [strsed ${version} {s/\..*$//}] |
---|
46 | set mysql mysql${major_version} |
---|
47 | set libdir ${prefix}/lib/${mysql} |
---|
48 | set bindir ${libdir}/bin |
---|
49 | set dbdir ${prefix}/var/db/${mysql} |
---|
50 | set sysconfdir ${prefix}/etc/${mysql} |
---|
51 | set sockfile ${prefix}/var/run/mysql5/mysqld.sock |
---|
52 | |
---|
53 | if {"darwin" == ${os.platform} && ${os.major} > 8} { |
---|
54 | set mysqluser _mysql |
---|
55 | } else { |
---|
56 | set mysqluser mysql |
---|
57 | } |
---|
58 | |
---|
59 | configure.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 |
---|
88 | configure.args-append -LAH |
---|
89 | |
---|
90 | # Set compiler |
---|
91 | configure.compiler apple-gcc-4.2 |
---|
92 | |
---|
93 | post-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 | |
---|
102 | pre-destroot { |
---|
103 | xinstall -m 755 -d ${destroot}${sysconfdir} |
---|
104 | destroot.keepdirs-append ${destroot}${sysconfdir} |
---|
105 | } |
---|
106 | |
---|
107 | post-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 | |
---|
125 | post-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 | } |
---|