2a87b1b07c
Adding systemd service for bitcoind, to provide for a simpler out-of-the-box experience. Configuration file is /etc/bitcoin/bitcoin.conf. This file is a copy of the sample configuration file. The service user 'bitcoin' is added during install. Its homedir is in '/var/lib/bitcoin'. bitcoind.service is disabled by default to allow the user to configure it, before starting it the first time. On package purge, the 'bitcoin' user as well as its homedir is left intact, to not accidentally remove a wallet or something of equal importance. Instead the user is presented with information on how to perform the cleanup manually, after making sure all important data has been backed up.
49 lines
1.2 KiB
Makefile
Executable file
49 lines
1.2 KiB
Makefile
Executable file
#!/usr/bin/make -f
|
||
# -*- mode: makefile; coding: utf-8 -*-
|
||
|
||
#DEB_MAKE_CHECK_TARGET = test_bitcoin
|
||
#build/bitcoind::
|
||
# $(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),,src/test_bitcoin)
|
||
|
||
%:
|
||
dh --with bash-completion --with systemd $@
|
||
|
||
override_dh_auto_clean:
|
||
if [ -f Makefile ]; then $(MAKE) distclean; fi
|
||
rm -rf Makefile.in aclocal.m4 configure src/Makefile.in src/bitcoin-config.h.in src/build-aux src/qt/Makefile.in src/qt/test/Makefile.in src/test/Makefile.in
|
||
|
||
QT=$(shell dpkg-vendor --derives-from Ubuntu && echo qt4 || echo qt5)
|
||
# qt4 is very broken on arm
|
||
ifeq ($(findstring arm,$(shell uname -m)),arm)
|
||
QT=qt5
|
||
endif
|
||
ifeq ($(findstring aarch64,$(shell uname -m)),aarch64)
|
||
QT=qt5
|
||
endif
|
||
|
||
# Yea, autogen should be run on the source archive, but I like doing git archive
|
||
override_dh_auto_configure:
|
||
./autogen.sh
|
||
./configure --with-gui=$(QT)
|
||
|
||
override_dh_auto_test:
|
||
ifeq ($(QT), qt4)
|
||
xvfb-run -n 99 -l make check
|
||
else
|
||
make check
|
||
endif
|
||
|
||
# No SysV or Upstart init scripts included
|
||
override_dh_installinit:
|
||
dh_installinit \
|
||
--noscripts
|
||
|
||
# Don’t enable service by default
|
||
override_dh_systemd_enable:
|
||
dh_systemd_enable \
|
||
--no-enable
|
||
|
||
# Restart after upgrade
|
||
override_dh_systemd_start:
|
||
dh_systemd_start \
|
||
--restart-after-upgrade
|