1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
8 inherit check-reqs toolchain-funcs user
10 DESCRIPTION="open source database for building cloud services"
11 HOMEPAGE="https://www.cockroachlabs.com"
12 SRC_URI="https://binaries.cockroachdb.com/cockroach-${MY_PV}.src.tgz"
14 LICENSE="Cockroach Apache-2.0"
19 DEPEND=">=app-arch/xz-utils-5.2.3
21 >=dev-util/cmake-3.8.1"
23 S="${WORKDIR}/cockroach-${MY_PV}"
25 QA_EXECSTACK="usr/bin/cockroach"
28 check-reqs_pkg_pretend
29 if [[ ${MERGE_TYPE} != binary && $(gcc-major-version) -lt 6 ]]; then
30 eerror "Cockroach cannot be built with this version of gcc."
31 eerror "You need at least gcc-6.0"
32 die "Your C compiler is too old for this package."
39 enewuser cockroach -1 /bin/sh /var/lib/cockroach cockroach
43 # workaround for https://github.com/cockroachdb/cockroach/issues/20596
44 unset CMAKE_MODULE_PATH
49 dobin src/github.com/cockroachdb/cockroach/cockroach
50 insinto /etc/security/limits.d
51 newins "${FILESDIR}"/cockroach-limits.conf cockroach.conf
52 newconfd "${FILESDIR}"/cockroach.confd-1.0 cockroach
53 newinitd "${FILESDIR}"/cockroach.initd-1.0.1 cockroach
54 keepdir /var/log/cockroach
55 fowners cockroach:cockroach /var/log/cockroach
56 if [[ -z ${REPLACING_VERSIONS} ]]; then
57 ewarn "The default setup is for the first node of an insecure"
58 ewarn "cluster that only listens on localhost."
59 ewarn "Please read the cockroach manual at the following url"
60 ewarn "and configure /etc/conf.d/cockroach correctly if you"
61 ewarn "plan to use it in production."
63 ewarn "http://cockroachlabs.com/docs"