From b5e462f93de301d00b1be14285ce40aa2334eac8 Mon Sep 17 00:00:00 2001 From: "J. Konrad Tegtmeier-Rottach" Date: Sun, 15 Apr 2018 05:25:01 +0200 Subject: [PATCH] update package for v2.0.0 New: - generated man pages - generated bash completion - systemd service Fixed: - applicable licenses - libtinfo.so.5 dependency --- .SRCINFO | 35 ++++++++++++++++++--- PKGBUILD | 78 ++++++++++++++++++++++++++++++++++++++++------ cockroach.default | 2 ++ cockroach.service | 19 +++++++++++ cockroach.sysusers | 1 + 5 files changed, 121 insertions(+), 14 deletions(-) create mode 100644 cockroach.default create mode 100644 cockroach.service create mode 100644 cockroach.sysusers diff --git a/.SRCINFO b/.SRCINFO index 67d0a69..a292215 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,16 +1,41 @@ pkgbase = cockroachdb-bin pkgdesc = An open source, survivable, strongly consistent, scale-out SQL database - pkgver = 1.2_alpha.20171026 + pkgver = 2.0.0 pkgrel = 1 url = https://www.cockroachlabs.com/ arch = x86_64 license = Apache - depends = gcc-libs - depends = libtinfo5 + license = BSD + license = custom:PostgreSQL + license = custom:CCL + makedepends = patchelf + depends = glibc + depends = ncurses provides = cockroachdb conflicts = cockroachdb - source = https://binaries.cockroachdb.com/cockroach-v1.2-alpha.20171026.linux-amd64.tgz - sha256sums = 5de33553aa4be79c7fb05fa44f677706df78c283ae00f917d09e0cb2359dcc19 + options = !strip + source = https://binaries.cockroachdb.com/cockroach-v2.0.0.linux-amd64.tgz + source = https://raw.githubusercontent.com/cockroachdb/cockroach/v2.0.0/LICENSE + source = https://raw.githubusercontent.com/cockroachdb/cockroach/v2.0.0/licenses/BSD-biogo.txt + source = https://raw.githubusercontent.com/cockroachdb/cockroach/v2.0.0/licenses/BSD-golang.txt + source = https://raw.githubusercontent.com/cockroachdb/cockroach/v2.0.0/licenses/BSD-grpc.txt + source = https://raw.githubusercontent.com/cockroachdb/cockroach/v2.0.0/licenses/BSD-vitess.txt + source = https://raw.githubusercontent.com/cockroachdb/cockroach/v2.0.0/licenses/CCL.txt + source = https://raw.githubusercontent.com/cockroachdb/cockroach/v2.0.0/licenses/PostgreSQL.txt + source = cockroach.service + source = cockroach.default + source = cockroach.sysusers + sha256sums = b53b64f3c41e3c234f4da130680a62b7df073f04ec8c2ac495dd07f5b7b4bd87 + sha256sums = 68040689c4342e0018adec3eb0fb1f2ae68aaeef918e7b4493518523381b7129 + sha256sums = b3ef077aa9a0d4b697722de993fa83959f10910ae600de90bcdcdd49fafce371 + sha256sums = 2d36597f7117c38b006835ae7f537487207d8ec407aa9d9980794b2030cbc067 + sha256sums = af1c246b8eb8b2d2ee3f1471247569d7f35cefff40e9b967d563622bb04c1e69 + sha256sums = 23681c6986fb33d57957660543f6e9dcbbcf6d2ae2f9fa2dbdb5efec5aa0d95f + sha256sums = 2cd6aceddb7240c6ef395f7d92e26de4da63f7700504f6ce47e2aab4e39a4122 + sha256sums = b34067e89373e1a47367b454862f43061ad1680542b39b6d95ed29c354473e15 + sha256sums = 6c336d30983d6295995823a134e3cc85a06ef9418339b53cf6f375df816bea51 + sha256sums = 2eb44afe272c46a2b0e8da73c177452795540988fee60ffad1fd874d882bbff1 + sha256sums = 57d5b6a0a32a0b8c6c005e8e8b6dc6c627edf40d843f94d0720da654678ab5a8 pkgname = cockroachdb-bin diff --git a/PKGBUILD b/PKGBUILD index d5630e7..a47dcc3 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,20 +1,80 @@ -# Maintainer: Marcel O'Neil +# Maintainer: Konrad Tegtmeier +# Contributor: Marcel O'Neil pkgname=cockroachdb-bin conflicts=('cockroachdb') provides=('cockroachdb') -pkgver=1.2_alpha.20171026 -_pkgver="v${pkgver}" +pkgver=2.0.0 pkgrel=1 pkgdesc="An open source, survivable, strongly consistent, scale-out SQL database" arch=('x86_64') url="https://www.cockroachlabs.com/" -license=('Apache') -depends=('gcc-libs' 'libtinfo5') -source=("https://binaries.cockroachdb.com/cockroach-${_pkgver//_/-}.linux-amd64.tgz") -sha256sums=('5de33553aa4be79c7fb05fa44f677706df78c283ae00f917d09e0cb2359dcc19') +license=('Apache' 'BSD' 'custom:PostgreSQL' 'custom:CCL') +depends=('glibc' 'ncurses') +makedepends=('patchelf') +options=('!strip') # XXX breaks the patched binary +source=("https://binaries.cockroachdb.com/cockroach-v${pkgver}.linux-amd64.tgz" + "https://raw.githubusercontent.com/cockroachdb/cockroach/v${pkgver}/LICENSE" + "https://raw.githubusercontent.com/cockroachdb/cockroach/v${pkgver}/licenses/BSD-biogo.txt" + "https://raw.githubusercontent.com/cockroachdb/cockroach/v${pkgver}/licenses/BSD-golang.txt" + "https://raw.githubusercontent.com/cockroachdb/cockroach/v${pkgver}/licenses/BSD-grpc.txt" + "https://raw.githubusercontent.com/cockroachdb/cockroach/v${pkgver}/licenses/BSD-vitess.txt" + "https://raw.githubusercontent.com/cockroachdb/cockroach/v${pkgver}/licenses/CCL.txt" + "https://raw.githubusercontent.com/cockroachdb/cockroach/v${pkgver}/licenses/PostgreSQL.txt" + cockroach.service + cockroach.default + cockroach.sysusers) +sha256sums=('b53b64f3c41e3c234f4da130680a62b7df073f04ec8c2ac495dd07f5b7b4bd87' + '68040689c4342e0018adec3eb0fb1f2ae68aaeef918e7b4493518523381b7129' + 'b3ef077aa9a0d4b697722de993fa83959f10910ae600de90bcdcdd49fafce371' + '2d36597f7117c38b006835ae7f537487207d8ec407aa9d9980794b2030cbc067' + 'af1c246b8eb8b2d2ee3f1471247569d7f35cefff40e9b967d563622bb04c1e69' + '23681c6986fb33d57957660543f6e9dcbbcf6d2ae2f9fa2dbdb5efec5aa0d95f' + '2cd6aceddb7240c6ef395f7d92e26de4da63f7700504f6ce47e2aab4e39a4122' + 'b34067e89373e1a47367b454862f43061ad1680542b39b6d95ed29c354473e15' + '6c336d30983d6295995823a134e3cc85a06ef9418339b53cf6f375df816bea51' + '2eb44afe272c46a2b0e8da73c177452795540988fee60ffad1fd874d882bbff1' + '57d5b6a0a32a0b8c6c005e8e8b6dc6c627edf40d843f94d0720da654678ab5a8') + +build() { + # XXX arch has libtinfo compiled into ncurses; + # this updates the dl reference accordingly + patchelf --replace-needed libtinfo.so.5 libtinfo.so.6 \ + "${srcdir}/cockroach-v${pkgver}.linux-amd64/cockroach" gen autocomplete + + "${srcdir}/cockroach-v${pkgver}.linux-amd64/cockroach" \ + gen autocomplete --out "${srcdir}/cockroach.bash" + "${srcdir}/cockroach-v${pkgver}.linux-amd64/cockroach" \ + gen man --path "${srcdir}/man" +} package() { - cd $srcdir/cockroach-${_pkgver//_/-}.linux-amd64/ - install -Dm755 cockroach "${pkgdir}/usr/bin/cockroach" + + # binary + install -Dm755 ${srcdir}/cockroach-v${pkgver}.linux-amd64/cockroach "${pkgdir}/usr/bin/cockroach" + + # user & group + install -Dm644 "${srcdir}/cockroach.sysusers" "${pkgdir}/usr/lib/sysusers.d/cockroach.conf" + + # services & runtime + install -Ddm750 -o 0 -g 361 "${pkgdir}/etc/cockroach" + install -Ddm750 -o 361 -g 361 "${pkgdir}/var/lib/cockroach" + install -Dm644 "${srcdir}/cockroach.service" "${pkgdir}/usr/lib/systemd/system/cockroach.service" + install -Dm644 "${srcdir}/cockroach.default" "${pkgdir}/etc/default/cockroach" + + # man pages + install -d "${pkgdir}/usr/share/man/man1/" + install -m644 "${srcdir}"/man/*.1 "${pkgdir}/usr/share/man/man1/" + + # bash completion + install -Dm644 cockroach.bash "${pkgdir}/usr/share/bash-completion/completions/cockroach" + + # licenses + install -Dm644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + install -Dm644 "${srcdir}/BSD-biogo.txt" "${pkgdir}/usr/share/licenses/${pkgname}/BSD-biogo.txt" + install -Dm644 "${srcdir}/BSD-golang.txt" "${pkgdir}/usr/share/licenses/${pkgname}/BSD-golang.txt" + install -Dm644 "${srcdir}/BSD-grpc.txt" "${pkgdir}/usr/share/licenses/${pkgname}/BSD-grpc.txt" + install -Dm644 "${srcdir}/BSD-vitess.txt" "${pkgdir}/usr/share/licenses/${pkgname}/BSD-vitess.txt" + install -Dm644 "${srcdir}/CCL.txt" "${pkgdir}/usr/share/licenses/${pkgname}/CCL.txt" + install -Dm644 "${srcdir}/PostgreSQL.txt" "${pkgdir}/usr/share/licenses/${pkgname}/PostgreSQL.txt" } diff --git a/cockroach.default b/cockroach.default new file mode 100644 index 0000000..ebba58e --- /dev/null +++ b/cockroach.default @@ -0,0 +1,2 @@ +COCKROACH_FLAGS="" +COCKROACH_STORE="path=/var/lib/cockroach" diff --git a/cockroach.service b/cockroach.service new file mode 100644 index 0000000..e4bde93 --- /dev/null +++ b/cockroach.service @@ -0,0 +1,19 @@ +[Unit] +Description=CockroachDB database server +Requires=network-online.target +After=network-online.target + +[Service] +User=cockroach +Group=cockroach + +EnvironmentFile=-/etc/default/cockroach +ExecStart=/usr/bin/cockroach start --certs-dir /etc/cockroach --store=${COCKROACH_STORE} $COCKROACH_FLAGS +LimitNOFILE=35000 + +ProtectHome=true +ProtectSystem=full +NoNewPrivileges=true + +[Install] +WantedBy=multi-user.target diff --git a/cockroach.sysusers b/cockroach.sysusers new file mode 100644 index 0000000..80dc8db --- /dev/null +++ b/cockroach.sysusers @@ -0,0 +1 @@ +u cockroach 361 "CockroachDB" /var/lib/cockroach