Ticket #25751: Portfile

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

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