Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/cockroach/files/, dev-db/cockroach/
Date: Thu, 04 May 2017 22:44:07
Message-Id: 1493937738.adcc810ebc83e3dbd6ef27017bbab15e01f19d09.williamh@gentoo
1 commit: adcc810ebc83e3dbd6ef27017bbab15e01f19d09
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 4 22:40:59 2017 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Thu May 4 22:42:18 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=adcc810e
7
8 dev-db/cockroach: new package
9
10 This is a scalable open source database. For more information see the home page below.
11
12 http://www.cockroachlabs.com
13
14 Package-Manager: Portage-2.3.5, Repoman-2.3.1
15
16 dev-db/cockroach/Manifest | 1 +
17 dev-db/cockroach/cockroach-1.0_rc1.ebuild | 59 ++++++++++++++++++++++++++++
18 dev-db/cockroach/files/cockroach-limits.conf | 4 ++
19 dev-db/cockroach/files/cockroach.confd | 14 +++++++
20 dev-db/cockroach/files/cockroach.initd | 23 +++++++++++
21 dev-db/cockroach/metadata.xml | 12 ++++++
22 6 files changed, 113 insertions(+)
23
24 diff --git a/dev-db/cockroach/Manifest b/dev-db/cockroach/Manifest
25 new file mode 100644
26 index 00000000000..4a1e42d6a29
27 --- /dev/null
28 +++ b/dev-db/cockroach/Manifest
29 @@ -0,0 +1 @@
30 +DIST cockroach-v1.0-rc.1.src.tgz 68784067 SHA256 162e3954ff41515bf2ab2017ab38f9cdf76775d7d67fdeead343234d470dca6c SHA512 c68fc712068cbfce167d98008cdcb46270a8fa772624281da23a70d0492c7990c9ce8513334fedc31d7dde5176087fa6211a4e90d77741ed0079f9568c71e0ff WHIRLPOOL 510dbefb6348f9707e1e3fcd94d873911350b8d2d767c093df3bfff514e7f72ca1ff1e16d0539c48f80dd53a725d8ab4f3fe901862ee88a4e5e1e9999034eeaf
31
32 diff --git a/dev-db/cockroach/cockroach-1.0_rc1.ebuild b/dev-db/cockroach/cockroach-1.0_rc1.ebuild
33 new file mode 100644
34 index 00000000000..18467a3c8a6
35 --- /dev/null
36 +++ b/dev-db/cockroach/cockroach-1.0_rc1.ebuild
37 @@ -0,0 +1,59 @@
38 +# Copyright 1999-2017 Gentoo Foundation
39 +# Distributed under the terms of the GNU General Public License v2
40 +
41 +EAPI=6
42 +MY_PV=v1.0-rc.1
43 +CHECKREQS_MEMORY="2G"
44 +
45 +inherit check-reqs toolchain-funcs user
46 +
47 +DESCRIPTION="open source database for building cloud services"
48 +HOMEPAGE="https://www.cockroachlabs.com"
49 +SRC_URI="https://binaries.cockroachdb.com/cockroach-${MY_PV}.src.tgz"
50 +
51 +LICENSE="Apache-2.0"
52 +SLOT="0"
53 +KEYWORDS="~amd64"
54 +IUSE=""
55 +
56 +DEPEND=">=dev-lang/go-1.8.1"
57 +
58 +S="${WORKDIR}/cockroach-${MY_PV}"
59 +
60 +pkg_pretend() {
61 + check-reqs_pkg_pretend
62 + if [[ $(gcc-major-version) -lt 6 ]]; then
63 + eerror "Cockroach cannot be built with this version of gcc."
64 + eerror "You need at least gcc-6.0"
65 + die "Your C compiler is too old for this package."
66 + fi
67 +}
68 +
69 +pkg_setup() {
70 + check-reqs_pkg_setup
71 + enewgroup cockroach
72 + enewuser cockroach -1 /bin/sh /var/lib/cockroach cockroach
73 +}
74 +
75 +src_compile() {
76 + emake GOPATH="${S}" build || die
77 +}
78 +
79 +src_install() {
80 + emake GOPATH="${S}" install || die
81 +dobin bin/*
82 +insinto /etc/security/limits.d
83 +newins "${FILESDIR}"/cockroach-limits.conf cockroach.conf
84 +newinitd "${FILESDIR}"/cockroach.initd cockroach
85 +dodir /var/log/cockroach
86 +fowners cockroach:cockroach /var/log/cockroach
87 +if [[ -z ${REPLACING_VERSIONS} ]]; then
88 + ewarn "The default setup is for the first node of an insecure"
89 + ewarn "cluster that only listens on localhost."
90 + ewarn "Please read the cockroach manual at the following url"
91 + ewarn "and configure /etc/conf.d/cockroach correctly if you"
92 + ewarn "plan to use it in production."
93 + elog
94 + elog "http://cockroachlabs.com/docs"
95 + fi
96 +}
97
98 diff --git a/dev-db/cockroach/files/cockroach-limits.conf b/dev-db/cockroach/files/cockroach-limits.conf
99 new file mode 100644
100 index 00000000000..2014a5d508c
101 --- /dev/null
102 +++ b/dev-db/cockroach/files/cockroach-limits.conf
103 @@ -0,0 +1,4 @@
104 +# This is needed because cockroach can open a high number of file
105 +# descriptors
106 +cockroach soft nofile 35000
107 +cockroach hard nofile 35000
108
109 diff --git a/dev-db/cockroach/files/cockroach.confd b/dev-db/cockroach/files/cockroach.confd
110 new file mode 100644
111 index 00000000000..fb9b740aa70
112 --- /dev/null
113 +++ b/dev-db/cockroach/files/cockroach.confd
114 @@ -0,0 +1,14 @@
115 +# The default setup is for the first node of an insecure cluster that only
116 +# listens on localhost.
117 +# Please read the cockroach manual at the following url and configure
118 +# the start_args and stop_args correctly if you plan to use cockroach in
119 +# production.
120 +#
121 +# http://cockroachlabs.com/do# cs
122 +#
123 +# arguments to use when starting the database
124 +start_args="--http-host=localhost --host=localhost --insecure
125 +--store=/var/lib/cockroach/data"
126 +#
127 +# arguments to use when stopping the database
128 +stop_args="--host localhost --insecure"
129
130 diff --git a/dev-db/cockroach/files/cockroach.initd b/dev-db/cockroach/files/cockroach.initd
131 new file mode 100644
132 index 00000000000..3629cb6605f
133 --- /dev/null
134 +++ b/dev-db/cockroach/files/cockroach.initd
135 @@ -0,0 +1,23 @@
136 +#!/sbin/openrc-run
137 +# Copyright 1999-2017 Gentoo Foundation
138 +# Distributed under the terms of the GNU General Public License v2
139 +
140 +command="/usr/bin/cockroach"
141 +pidfile=/run/cockroach/cockroach.pid
142 +command_args="start --background --log-dir=/var/log/cockroach
143 + --pid-file=\"${pidfile}\" ${start_args}"
144 +start_stop_daemon_args="--quiet --user cockroach"
145 +
146 +depend() {
147 + use net
148 +}
149 +
150 +start_pre() {
151 + checkpath -d -m 0755 -o cockroach:cockroach $(dirname ${pidfile})
152 +}
153 +
154 +stop() {
155 +ebegin "bringing down ${RC_SVCNAME}"
156 +"${command}" quit ${stop_args}
157 +eend $?
158 +}
159
160 diff --git a/dev-db/cockroach/metadata.xml b/dev-db/cockroach/metadata.xml
161 new file mode 100644
162 index 00000000000..b02140041af
163 --- /dev/null
164 +++ b/dev-db/cockroach/metadata.xml
165 @@ -0,0 +1,12 @@
166 +<?xml version="1.0" encoding="UTF-8"?>
167 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
168 +<pkgmetadata>
169 + <maintainer type="person">
170 + <email>williamh@g.o</email>
171 + <name>William Hubbs</name>
172 + </maintainer>
173 + <longdescription lang="en">
174 + CockroachDB is an open source database for building global, scalable
175 + cloud services that survive disasters.
176 + </longdescription>
177 +</pkgmetadata>