summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabien2020-11-06 21:31:08 +0100
committerFabien2020-11-06 21:31:33 +0100
commit9ac4b781dc071a6e619b6d059b25b8f7d0bbfef8 (patch)
treeeb290fb2fbc8b78decbfb78141c815c968a423f0
downloadaur-9ac4b781dc071a6e619b6d059b25b8f7d0bbfef8.tar.gz
Initial version
-rw-r--r--.SRCINFO55
-rw-r--r--PKGBUILD111
-rw-r--r--bitcoin-reindex.service19
-rw-r--r--bitcoin.conf8
-rw-r--r--bitcoin.install59
-rw-r--r--bitcoin.logrotate11
-rw-r--r--bitcoin.service18
7 files changed, 281 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..bfa7d9707ba
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,55 @@
+pkgbase = bitcoin-abc-qt-bchn
+ pkgdesc = Bitcoin ABC (BCHN network) with bitcoind, bitcoin-cli, bitcoin-tx, bitcoin-seeder and bitcoin-qt
+ pkgver = 0.22.6
+ pkgrel = 0
+ url = https://bitcoinabc.org
+ install = bitcoin.install
+ arch = i686
+ arch = x86_64
+ license = MIT
+ makedepends = cmake
+ makedepends = ninja
+ makedepends = boost
+ makedepends = qt5-tools
+ makedepends = python
+ makedepends = help2man
+ makedepends = xorg-server-xvfb
+ depends = boost-libs
+ depends = libevent
+ depends = desktop-file-utils
+ depends = qt5-base
+ depends = protobuf
+ depends = openssl
+ depends = miniupnpc
+ depends = zeromq
+ depends = qrencode
+ depends = jemalloc
+ provides = bitcoin-cli
+ provides = bitcoin-daemon
+ provides = bitcoin-tx
+ provides = bitcoin-qt
+ provides = bitcoin-seeder
+ provides = bitcoin-wallet
+ conflicts = bitcoin-cli
+ conflicts = bitcoin-daemon
+ conflicts = bitcoin-tx
+ conflicts = bitcoin-qt
+ conflicts = bitcoin-seeder
+ conflicts = bitcoin-wallet
+ backup = etc/bitcoin/bitcoin.conf
+ backup = etc/logrotate.d/bitcoin
+ source = https://github.com/Bitcoin-ABC/bitcoin-abc/archive/v0.22.6.tar.gz
+ source = bitcoin.conf
+ source = bitcoin.logrotate
+ source = bitcoin.service
+ source = bitcoin-reindex.service
+ source = bitcoin.install
+ sha256sums = 4ccb931c2f26046a69647b773037982dc6c8db056c8c89e6da0957b5e4dcd012
+ sha256sums = c30e5c7e0e97b001fdeac5f4510d5ebc0e0499ec086325e845db609a24f2e22f
+ sha256sums = 8f05207b586916d489b7d25a68eaacf6e678d7cbb5bfbac551903506b32f904f
+ sha256sums = f2fd9d8331238727333cf2412ba3759cb194a65b2060eff36808b24c06382104
+ sha256sums = 497dbeefb9cd9792757a9b6e1fbfd92710d19990ee2959add6c30533ae40b6f6
+ sha256sums = 45429013dae87a58bc79ca7b7a037665bf8592cae0199bcf4aef088fb950e78a
+
+pkgname = bitcoin-abc-qt-bchn
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..e0ff5c7d335
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,111 @@
+# Maintainer: Fabien <fabcien@gmail.com>
+# Contributor: Josh Ellithorpe <quest@mac.com>
+
+pkgname=bitcoin-abc-qt-bchn
+pkgver=0.22.6
+pkgrel=0
+pkgdesc="Bitcoin ABC (BCHN network) with bitcoind, bitcoin-cli, bitcoin-tx, bitcoin-seeder and bitcoin-qt"
+arch=('i686' 'x86_64')
+url="https://bitcoinabc.org"
+depends=('boost-libs' 'libevent' 'desktop-file-utils' 'qt5-base' 'protobuf' 'openssl' 'miniupnpc' 'zeromq' 'qrencode' 'jemalloc')
+makedepends=('cmake' 'ninja' 'boost' 'qt5-tools' 'python' 'help2man' 'xorg-server-xvfb')
+license=('MIT')
+source=(https://github.com/Bitcoin-ABC/bitcoin-abc/archive/v$pkgver.tar.gz
+ bitcoin.conf
+ bitcoin.logrotate
+ bitcoin.service
+ bitcoin-reindex.service
+ bitcoin.install)
+backup=('etc/bitcoin/bitcoin.conf'
+ 'etc/logrotate.d/bitcoin')
+provides=('bitcoin-cli' 'bitcoin-daemon' 'bitcoin-tx' 'bitcoin-qt' 'bitcoin-seeder' 'bitcoin-wallet')
+conflicts=('bitcoin-cli' 'bitcoin-daemon' 'bitcoin-tx' 'bitcoin-qt' 'bitcoin-seeder' 'bitcoin-wallet')
+install=bitcoin.install
+
+build() {
+ cd "$srcdir/bitcoin-abc-$pkgver"
+
+ msg2 'Building...'
+ mkdir -p build
+ pushd build
+
+ cmake -GNinja .. \
+ -DENABLE_CLANG_TIDY=OFF \
+ -DCLIENT_VERSION_IS_RELEASE=ON \
+ -DENABLE_REDUCE_EXPORTS=ON \
+ -DENABLE_STATIC_LIBSTDCXX=ON \
+ -DNETWORK_COMPATIBILITY=BCHN \
+ -DCMAKE_INSTALL_PREFIX=$pkgdir/usr
+
+ ninja
+ popd
+}
+
+check() {
+ cd "$srcdir/bitcoin-abc-$pkgver/build"
+
+ msg2 'Testing...'
+ ninja check
+}
+
+package() {
+ cd "$srcdir/bitcoin-abc-$pkgver"
+
+ msg2 'Installing desktop shortcut...'
+ install -Dm644 contrib/debian/bitcoin-qt.desktop \
+ "$pkgdir"/usr/share/applications/bitcoin.desktop
+ install -Dm644 share/pixmaps/bitcoin-abc128.png \
+ "$pkgdir"/usr/share/pixmaps/bitcoin-abc128.png
+
+ msg2 'Installing license...'
+ install -Dm 644 COPYING -t "$pkgdir/usr/share/licenses/${pkgname}"
+
+ msg2 'Installing examples...'
+ install -Dm644 "contrib/debian/examples/bitcoin.conf" \
+ -t "$pkgdir/usr/share/doc/bitcoin/examples"
+
+ msg2 'Installing documentation...'
+ install -dm 755 "$pkgdir/usr/share/doc/bitcoin"
+ for _doc in \
+ $(find doc -maxdepth 1 -type f -name "*.md" -printf '%f\n') \
+ release-notes; do
+ cp -dpr --no-preserve=ownership "doc/$_doc" \
+ "$pkgdir/usr/share/doc/bitcoin/$_doc"
+ done
+
+ msg2 'Installing essential directories'
+ install -dm 700 "$pkgdir/etc/bitcoin"
+ install -dm 755 "$pkgdir/srv/bitcoin"
+ install -dm 755 "$pkgdir/run/bitcoin"
+
+ pushd build
+ msg2 'Installing executables...'
+ ninja install/strip
+
+ msg2 'Installing man pages...'
+ #xvfb-run ninja install-manpages
+ popd
+
+ msg2 'Installing bitcoin.conf...'
+ install -Dm 600 "$srcdir/bitcoin.conf" -t "$pkgdir/etc/bitcoin"
+
+ msg2 'Installing bitcoin.service...'
+ install -Dm 644 "$srcdir/bitcoin.service" -t "$pkgdir/usr/lib/systemd/system"
+ install -Dm 644 "$srcdir/bitcoin-reindex.service" \
+ -t "$pkgdir/usr/lib/systemd/system"
+
+ msg2 'Installing bitcoin.logrotate...'
+ install -Dm 644 "$srcdir/bitcoin.logrotate" "$pkgdir/etc/logrotate.d/bitcoin"
+
+ msg2 'Installing bash completion...'
+ for _compl in bitcoin-cli bitcoin-tx bitcoind; do
+ install -Dm 644 "contrib/${_compl}.bash-completion" \
+ "$pkgdir/usr/share/bash-completion/completions/$_compl"
+ done
+}
+sha256sums=('4ccb931c2f26046a69647b773037982dc6c8db056c8c89e6da0957b5e4dcd012'
+ 'c30e5c7e0e97b001fdeac5f4510d5ebc0e0499ec086325e845db609a24f2e22f'
+ '8f05207b586916d489b7d25a68eaacf6e678d7cbb5bfbac551903506b32f904f'
+ 'f2fd9d8331238727333cf2412ba3759cb194a65b2060eff36808b24c06382104'
+ '497dbeefb9cd9792757a9b6e1fbfd92710d19990ee2959add6c30533ae40b6f6'
+ '45429013dae87a58bc79ca7b7a037665bf8592cae0199bcf4aef088fb950e78a')
diff --git a/bitcoin-reindex.service b/bitcoin-reindex.service
new file mode 100644
index 00000000000..52900d8fc4c
--- /dev/null
+++ b/bitcoin-reindex.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Bitcoin Daemon (reindex)
+Conflicts=bitcoin.service
+After=network.target
+
+[Service]
+User=bitcoin
+Group=bitcoin
+ExecStart=/usr/bin/bitcoind -daemon=0 \
+ -conf=/etc/bitcoin/bitcoin.conf \
+ -datadir=/srv/bitcoin \
+ -reindex \
+ -pid=/run/bitcoin/bitcoind.pid
+ExecReload=/usr/bin/kill -HUP $MAINPID
+ExecStop=/usr/bin/bitcoind stop
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target
diff --git a/bitcoin.conf b/bitcoin.conf
new file mode 100644
index 00000000000..395352ab96e
--- /dev/null
+++ b/bitcoin.conf
@@ -0,0 +1,8 @@
+rpcport=8332
+rpcuser=bitcoin
+rpcpassword=secret
+rpcallowip=127.0.0.1
+rpcthreads=4
+txindex=1
+server=1
+dbcache=300
diff --git a/bitcoin.install b/bitcoin.install
new file mode 100644
index 00000000000..e250c4e7189
--- /dev/null
+++ b/bitcoin.install
@@ -0,0 +1,59 @@
+_bc_user=bitcoin
+_bc_group=bitcoin
+
+post_install() {
+ _mkuser
+ chown -R $_bc_user:$_bc_group /etc/bitcoin /srv/bitcoin /run/bitcoin
+ printf "%b\n" "$bitcoin"
+}
+
+post_upgrade() {
+ _mkuser
+ chown -R $_bc_user:$_bc_group /etc/bitcoin /srv/bitcoin /run/bitcoin
+ printf "%b\n" "$bitcoin"
+}
+
+post_remove() {
+ _rmuser
+ rm -rf /srv/bitcoin /run/bitcoin
+}
+
+_mkuser() {
+ getent passwd $_bc_user &>/dev/null || {
+ echo -n "Creating bitcoin user... "
+ grep -E "^$_bc_group:" /etc/group >/dev/null || groupadd $_bc_group
+ useradd -m -d /etc/bitcoin -g $_bc_group -s /usr/bin/nologin $_bc_user 2>/dev/null
+ echo "done"
+ }
+}
+
+_rmuser() {
+ echo -n "Removing bitcoin user... "
+ userdel -rf $_bc_user 2>/dev/null
+ echo "done"
+}
+
+read -d '' bitcoin <<'EOI'
+
+Bitcoin ABC
+___________
+
+To start bitcoin-abc:
+
+$ systemctl start bitcoin
+
+To communicate with bitcoin-abc as a normal user:
+
+$ mkdir -p ~/.bitcoin
+$ cat > ~/.bitcoin/bitcoin.conf <<'EOF'
+rpcport=8332
+rpcuser=bitcoin
+rpcpassword=secret
+EOF
+
+$ bitcoin-cli getmininginfo
+
+Config: /etc/bitcoin/bitcoin.conf
+Blockchain: /srv/bitcoin
+Documentation: /usr/share/doc/bitcoin
+EOI
diff --git a/bitcoin.logrotate b/bitcoin.logrotate
new file mode 100644
index 00000000000..fe13fb2e704
--- /dev/null
+++ b/bitcoin.logrotate
@@ -0,0 +1,11 @@
+/srv/bitcoin/debug.log
+{
+ rotate 5
+ copytruncate
+ daily
+ missingok
+ notifempty
+ compress
+ delaycompress
+ sharedscripts
+}
diff --git a/bitcoin.service b/bitcoin.service
new file mode 100644
index 00000000000..7f2c2ac5278
--- /dev/null
+++ b/bitcoin.service
@@ -0,0 +1,18 @@
+[Unit]
+Description=Bitcoin Daemon
+Conflicts=bitcoin-reindex.service
+After=network.target
+
+[Service]
+User=bitcoin
+Group=bitcoin
+ExecStart=/usr/bin/bitcoind -daemon=0 \
+ -conf=/etc/bitcoin/bitcoin.conf \
+ -datadir=/srv/bitcoin \
+ -pid=/run/bitcoin/bitcoind.pid
+ExecReload=/usr/bin/kill -HUP $MAINPID
+ExecStop=/usr/bin/bitcoind stop
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target