dev-python/numpydoc: arm64 keyworded (bug #721130)
[gentoo.git] / dev-db / cockroach / cockroach-2.1.5.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 MY_PV=v${PV}
6 CHECKREQS_MEMORY="2G"
7
8 inherit check-reqs toolchain-funcs user
9
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"
13
14 LICENSE="Cockroach Apache-2.0"
15 SLOT="0"
16 KEYWORDS="~amd64"
17 IUSE=""
18
19 DEPEND=">=app-arch/xz-utils-5.2.3
20         >=dev-lang/go-1.8.3
21         >=dev-util/cmake-3.8.1"
22
23 S="${WORKDIR}/cockroach-${MY_PV}"
24
25 QA_EXECSTACK="usr/bin/cockroach"
26
27 pkg_pretend() {
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."
33         fi
34 }
35
36 pkg_setup() {
37         check-reqs_pkg_setup
38         enewgroup cockroach
39         enewuser cockroach -1 /bin/sh /var/lib/cockroach cockroach
40 }
41
42 src_compile() {
43         # workaround for https://github.com/cockroachdb/cockroach/issues/20596
44         unset CMAKE_MODULE_PATH
45         emake build
46 }
47
48 src_install() {
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."
62                 ewarn
63                 ewarn "http://cockroachlabs.com/docs"
64         fi
65 }