summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomZ2017-02-21 15:51:21 +0100
committerTomZ2017-02-21 15:51:21 +0100
commitc9631baa71dacb296c9d2f1123ae19409e0356d0 (patch)
tree4ad54a3bea83dfc4041678bcb3fbefc4b130c506
parentd633fbd503f6d88cae78fc6d65c4833c5a21190a (diff)
downloadaur-c9631baa71dacb296c9d2f1123ae19409e0356d0.tar.gz
New version and cleanups
-rw-r--r--.SRCINFO9
-rw-r--r--PKGBUILD10
-rw-r--r--bitcoin.install81
3 files changed, 20 insertions, 80 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 2012597d9860..9c5243de657b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,8 @@
# Generated by mksrcinfo v8
-# Thu Jan 5 11:19:29 UTC 2017
+# Tue Feb 21 14:40:46 UTC 2017
pkgbase = bitcoin-classic-daemon
pkgdesc = Bitcoin Classic with bitcoind, bitcoin-tx, and bitcoin-cli
- pkgver = 1.2.0
+ pkgver = 1.2.1
pkgrel = 1
url = https://bitcoinclassic.com/
install = bitcoin.install
@@ -21,10 +21,11 @@ pkgbase = bitcoin-classic-daemon
conflicts = bitcoin-daemon
conflicts = bitcoin-cli
conflicts = bitcoin-tx
- source = https://github.com/bitcoinclassic/bitcoinclassic/archive/v1.2.0.tar.gz
+ backup = etc/bitcoin/bitcoin.conf
+ source = bitcoin-classic-daemon-1.2.1.tar.gz::https://github.com/bitcoinclassic/bitcoinclassic/archive/v1.2.1.tar.gz
source = bitcoin.logrotate
source = bitcoin.conf
- sha256sums = 7f16cd27f711d7dfbdc103e79d04800a27e63ed432e3076dd34552c37710a5ac
+ sha256sums = 7b57dcd9cc6cda6ede39de2c837335752c0feeae4f6793e4ec75fb6efdc8ecbe
sha256sums = 7bf4bdad419c1ee30b88c7e4190707c5ff250da8b23d68d5adf14043f8e2ac73
sha256sums = c8787560c6423605796c8d3e080cb522ed849cea12b5c23293c22e405a015a53
diff --git a/PKGBUILD b/PKGBUILD
index 07fe7dd190fc..b198ef4f0a14 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Tom Zander
pkgname=bitcoin-classic-daemon
-pkgver=1.2.0
+pkgver=1.2.1
pkgrel=1
pkgdesc='Bitcoin Classic with bitcoind, bitcoin-tx, and bitcoin-cli'
arch=('i686' 'x86_64')
@@ -12,10 +12,11 @@ makedepends=('boost')
provides=('bitcoin-daemon' 'bitcoin-cli' 'bitcoin-tx')
conflicts=('bitcoin-daemon' 'bitcoin-cli' 'bitcoin-tx')
install=bitcoin.install
-source=(${pkgname}-${pkgver}.tar.gz::"https://github.com/bitcoinclassic/bitcoinclassic/archive/v1.2.0.tar.gz"
+backup=("etc/bitcoin/bitcoin.conf")
+source=(${pkgname}-${pkgver}.tar.gz::"https://github.com/bitcoinclassic/bitcoinclassic/archive/v${pkgver}.tar.gz"
"bitcoin.logrotate"
"bitcoin.conf")
-sha256sums=('7f16cd27f711d7dfbdc103e79d04800a27e63ed432e3076dd34552c37710a5ac'
+sha256sums=('7b57dcd9cc6cda6ede39de2c837335752c0feeae4f6793e4ec75fb6efdc8ecbe'
"7bf4bdad419c1ee30b88c7e4190707c5ff250da8b23d68d5adf14043f8e2ac73"
"c8787560c6423605796c8d3e080cb522ed849cea12b5c23293c22e405a015a53")
@@ -42,8 +43,7 @@ package() {
install -Dm644 "contrib/debian/manpages/bitcoin.conf.5"\
-t "$pkgdir/usr/share/man/man5"
- install -Dm 644 "$srcdir/bitcoin.conf" "$pkgdir/etc/bitcoin/bitcoin.conf.dist"
- install -Dm 644 "share/rpcuser/rpcuser.py" -t "$pkgdir/etc/bitcoin"
+ install -Dm 644 "$srcdir/bitcoin.conf" "share/rpcuser/rpcuser.py" -t "$pkgdir/etc/bitcoin"
install -Dm 644 "contrib/init/bitcoind.service" -t "$pkgdir/usr/lib/systemd/system"
install -Dm 644 "$srcdir/bitcoin.logrotate" "$pkgdir/etc/logrotate.d/bitcoin"
diff --git a/bitcoin.install b/bitcoin.install
index bbe9e63a5b02..35a07dc58615 100644
--- a/bitcoin.install
+++ b/bitcoin.install
@@ -3,27 +3,26 @@ _bc_group=bitcoin
post_install() {
_mkuser
- # disable Copy-On-Write (btrfs directories only)
_dir="/var/lib/bitcoind"
- mkdir -p "$_dir"
- _is_btrfs "$_dir" && _disable_cow "$_dir"
- if test ! -f /etc/bitcoin/bitcoin.conf; then
- cp /etc/bitcoin/bitcoin.conf.dist /etc/bitcoin/bitcoin.conf
+ if test -d "$_dir"; then
+ # disable Copy-On-Write (btrfs directories only)
+ # This avoids lots of known db-corruption issues
+ _is_btrfs "$_dir" && chattr +C "$_dir"
+ else
+ mkdir "$_dir"
+ chown -R $_bc_user:$_bc_group "$_dir"
+ chmod 750 "$_dir"
fi
- chown -R $_bc_user:$_bc_group /etc/bitcoin "$_dir"
+ chown -R $_bc_user:$_bc_group "$_dir"
printf "%b\n" "$bitcoin"
}
post_upgrade() {
_mkuser
- chown -R $_bc_user:$_bc_group /etc/bitcoin "/var/lib/bitcoind"
+ chown -R $_bc_user:$_bc_group /etc/bitcoin
printf "%b\n" "$bitcoin"
}
-post_remove() {
- _rmuser
-}
-
# ------------------------------------------------------------------------------
# helper functions for creating bitcoin user / group
@@ -38,13 +37,6 @@ _mkuser() {
}
}
-_rmuser() {
- echo -n "Removing bitcoin user... "
- userdel $_bc_user 2>/dev/null
- echo "done"
-}
-
-
# ------------------------------------------------------------------------------
# helper functions for disabling btrfs Copy-On-Write (CoW)
# https://wiki.archlinux.org/index.php/Btrfs#Copy-On-Write_.28CoW.29
@@ -58,56 +50,3 @@ _is_btrfs() {
return 1
fi
}
-
-# disable btrfs CoW
-_chattrify() {
- # original dir, with trailing slash stripped if it exists
- _orig_dir=$( echo "$1" | sed 's@/$@@' )
-
- # if original dir exists, back it up
- [[ -d "$1" ]] && mv "$1" "${_orig_dir}"_old
-
- # re-make original dir
- mkdir -p "$1"
-
- # set permissions on re-made dir
- chmod "$2" "$1"
-
- # disable btrfs CoW on re-made dir
- chattr +C "$1"
-
- # recursive copy to restore backed up dir while maintaining disabled CoW
- [[ -d "${_orig_dir}"_old ]] \
- && find "${_orig_dir}"_old -mindepth 1 -maxdepth 1 -exec cp -R '{}' "$1" \;
-
- # set ownership on re-made dir
- chown -R $3:$4 "$1"
-
- # purge backed up dir
- [[ -d "${_orig_dir}"_old ]] && rm -rf "${_orig_dir}"_old
-}
-
-_disable_cow() {
- _chattrify "$1" "750" "$_bc_user" "$_bc_group"
-}
-
-
-read -d '' bitcoin <<'EOF'
-############################################################
-# #
-# Bitcoin Classic #
-# ____________ #
-# #
-# To start bitcoin-classic: #
-# #
-# # systemctl start bitcoind #
-# #
-# To communicate with bitcoin-classic as a normal user: #
-# #
-# $ bitcoin-cli help #
-# #
-# Config: /etc/bitcoin/bitcoin.conf #
-# Blockchain: /var/lib/bitcoind #
-# #
-############################################################
-EOF