#!/usr/bin/make -f # export PYTHON = python3 # Include the bitlbee-libpurple variant and OTR plugin by default. BITLBEE_LIBPURPLE ?= 1 BITLBEE_OTR ?= plugin BITLBEE_CONFIGURE_FLAGS ?= DEBUG ?= 0 ifndef BITLBEE_VERSION # Want to use the full package version number instead of just the release. include /usr/share/dpkg/default.mk BITLBEE_CONFIGURE_VERSION ?= BITLBEE_VERSION=$(DEB_VERSION) endif ifneq ($(BITLBEE_LIBPURPLE),1) DH_OPTIONS += -Nbitlbee-libpurple endif ifneq ($(BITLBEE_OTR),plugin) DH_OPTIONS += -Nbitlbee-plugin-otr endif CONFIGURE_OVERRIDES:=CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" %: dh $@ override_dh_auto_configure: echo "Configure and build are done in dh_auto_build" override_dh_auto_build: mkdir -p debian/build-native ROOT=$$PWD; cd debian/build-native; $(BITLBEE_CONFIGURE_VERSION) $(CONFIGURE_OVERRIDES) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --events=libevent --otr=$(BITLBEE_OTR) --systemdsystemunitdir=/lib/systemd/system --pcdir=/usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig $(BITLBEE_CONFIGURE_FLAGS) $(MAKE) -C debian/build-native ifeq ($(BITLBEE_LIBPURPLE),1) mkdir -p debian/build-libpurple ROOT=$$PWD; cd debian/build-libpurple; $(BITLBEE_CONFIGURE_VERSION) $(CONFIGURE_OVERRIDES) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --systemdsystemunitdir=/lib/systemd/system --pcdir=/usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig --purple=1 $(BITLBEE_CONFIGURE_FLAGS) $(MAKE) -C debian/build-libpurple endif $(MAKE) -C doc $(MAKE) -C doc/user-guide SYSTEMDSYSTEMUNITDIR=/usr/lib/systemd/system/ make systemd override_dh_auto_clean: rm -rf debian/build-* debian/bitlbee-libpurple.prerm $(MAKE) distclean override_dh_auto_test: echo "FIXME: Run upstream build time test" override_dh_auto_install: $(MAKE) -C debian/build-native install-bin DESTDIR=`pwd`/debian/bitlbee $(MAKE) -C debian/build-native install-etc install-doc DESTDIR=`pwd`/debian/bitlbee-common $(MAKE) -C debian/build-native install-dev DESTDIR=`pwd`/debian/bitlbee-dev $(MAKE) -C debian/build-native install-plugin-otr DESTDIR=`pwd`/debian/bitlbee-plugin-otr ifeq ($(BITLBEE_LIBPURPLE),1) $(MAKE) -C debian/build-libpurple install-bin DESTDIR=`pwd`/debian/bitlbee-libpurple ln -sf debian/bitlbee.prerm debian/bitlbee-libpurple.prerm endif chmod 640 debian/bitlbee-common/etc/bitlbee/bitlbee.conf override_dh_installdocs: dh_installdocs --link-doc=bitlbee-common override_dh_installchangelogs: dh_installchangelogs doc/CHANGES override_dh_installinit: dh_installinit -p bitlbee-common --init-script=bitlbee