Ticket #52351: Portfile

File Portfile, 2.2 KB (added by user454322 (Javier), 8 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
5PortGroup               github 1.0
6
7github.setup            cockroachdb cockroach beta-20160915
8name                    cockroachdb
9categories              databases
10platforms               darwin
11maintainers             yahoo.com.mx:dev.modprobe
12license                 Apache-2
13
14description             Scalable, survivable, strongly consistent, SQL database
15
16long_description        CockroachDB enables developers to build scalable applications \
17                        that can survive data center outages without breaking a sweat. \
18                        With strong consistency, distributed SQL, and transactions, \
19                        CockroachDB frees developers to focus on what matters  \
20                        building great applications.
21
22homepage                https://www.cockroachlabs.com
23
24
25set cockroachdbsrcpath ${worksrcpath}/src/github.com/cockroachdb/cockroach
26set dbgroup _cockroach
27set dbuser _cockroach
28set storepath ${prefix}/var/lib/cockroachdb
29set logfile ${prefix}/var/log/cockroachdb.log
30
31
32depends_build           port:go
33
34
35fetch.type              git
36
37
38use_configure           no
39variant universal {}
40
41
42pre-build {
43    set files [glob ${worksrcpath}/*]
44    file mkdir ${cockroachdbsrcpath}
45    foreach f ${files} {
46        file rename ${f} ${cockroachdbsrcpath}
47    }
48}
49
50build.post_args         "-C ${cockroachdbsrcpath} build"
51
52
53test {
54    system "make test -C ${cockroachdbsrcpath}"
55    system "make testbuild -C ${cockroachdbsrcpath}"
56}
57
58
59add_users               ${dbuser} group=${dbgroup} shell=/bin/sh \
60                        home=${storepath} realname=Cockroach
61
62
63destroot {
64    xinstall -m 755 ${cockroachdbsrcpath}/cockroach ${destroot}${prefix}/bin
65
66    xinstall -d -o ${dbuser} -g ${dbgroup} -m 755 ${storepath}
67}
68
69
70startupitem.create      yes
71startupitem.name        cockroachdb
72startupitem.executable  sudo -u ${dbuser} ${prefix}/bin/cockroach start --store=${storepath}
73startupitem.logfile     ${logfile}
74startupitem.logevents   yes
75
76
77notes "
78After having started the database with `sudo port load cockroachdb`,
79the connection URLs can be seen in the log file ${logfile}
80"
81