Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Aug 2017 14:11:33 +0000 (UTC)
From:      Kirill Ponomarev <krion@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r448474 - in head: . databases databases/cockroach databases/cockroach/files
Message-ID:  <201708211411.v7LEBYsa037922@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: krion
Date: Mon Aug 21 14:11:33 2017
New Revision: 448474
URL: https://svnweb.freebsd.org/changeset/ports/448474

Log:
  CockroachDB is a distributed SQL database built on a transactional
  and strongly-consistent key-value store. It scales horizontally;
  survives disk, machine, rack, and even datacenter failures with
  minimal latency disruption and no manual intervention; supports
  strongly-consistent ACID transactions; and provides a familiar SQL
  API for structuring, manipulating, and querying data.
  
  CockroachDB is inspired by Google's Spanner and F1 technologies, and
  it's completely open source.
  
  PR:		221635
  Submitted by:	James Nugent <freebsd@jen20.com>
  Approved by:	mat (mentor)
  Differential Revision: https://reviews.freebsd.org/D12088

Added:
  head/databases/cockroach/
  head/databases/cockroach/Makefile   (contents, props changed)
  head/databases/cockroach/distinfo   (contents, props changed)
  head/databases/cockroach/files/
  head/databases/cockroach/files/cockroach.in   (contents, props changed)
  head/databases/cockroach/pkg-descr   (contents, props changed)
Modified:
  head/GIDs
  head/UIDs
  head/databases/Makefile

Modified: head/GIDs
==============================================================================
--- head/GIDs	Mon Aug 21 13:34:54 2017	(r448473)
+++ head/GIDs	Mon Aug 21 14:11:33 2017	(r448474)
@@ -712,7 +712,7 @@ bopm:*:717:
 # free: 768
 # free: 769
 postgres:*:770:
-# free: 771
+cockroach:*:771:
 # free: 772
 # free: 773
 # free: 774

Modified: head/UIDs
==============================================================================
--- head/UIDs	Mon Aug 21 13:34:54 2017	(r448473)
+++ head/UIDs	Mon Aug 21 14:11:33 2017	(r448474)
@@ -718,7 +718,7 @@ _dnscrypt-wrapper:*:718:65534::0:0:dnscrypt-wrapper us
 # free: 768
 # free: 769
 postgres:*:770:770::0:0:PostgreSQL Daemon:/var/db/postgres:/bin/sh
-# free: 771
+cockroach:*:771:771::0:0:CockroachDB Daemon:/var/db/cockroach:/usr/sbin/nologin
 # free: 772
 # free: 773
 # free: 774

Modified: head/databases/Makefile
==============================================================================
--- head/databases/Makefile	Mon Aug 21 13:34:54 2017	(r448473)
+++ head/databases/Makefile	Mon Aug 21 14:11:33 2017	(r448474)
@@ -33,6 +33,7 @@
     SUBDIR += cego
     SUBDIR += cegobridge
     SUBDIR += clickhouse
+    SUBDIR += cockroach
     SUBDIR += couchdb
     SUBDIR += courier-authlib-mysql
     SUBDIR += courier-authlib-pgsql

Added: head/databases/cockroach/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/cockroach/Makefile	Mon Aug 21 14:11:33 2017	(r448474)
@@ -0,0 +1,40 @@
+# $FreeBSD$
+
+PORTNAME=	cockroach
+PORTVERSION=	1.0.4
+DISTVERSIONPREFIX=	v
+CATEGORIES=	databases
+MASTER_SITES=	https://binaries.cockroachdb.com/
+EXTRACT_SUFX=	.src.tgz
+
+MAINTAINER=	james@jen20.com
+COMMENT=	Cloud-native SQL database that survive disasters
+
+LICENSE=	APACHE20
+LICENSE_FILE=	${WRKSRC}/src/github.com/cockroachdb/cockroach/LICENSE
+
+BUILD_DEPENDS=	bash:shells/bash \
+		cmake:devel/cmake \
+		go:lang/go
+
+USES=		gmake
+
+USE_RC_SUBR=	cockroach
+
+PLIST_FILES=	bin/cockroach
+
+USERS=		cockroach
+GROUPS=		cockroach
+
+post-patch:
+	@${REINPLACE_CMD} -e 's|-DCMAKE_CXX_FLAGS=-DNDEBUG)|-DCMAKE_CXX_FLAGS=-DNDEBUG) -DFAIL_ON_WARNINGS=OFF|g' \
+	  	${WRKSRC}/src/github.com/cockroachdb/cockroach/build/common.mk
+
+do-build:
+	@${SETENV} -i PATH="${PATH}" \
+		${MAKE_CMD} -C ${WRKSRC} buildoss
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/src/github.com/cockroachdb/cockroach/cockroach ${STAGEDIR}${PREFIX}/bin/
+
+.include <bsd.port.mk>

