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 | |
---|
4 | PortSystem 1.0 |
---|
5 | |
---|
6 | name mysql5-server-devel |
---|
7 | version 5.5.18 |
---|
8 | revision 1 |
---|
9 | set branch [join [lrange [split ${version} .] 0 1] .] |
---|
10 | homepage http://www.mysql.com/ |
---|
11 | categories databases |
---|
12 | platforms darwin |
---|
13 | maintainers ryandesign jwa |
---|
14 | license GPL-2 |
---|
15 | distfiles |
---|
16 | |
---|
17 | description \ |
---|
18 | Multithreaded SQL database server |
---|
19 | |
---|
20 | long_description \ |
---|
21 | MySQL is an open-source, multi-threaded SQL database \ |
---|
22 | with a command syntax very similar to mSQL. |
---|
23 | |
---|
24 | depends_run \ |
---|
25 | port:mysql5-devel |
---|
26 | |
---|
27 | set major_version [strsed ${version} {s/\..*$//}] |
---|
28 | set mysql mysql${major_version} |
---|
29 | set libdir ${prefix}/lib/${mysql} |
---|
30 | set bindir ${libdir}/bin |
---|
31 | set dbdir ${prefix}/var/db/${mysql} |
---|
32 | set sysconfdir ${prefix}/etc/${mysql} |
---|
33 | |
---|
34 | if {"darwin" == ${os.platform} && ${os.major} > 8} { |
---|
35 | set mysqluser _mysql |
---|
36 | } else { |
---|
37 | set mysqluser mysql |
---|
38 | } |
---|
39 | |
---|
40 | startupitem.create yes |
---|
41 | startupitem.name ${mysql} |
---|
42 | startupitem.start "${prefix}/share/${mysql}/mysql/mysql.server start" |
---|
43 | startupitem.stop "${prefix}/share/${mysql}/mysql/mysql.server stop" |
---|
44 | |
---|
45 | use_configure no |
---|
46 | supported_archs noarch |
---|
47 | |
---|
48 | build {} |
---|
49 | |
---|
50 | destroot { |
---|
51 | addgroup ${mysqluser} |
---|
52 | set gid [existsgroup ${mysqluser}] |
---|
53 | adduser ${mysqluser} gid=${gid} realname=MySQL\ Server |
---|
54 | |
---|
55 | xinstall -m 755 -o root -d ${destroot}${prefix}/var/run |
---|
56 | |
---|
57 | xinstall -m 755 -o ${mysqluser} -g ${mysqluser} -d \ |
---|
58 | ${destroot}${dbdir} \ |
---|
59 | ${destroot}${prefix}/var/log/${mysql} \ |
---|
60 | ${destroot}${prefix}/var/run/${mysql} |
---|
61 | destroot.keepdirs-append \ |
---|
62 | ${destroot}${dbdir} \ |
---|
63 | ${destroot}${prefix}/var/log/${mysql} \ |
---|
64 | ${destroot}${prefix}/var/run/${mysql} |
---|
65 | } |
---|
66 | |
---|
67 | post-install { |
---|
68 | ui_msg "******************************************************" |
---|
69 | ui_msg "* In order to setup the database, you might want to run" |
---|
70 | ui_msg "* sudo -u ${mysqluser} mysql_install_db5" |
---|
71 | ui_msg "* if this is a new install" |
---|
72 | ui_msg "******************************************************" |
---|
73 | } |
---|
74 | |
---|
75 | livecheck.type regex |
---|
76 | livecheck.version [lindex [split ${version} -] 0] |
---|
77 | livecheck.url http://dev.mysql.com/ |
---|
78 | livecheck.regex "<a href=\"http://dev.mysql.com/downloads/mysql/\[^\"\]+\">(${branch}(\.\[0-9.\]+)?)\[^<\]*</a>" |
---|