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
This commit is contained in:
Kirill Ponomarev 2017-08-21 14:11:33 +00:00
parent aa4f89a494
commit 28436fc627
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=448474
7 changed files with 126 additions and 2 deletions

2
GIDs
View File

@ -712,7 +712,7 @@ bopm:*:717:
# free: 768
# free: 769
postgres:*:770:
# free: 771
cockroach:*:771:
# free: 772
# free: 773
# free: 774

2
UIDs
View File

@ -718,7 +718,7 @@ _dnscrypt-wrapper:*:718:65534::0:0:dnscrypt-wrapper user:/var/empty:/usr/sbin/no
# 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

View File

@ -33,6 +33,7 @@
SUBDIR += cego
SUBDIR += cegobridge
SUBDIR += clickhouse
SUBDIR += cockroach
SUBDIR += couchdb
SUBDIR += courier-authlib-mysql
SUBDIR += courier-authlib-pgsql

View File

@ -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>

View File

@ -0,0 +1,3 @@
TIMESTAMP = 1502917562
SHA256 (cockroach-v1.0.4.src.tgz) = 1d135016ccef6c684b7414b6b26219cad74ebec9dea5421862ac8288025476b6
SIZE (cockroach-v1.0.4.src.tgz) = 69123903

View File

@ -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"

View File

@ -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/