Skip to content

Instantly share code, notes, and snippets.

@user454322
Last active September 21, 2016 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save user454322/bfe44361ba9d2691ae1311417783c6bc to your computer and use it in GitHub Desktop.
Save user454322/bfe44361ba9d2691ae1311417783c6bc to your computer and use it in GitHub Desktop.
CockroachDB for macports
# -*- 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
# $Id$
PortSystem 1.0
PortGroup github 1.0
github.setup cockroachdb cockroach beta-20160915
name cockroachdb
categories databases
platforms darwin
maintainers yahoo.com.mx:dev.modprobe
license Apache-2
description Scalable, survivable, strongly consistent, SQL database
long_description CockroachDB enables developers to build scalable applications \
that can survive data center outages without breaking a sweat. \
With strong consistency, distributed SQL, and transactions, \
CockroachDB frees developers to focus on what matters – \
building great applications.
homepage https://www.cockroachlabs.com
set cockroachdbsrcpath ${worksrcpath}/src/github.com/cockroachdb/cockroach
set dbgroup _cockroach
set dbuser _cockroach
set storepath ${prefix}/var/lib/cockroachdb
set logfile ${prefix}/var/log/cockroachdb.log
depends_build port:go
fetch.type git
#fetch {
# system "cp -R /Users/jalcazar/cockroach-beta-20160829 ${workpath}"
#}
#checksum {}
#extract {}
#workpath= /opt/local/var/macports/build/_private_tmp_macports_svn.macports.org_trunk_dports_databases_cockroachdb/cockroachdb/work/
#worksrcpath=/opt/local/var/macports/build/_private_tmp_macports_svn.macports.org_trunk_dports_databases_cockroachdb/cockroachdb/work/cockroach-beta-20160829
#cockroachdbsrcpath=/opt/local/var/macports/build/_private_tmp_macports_svn.macports.org_trunk_dports_databases_cockroachdb/cockroachdb/work/cockroach-beta-20160829/src/github.com/cockroachdb/cockroach
use_configure no
variant universal {}
pre-build {
set files [glob ${worksrcpath}/*]
file mkdir ${cockroachdbsrcpath}
foreach f ${files} {
file rename ${f} ${cockroachdbsrcpath}
}
}
build.post_args "-C ${cockroachdbsrcpath} build | tee /tmp/build.log"
test {
system "make test -C ${cockroachdbsrcpath}"
system "make testbuild -C ${cockroachdbsrcpath}"
}
add_users ${dbuser} group=${dbgroup} shell=/bin/sh \
home=${storepath} realname=Cockroach
destroot {
xinstall -m 755 ${cockroachdbsrcpath}/cockroach ${destroot}${prefix}/bin
xinstall -d -o ${dbuser} -g ${dbgroup} -m 755 ${storepath}
}
startupitem.create yes
startupitem.name cockroachdb
startupitem.executable sudo -u ${dbuser} ${prefix}/bin/cockroach start --store=${storepath}
startupitem.logfile ${logfile}
startupitem.logevents yes
notes "
After having started the database with `sudo port load cockroachdb`,
the connection URLs can be seen in the log file ${logfile}
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment