aboutsummaryrefslogtreecommitdiffstats
path: root/testing/cockroach
diff options
context:
space:
mode:
authorJoe Holden <jwh@zorins.us>2019-03-12 18:00:52 +0000
committerKevin Daudt <kdaudt@alpinelinux.org>2019-03-12 18:01:47 +0000
commite70715d6c58800659c5dea02d61e77077c82381e (patch)
tree7f02fb830033b149f98b7dc1e5115bc9f064093c /testing/cockroach
parent3d867e61e00df71b0c719b2ac0ff0ac5b3cfd0ca (diff)
testing/cockroach: new aport
Diffstat (limited to 'testing/cockroach')
-rw-r--r--testing/cockroach/01_no_githooks.patch31
-rw-r--r--testing/cockroach/APKBUILD38
-rw-r--r--testing/cockroach/cockroach.confd1
-rw-r--r--testing/cockroach/cockroach.initd10
-rw-r--r--testing/cockroach/cockroach.pre-install6
5 files changed, 86 insertions, 0 deletions
diff --git a/testing/cockroach/01_no_githooks.patch b/testing/cockroach/01_no_githooks.patch
new file mode 100644
index 00000000000..ef641804261
--- /dev/null
+++ b/testing/cockroach/01_no_githooks.patch
@@ -0,0 +1,31 @@
+diff --git a/src/github.com/cockroachdb/cockroach/Makefile b/src/github.com/cockroachdb/cockroach/Makefile
+index f988916..5d0bf8d 100644
+--- a/src/github.com/cockroachdb/cockroach/Makefile
++++ b/src/github.com/cockroachdb/cockroach/Makefile
+@@ -253,18 +253,18 @@ $(foreach v,$(filter-out $(strip $(VALID_VARS)),$(.VARIABLES)),\
+ .ALWAYS_REBUILD:
+ .PHONY: .ALWAYS_REBUILD
+
+-ifneq ($(GIT_DIR),)
++#ifneq ($(GIT_DIR),)
+ # If we're in a git worktree, the git hooks directory may not be in our root,
+ # so we ask git for the location.
+ #
+ # Note that `git rev-parse --git-path hooks` requires git 2.5+.
+-GITHOOKS := $(subst githooks/,$(GITHOOKSDIR)/,$(wildcard githooks/*))
+-$(GITHOOKSDIR)/%: githooks/%
+- @echo installing $<
+- @rm -f $@
+- @mkdir -p $(dir $@)
+- @ln -s ../../$(basename $<) $(dir $@)
+-endif
++#GITHOOKS := $(subst githooks/,$(GITHOOKSDIR)/,$(wildcard githooks/*))
++#$(GITHOOKSDIR)/%: githooks/%
++# @echo installing $<
++# @rm -f $@
++# @mkdir -p $(dir $@)
++# @ln -s ../../$(basename $<) $(dir $@)
++#endif
+
+ .SECONDARY: pkg/ui/yarn.installed
+ pkg/ui/yarn.installed: pkg/ui/package.json pkg/ui/yarn.lock pkg/ui/yarn.protobufjs-cli.lock | bin/.submodules-initialized
diff --git a/testing/cockroach/APKBUILD b/testing/cockroach/APKBUILD
new file mode 100644
index 00000000000..5b207d893d8
--- /dev/null
+++ b/testing/cockroach/APKBUILD
@@ -0,0 +1,38 @@
+# Contributor: Joe Holden <jwh@zorins.us>
+# Maintainer: Joe Holden <jwh@zorins.us>
+pkgname=cockroach
+pkgver=2.1.6
+pkgrel=0
+pkgdesc="The open source, cloud-native SQL database."
+url="https://cockroachlabs.com"
+arch="x86_64"
+license="Apache-2.0"
+makedepends="go bash cmake autoconf linux-headers ncurses-dev"
+install="$pkgname.pre-install"
+pkgusers="cockroach"
+pkggroups="cockroach"
+subpackages="$pkgname-openrc"
+options="!check"
+source="${pkgname}-v${pkgver}.tar.gz::https://binaries.cockroachdb.com/${pkgname}-v${pkgver}.src.tgz
+ cockroach.initd
+ cockroach.confd
+ 01_no_githooks.patch"
+
+builddir=${srcdir}/${pkgname}-v${pkgver}
+
+build() {
+ cd ${builddir}
+ make CXXFLAGS="-D_BSD_SOURCE" CFLAGS="-D_BSD_SOURCE" TAGS="stdmalloc" BUILDTYPE="release" buildoss
+}
+
+package() {
+ cd ${builddir}
+
+ install -m755 -D ${srcdir}/${pkgname}.initd ${pkgdir}/etc/init.d/${pkgname}
+ install -m644 -D ${srcdir}/${pkgname}.confd ${pkgdir}/etc/conf.d/${pkgname}
+ install -m750 -o ${pkgusers} -g ${pkggroups} -D src/github.com/cockroachdb/${pkgname}/${pkgname}oss ${pkgdir}/usr/sbin/${pkgname}
+}
+sha512sums="13ced601cc840a13fa705d9678e1413635f23a5734a6a5876109d080f23f7d94418c5378e7e0d31ac24201019ee20d52a3d30391d640293dce1ecaae799bc548 cockroach-v2.1.6.tar.gz
+94264601b5b8516d87072017d40ba293d17320c706ad7a2e3c49f1af2b1030071e33cf3353adce26c634d284d0be4e41f2f9a9749c5071e9f0921ed03429f4cf cockroach.initd
+7039d17eb3c251d941bc73af2264c9618b59f8301165764371bf1539c46366d35496b2c00ea134731fd1ca9a0b362f9ba331b03aa62339f75e14504af9eb44f9 cockroach.confd
+fe611479ba32a01a1ee7770170c54570cb4ac558fb756c44c90f9e31d59a5da74af81adf1e100e723d3956aea96748955919e5b000ee91d8f8fcb26cc678556f 01_no_githooks.patch"
diff --git a/testing/cockroach/cockroach.confd b/testing/cockroach/cockroach.confd
new file mode 100644
index 00000000000..132daea1b02
--- /dev/null
+++ b/testing/cockroach/cockroach.confd
@@ -0,0 +1 @@
+cockroach_opts="start --insecure --store=/var/lib/cockroach"
diff --git a/testing/cockroach/cockroach.initd b/testing/cockroach/cockroach.initd
new file mode 100644
index 00000000000..33f4dc8636c
--- /dev/null
+++ b/testing/cockroach/cockroach.initd
@@ -0,0 +1,10 @@
+#!/sbin/openrc-run
+supervisor=supervise-daemon
+
+name=CockroachDB
+description="The open source, cloud-native SQL database."
+
+command=/usr/sbin/cockroach
+command_args="${cockroach_opts}"
+command_user="cockroach:cockroach"
+pidfile=/run/${RC_SVCNAME}.pid
diff --git a/testing/cockroach/cockroach.pre-install b/testing/cockroach/cockroach.pre-install
new file mode 100644
index 00000000000..03cdcfe1884
--- /dev/null
+++ b/testing/cockroach/cockroach.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup -S cockroach 2>/dev/null
+adduser -S -H -D -h /var/empty -s /sbin/nologin -G cockroach -g cockroach cockroach 2>/dev/null
+
+exit 0