summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Weidenbaum2018-03-31 21:28:44 -0400
committerAndy Weidenbaum2018-03-31 21:28:44 -0400
commit1eb0c0ab812430d8ee012a74da04a14002b8d9e7 (patch)
tree178092b69330276e533039e4f91b390e5a9247d0
parent28728f224e869cc6fadec60f08b0367f34916be1 (diff)
downloadaur-1eb0c0ab812430d8ee012a74da04a14002b8d9e7.tar.gz
increment pkgrel to 3; pacman hooks
-rw-r--r--.SRCINFO13
-rw-r--r--PKGBUILD21
-rw-r--r--bitcoin-core-01-systemd-sysusers.hook11
-rw-r--r--bitcoin-core-01-userdel.hook10
-rw-r--r--bitcoin-core-02-chown.hook11
-rw-r--r--bitcoin-core-02-rm-rf.hook10
-rw-r--r--bitcoin.install11
7 files changed, 70 insertions, 17 deletions
diff --git a/.SRCINFO b/.SRCINFO
index a82b9d2f8497..583f7bacc363 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,7 @@
-# Generated by mksrcinfo v8
-# Tue Mar 20 20:51:22 UTC 2018
pkgbase = bitcoin-core
pkgdesc = Bitcoin Core headless P2P node
pkgver = 0.16.0
- pkgrel = 2
+ pkgrel = 3
url = https://bitcoin.org
install = bitcoin.install
arch = armv6h
@@ -19,6 +17,7 @@ pkgbase = bitcoin-core
makedepends = m4
makedepends = make
makedepends = pkg-config
+ makedepends = systemd
depends = boost
depends = boost-libs
depends = zeromq
@@ -37,12 +36,20 @@ pkgbase = bitcoin-core
source = bitcoin.service
source = bitcoin-reindex.service
source = bitcoin-sysusers.conf
+ source = bitcoin-core-01-systemd-sysusers.hook
+ source = bitcoin-core-01-userdel.hook
+ source = bitcoin-core-02-chown.hook
+ source = bitcoin-core-02-rm-rf.hook
sha256sums = 8cbec0397d932cab7297a8c23c918392f6eebd410646b4b954787de9f4a3ee40
sha256sums = b1908344281498d39bfa40c3b9725f9c95bf22602cd46e6120a1f17bad9dae35
sha256sums = 8f05207b586916d489b7d25a68eaacf6e678d7cbb5bfbac551903506b32f904f
sha256sums = 9643eed2c20d78a9c7347df64099765773615f79d3b8a95693d871c933516880
sha256sums = 35ff9331d7df8b90adfc7d82752cca4f8b7ff23a29e5d10b07e4e3fc78050679
sha256sums = f126b4824e43d9760ab2021460a37d859986f07e1ac9245ee4938e832739f73a
+ sha256sums = 0b4f7ec41cf88aa1278d089a03f116c33bac62dec038903f4ced58da67afb980
+ sha256sums = f1c3727220df06993a61cc9f4ef25c83cdaf3624179b5ead8383bc9ef7109e70
+ sha256sums = ae31040f0cc57df976c6ed41e8f69ed4b947db32ba713c7a0b7410108dbf5581
+ sha256sums = b8e574f4b56c81a05a05f5bf59b28120b782d00354b08bd43c641038704e07a5
pkgname = bitcoin-core
diff --git a/PKGBUILD b/PKGBUILD
index e8aff6789c74..aefd71a4a500 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=bitcoin-core
pkgver=0.16.0
-pkgrel=2
+pkgrel=3
pkgdesc="Bitcoin Core headless P2P node"
arch=('armv6h' 'armv7h' 'i686' 'x86_64')
url="https://bitcoin.org"
@@ -16,20 +16,29 @@ makedepends=('autoconf'
'libtool'
'm4'
'make'
- 'pkg-config')
+ 'pkg-config'
+ 'systemd')
license=('MIT')
source=(https://bitcoin.org/bin/bitcoin-core-$pkgver/bitcoin-$pkgver.tar.gz
bitcoin.conf
bitcoin.logrotate
bitcoin.service
bitcoin-reindex.service
- bitcoin-sysusers.conf)
+ bitcoin-sysusers.conf
+ bitcoin-core-01-systemd-sysusers.hook
+ bitcoin-core-01-userdel.hook
+ bitcoin-core-02-chown.hook
+ bitcoin-core-02-rm-rf.hook)
sha256sums=('8cbec0397d932cab7297a8c23c918392f6eebd410646b4b954787de9f4a3ee40'
'b1908344281498d39bfa40c3b9725f9c95bf22602cd46e6120a1f17bad9dae35'
'8f05207b586916d489b7d25a68eaacf6e678d7cbb5bfbac551903506b32f904f'
'9643eed2c20d78a9c7347df64099765773615f79d3b8a95693d871c933516880'
'35ff9331d7df8b90adfc7d82752cca4f8b7ff23a29e5d10b07e4e3fc78050679'
- 'f126b4824e43d9760ab2021460a37d859986f07e1ac9245ee4938e832739f73a')
+ 'f126b4824e43d9760ab2021460a37d859986f07e1ac9245ee4938e832739f73a'
+ '0b4f7ec41cf88aa1278d089a03f116c33bac62dec038903f4ced58da67afb980'
+ 'f1c3727220df06993a61cc9f4ef25c83cdaf3624179b5ead8383bc9ef7109e70'
+ 'ae31040f0cc57df976c6ed41e8f69ed4b947db32ba713c7a0b7410108dbf5581'
+ 'b8e574f4b56c81a05a05f5bf59b28120b782d00354b08bd43c641038704e07a5')
backup=('etc/bitcoin/bitcoin.conf'
'etc/logrotate.d/bitcoin')
provides=('bitcoin-cli' 'bitcoin-daemon' 'bitcoin-tx')
@@ -112,4 +121,8 @@ package() {
install -Dm 644 "contrib/${_compl}.bash-completion" \
"$pkgdir/usr/share/bash-completion/completions/$_compl"
done
+
+ # XXX: pacman hook on Remove event not firing
+ msg2 'Installing pacman hooks...'
+ install -Dm 644 "$srcdir"/*.hook -t "$pkgdir/usr/share/libalpm/hooks"
}
diff --git a/bitcoin-core-01-systemd-sysusers.hook b/bitcoin-core-01-systemd-sysusers.hook
new file mode 100644
index 000000000000..1e16df5f7fbf
--- /dev/null
+++ b/bitcoin-core-01-systemd-sysusers.hook
@@ -0,0 +1,11 @@
+[Trigger]
+Operation = Install
+Operation = Upgrade
+Type = Package
+Target = bitcoin-core
+
+[Action]
+Description = Adding bitcoin daemon user...
+Depends = systemd
+When = PostTransaction
+Exec = /usr/bin/systemd-sysusers /usr/lib/sysusers.d/bitcoin.conf
diff --git a/bitcoin-core-01-userdel.hook b/bitcoin-core-01-userdel.hook
new file mode 100644
index 000000000000..bfdd300fb0f0
--- /dev/null
+++ b/bitcoin-core-01-userdel.hook
@@ -0,0 +1,10 @@
+[Trigger]
+Operation = Remove
+Type = Package
+Target = bitcoin-core
+
+[Action]
+Description = Removing bitcoin daemon user...
+Depends = shadow
+When = PostTransaction
+Exec = /usr/bin/userdel -rf bitcoin
diff --git a/bitcoin-core-02-chown.hook b/bitcoin-core-02-chown.hook
new file mode 100644
index 000000000000..3e1b93b4719f
--- /dev/null
+++ b/bitcoin-core-02-chown.hook
@@ -0,0 +1,11 @@
+[Trigger]
+Operation = Install
+Operation = Upgrade
+Type = Package
+Target = bitcoin-core
+
+[Action]
+Description = Setting bitcoin daemon user directory permissions...
+Depends = coreutils
+When = PostTransaction
+Exec = /usr/bin/chown -R bitcoin:bitcoin /etc/bitcoin /srv/bitcoin
diff --git a/bitcoin-core-02-rm-rf.hook b/bitcoin-core-02-rm-rf.hook
new file mode 100644
index 000000000000..da96a2323152
--- /dev/null
+++ b/bitcoin-core-02-rm-rf.hook
@@ -0,0 +1,10 @@
+[Trigger]
+Operation = Remove
+Type = Package
+Target = bitcoin-core
+
+[Action]
+Description = Cleaning up bitcoin daemon user directories...
+Depends = coreutils
+When = PostTransaction
+Exec = /usr/bin/rm -rf /srv/bitcoin
diff --git a/bitcoin.install b/bitcoin.install
index 88bb26a29b72..5d69a6c99b6f 100644
--- a/bitcoin.install
+++ b/bitcoin.install
@@ -1,18 +1,9 @@
-_bc_user=bitcoin
-_bc_group=bitcoin
-
post_install() {
- chown -R $_bc_user:$_bc_group /etc/bitcoin /srv/bitcoin
printf "%b\n" "$bitcoin"
}
post_upgrade() {
- chown -R $_bc_user:$_bc_group /etc/bitcoin /srv/bitcoin
- printf "%b\n" "$bitcoin"
-}
-
-post_remove() {
- rm -rf /srv/bitcoin
+ post_install
}
read -d '' bitcoin <<'EOF'