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