Ticket #29170: Portfile

File Portfile, 2.6 KB (added by jogwtr@…, 13 years ago)
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$
3
4PortSystem              1.0
5
6name                    mariadb52-server
7version                 5.2.5
8set branch              [join [lrange [split ${version} .] 0 1] .]
9homepage                http://mariadb.org/
10categories              databases
11platforms               darwin
12maintainers             jogwtr@googlemail.com
13license                 GPL-2
14distfiles
15
16description \
17    A database server that offers drop-in replacement functionality for MySQL
18
19long_description \
20    MariaDB is a database server that offers drop-in replacement functionality for \
21        MySQL1. MariaDB is built by some of the original authors of MySQL, with \
22        assistance from the broader community of Free and open source software \
23        developers. In addition to the core functionality of MySQL, MariaDB offers a \
24        rich set of feature enhancements including alternate storage engines, server \
25        optimizations, and patches.
26
27depends_run \
28        port:mariadb52
29       
30set major_version       [strsed ${version} {s/\..*$//}]
31set mariadb             mysql5
32set libdir              ${prefix}/lib/${mariadb}
33set bindir              ${libdir}/bin
34set dbdir               ${prefix}/var/db/${mariadb}
35set sysconfdir          ${prefix}/etc/${mariadb}
36
37if {"darwin" == ${os.platform} && ${os.major} > 8} {
38    set mariadbuser       _mysql
39} else {
40    set mariadbuser       mysql
41}
42
43startupitem.create      yes
44startupitem.name        ${mariadb}
45startupitem.start       "${prefix}/share/${mariadb}/mysql/mysql.server start"
46startupitem.stop        "${prefix}/share/${mariadb}/mysql/mysql.server stop"
47
48use_configure           no
49supported_archs         noarch
50
51build {}
52
53destroot {
54    addgroup ${mariadbuser}
55    set gid [existsgroup ${mariadbuser}]
56    adduser ${mariadbuser} gid=${gid} realname=MariaDB\ Server
57   
58    xinstall -m 755 -o root -d ${destroot}${prefix}/var/run
59   
60    xinstall -m 755 -o ${mariadbuser} -g ${mariadbuser} -d \
61        ${destroot}${dbdir} \
62        ${destroot}${prefix}/var/log/${mariadb} \
63        ${destroot}${prefix}/var/run/${mariadb}
64    destroot.keepdirs-append  \
65        ${destroot}${dbdir} \
66        ${destroot}${prefix}/var/log/${mariadb} \
67        ${destroot}${prefix}/var/run/${mariadb}
68}
69
70post-install {
71    ui_msg "******************************************************"
72    ui_msg "* In order to setup the database, you might want to run"
73    ui_msg "* sudo -u ${mariadbuser} mysql_install_db5"
74    ui_msg "* if this is a new install"
75    ui_msg "******************************************************"
76}