Added: head/databases/cockroach/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/cockroach/distinfo	Mon Aug 21 14:11:33 2017	(r448474)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1502917562
+SHA256 (cockroach-v1.0.4.src.tgz) = 1d135016ccef6c684b7414b6b26219cad74ebec9dea5421862ac8288025476b6
+SIZE (cockroach-v1.0.4.src.tgz) = 69123903

Added: head/databases/cockroach/files/cockroach.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/cockroach/files/cockroach.in	Mon Aug 21 14:11:33 2017	(r448474)
@@ -0,0 +1,69 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: cockroach
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# cockroach_enable (bool):	Set to NO by default.
+#				Set it to YES to enable cockroach.
+# cockroach_user (user):        Set user to run cockroach.
+#                               Default is "cockroach".
+# cockroach_group (group):      Set group to run cockroach.
+#                               Default is "cockroach".
+# cockroach_dir (dir):          Set dir to run cockroach in.
+#                               Default is "path=/var/db/cockroach".
+# cockroach_flags (string):     Set additional flags with which to run cockroach.
+#                               Default is "--insecure --host=localhost".
+
+. /etc/rc.subr
+
+name=cockroach
+rcvar=cockroach_enable
+
+load_rc_config $name
+
+: ${cockroach_enable:="NO"}
+: ${cockroach_user:="cockroach"}
+: ${cockroach_group:="cockroach"}
+: ${cockroach_dir:="/var/db/cockroachdb"}
+: ${cockroach_store:="--store=path=${cockroach_dir}"}
+: ${cockroach_flags:="--insecure --host=localhost"}
+
+start_precmd=cockroach_startprecmd
+start_cmd=${name}_start
+stop_cmd=${name}_stop
+
+pidfile=/var/run/cockroach.pid
+command="%%PREFIX%%/bin/cockroach"
+
+cockroach_startprecmd()
+{
+        if [ ! -e ${pidfile} ]; then
+                install -o ${cockroach_user} -g ${cockroach_group} /dev/null ${pidfile};
+        fi
+
+        if [ ! -d ${cockroach_dir} ]; then
+                install -d -o ${cockroach_user} -g ${cockroach_group} ${cockroach_dir}
+        fi
+}
+
+cockroach_start() {
+	/usr/sbin/daemon -u ${cockroach_user} \
+		-p $pidfile ${command} \
+		start \
+		${cockroach_store} \
+		${cockroach_flags}
+}
+
+cockroach_stop() {
+	[ -f $pidfile ] \
+		&& ${command} quit --insecure \
+		|| echo ${name} not running? \(check ${pidfile}\)
+}
+
+run_rc_command "$1"

Added: head/databases/cockroach/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/databases/cockroach/pkg-descr	Mon Aug 21 14:11:33 2017	(r448474)
@@ -0,0 +1,11 @@
+CockroachDB is a distributed SQL database built on a transactional
+and strongly-consistent key-value store. It scales horizontally;
+survives disk, machine, rack, and even datacenter failures with
+minimal latency disruption and no manual intervention; supports
+strongly-consistent ACID transactions; and provides a familiar SQL
+API for structuring, manipulating, and querying data.
+
+CockroachDB is inspired by Google's Spanner and F1 technologies, and
+it's completely open source.
+
+WWW: https://cockroachlabs.io/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201708211411.v7LEBYsa037922>