aboutsummaryrefslogtreecommitdiffstats
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules12
1 files changed, 12 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
index febb1922..b1b3bd5c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -39,6 +39,8 @@ LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
CONFIGURE_OVERRIDES:=CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
+HAS_DH_SYSTEMD:=$(shell dpkg-query -W -f='$${Status}' dh-systemd 2>/dev/null | grep -c "ok installed")
+
build: build-stamp
build-stamp:
dh_testdir
@@ -80,6 +82,10 @@ install: build
$(MAKE) -C debian/build-native install-plugin-otr DESTDIR=`pwd`/debian/bitlbee-plugin-otr
$(MAKE) -C debian/build-native install-plugin-skype DESTDIR=`pwd`/debian/skyped
+ifeq ($(HAS_DH_SYSTEMD),1)
+ $(MAKE) -C debian/build-native install-systemd DESTDIR=`pwd`/debian/bitlbee-common
+endif
+
ifneq ($(BITLBEE_SKYPE),0)
mkdir -p debian/bitlbee-plugin-skype/usr
mv debian/skyped/usr/lib debian/bitlbee-plugin-skype/usr
@@ -107,7 +113,13 @@ binary-common:
# Hardy and Lenny are deprecated.
for p in bitlbee bitlbee-libpurple bitlbee-dev bitlbee-plugin-otr; do rm -r debian/$$p/usr/share/doc/$$p && ln -s bitlbee-common debian/$$p/usr/share/doc/$$p || true; done
dh_installdebconf
+ifeq ($(HAS_DH_SYSTEMD),1)
+ dh_systemd_enable
dh_installinit --init-script=bitlbee
+ dh_systemd_start
+else
+ dh_installinit --init-script=bitlbee
+endif
dh_installman
dh_lintian
dh_strip