summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ. Konrad Tegtmeier-Rottach2018-05-27 18:41:47 +0200
committerJ. Konrad Tegtmeier-Rottach2018-05-27 18:47:07 +0200
commitcf981d17be8988d1bf998e818b298896c0faf500 (patch)
tree83fcfb2f69729565e8835ee1d484ae62c54239e3
parentc689491d66f1a2ee709a242e9f209030acb28812 (diff)
downloadaur-cf981d17be8988d1bf998e818b298896c0faf500.tar.gz
remove hard-coded uid/gid via tmpfiles.d
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD16
-rw-r--r--cockroach.sysusers2
-rw-r--r--cockroach.tmpfiles2
4 files changed, 16 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 56dec8131ea..521014f209b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -25,6 +25,7 @@ pkgbase = cockroachdb-bin
source = cockroach.service
source = cockroach.default
source = cockroach.sysusers
+ source = cockroach.tmpfiles
sha256sums = ab510541ab9c7e02e9f4a015a4b55f3f47139920fc5a32cc05cb6673a6252228
sha256sums = 68040689c4342e0018adec3eb0fb1f2ae68aaeef918e7b4493518523381b7129
sha256sums = b3ef077aa9a0d4b697722de993fa83959f10910ae600de90bcdcdd49fafce371
@@ -35,7 +36,8 @@ pkgbase = cockroachdb-bin
sha256sums = b34067e89373e1a47367b454862f43061ad1680542b39b6d95ed29c354473e15
sha256sums = 6c336d30983d6295995823a134e3cc85a06ef9418339b53cf6f375df816bea51
sha256sums = 55f380f5cb201c6afeafbf1a6fb5a6400dbffa0edc134d30960d1d04e3d19ef2
- sha256sums = 57d5b6a0a32a0b8c6c005e8e8b6dc6c627edf40d843f94d0720da654678ab5a8
+ sha256sums = 8be2f52529135d8d173bba130e000a187bbadc869ac2c603a4714af435840821
+ sha256sums = c74cf876197312b91970bdd7832081750d2ab4d47e553bb46f38d57cba52641e
pkgname = cockroachdb-bin
diff --git a/PKGBUILD b/PKGBUILD
index 2fe0d7c3240..fbfafbefa44 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -23,7 +23,8 @@ source=("https://binaries.cockroachdb.com/cockroach-v${pkgver}.linux-amd64.tgz"
"https://raw.githubusercontent.com/cockroachdb/cockroach/v${pkgver}/licenses/PostgreSQL.txt"
cockroach.service
cockroach.default
- cockroach.sysusers)
+ cockroach.sysusers
+ cockroach.tmpfiles)
sha256sums=('ab510541ab9c7e02e9f4a015a4b55f3f47139920fc5a32cc05cb6673a6252228'
'68040689c4342e0018adec3eb0fb1f2ae68aaeef918e7b4493518523381b7129'
'b3ef077aa9a0d4b697722de993fa83959f10910ae600de90bcdcdd49fafce371'
@@ -34,15 +35,19 @@ sha256sums=('ab510541ab9c7e02e9f4a015a4b55f3f47139920fc5a32cc05cb6673a6252228'
'b34067e89373e1a47367b454862f43061ad1680542b39b6d95ed29c354473e15'
'6c336d30983d6295995823a134e3cc85a06ef9418339b53cf6f375df816bea51'
'55f380f5cb201c6afeafbf1a6fb5a6400dbffa0edc134d30960d1d04e3d19ef2'
- '57d5b6a0a32a0b8c6c005e8e8b6dc6c627edf40d843f94d0720da654678ab5a8')
+ '8be2f52529135d8d173bba130e000a187bbadc869ac2c603a4714af435840821'
+ 'c74cf876197312b91970bdd7832081750d2ab4d47e553bb46f38d57cba52641e')
build() {
# XXX arch ships a newer, but compatible version of ncurses
patchelf --replace-needed libncurses.so.5 libncursesw.so.6 \
"${srcdir}/cockroach-v${pkgver}.linux-amd64/cockroach"
+ # generate bash completion
"${srcdir}/cockroach-v${pkgver}.linux-amd64/cockroach" \
gen autocomplete --out "${srcdir}/cockroach.bash"
+
+ # generate man pages
"${srcdir}/cockroach-v${pkgver}.linux-amd64/cockroach" \
gen man --path "${srcdir}/man"
}
@@ -50,14 +55,13 @@ build() {
package() {
# binary
- install -Dm755 ${srcdir}/cockroach-v${pkgver}.linux-amd64/cockroach "${pkgdir}/usr/bin/cockroach"
+ install -Dm755 "${srcdir}/cockroach-v${pkgver}.linux-amd64/cockroach" "${pkgdir}/usr/bin/cockroach"
- # user & group
+ # user/group & owned directories
install -Dm644 "${srcdir}/cockroach.sysusers" "${pkgdir}/usr/lib/sysusers.d/cockroach.conf"
+ install -Dm644 "${srcdir}/cockroach.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.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"
diff --git a/cockroach.sysusers b/cockroach.sysusers
index 80dc8dbd964..baaf2057221 100644
--- a/cockroach.sysusers
+++ b/cockroach.sysusers
@@ -1 +1 @@
-u cockroach 361 "CockroachDB" /var/lib/cockroach
+u cockroach - "CockroachDB" /var/lib/cockroach
diff --git a/cockroach.tmpfiles b/cockroach.tmpfiles
new file mode 100644
index 00000000000..a8ac7a02708
--- /dev/null
+++ b/cockroach.tmpfiles
@@ -0,0 +1,2 @@
+d /etc/cockroach 0755 root cockroach - -
+d /var/lib/cockroach 0750 cockroach cockroach - -