summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD6
-rw-r--r--bitcoin.install81
3 files changed, 14 insertions, 75 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b8c239b4d344..e89ba04f8035 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -2,7 +2,7 @@
# Thu Jan 5 11:52:42 UTC 2017
pkgbase = bitcoin-classic-git
pkgdesc = Bitcoin Classic versions of Bitcoind, bitcoin-cli, bitcoin-tx, and bitcoin-qt, most recent stable branch, w/GUI and wallet
- pkgver = v1.2.0
+ pkgver = v1.2.1
pkgrel = 1
url = https://bitcoinclassic.com/
install = bitcoin.install
diff --git a/PKGBUILD b/PKGBUILD
index 07ee1ff1c6da..47f6477d34bd 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -11,8 +11,9 @@ depends=('boost-libs' 'libevent' 'desktop-file-utils' 'qt5-base' 'protobuf' 'ope
makedepends=('boost' 'qt5-tools')
provides=('bitcoin-daemon' 'bitcoin-cli' 'bitcoin-qt' 'bitcoin-tx')
conflicts=('bitcoin-daemon' 'bitcoin-cli' 'bitcoin-qt' 'bitcoin-tx')
+backup=("etc/bitcoin/bitcoin.conf")
install=bitcoin.install
-source=("git+https://github.com/bitcoinclassic/bitcoinclassic.git#branch=develop"
+source=("git+https://github.com/bitcoinclassic/bitcoinclassic.git#branch=master"
"bitcoin.logrotate"
"bitcoin.conf")
@@ -53,8 +54,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