#!/usr/bin/make -f # # Finally switching to debhelper. # # Not using debhelper was an exercise suggested to me by my AM (Gergely # Nagy). It was educating at the time but I finally decided that the # exercise is over now. # # Include the bitlbee-libpurple variant and OTR plugin by default. # Don't build skype by default since it depends on deleted/non-free # packages. Need to at least get python-skype back into Debian. BITLBEE_LIBPURPLE ?= 1 BITLBEE_OTR ?= plugin BITLBEE_SKYPE ?= 0 BITLBEE_CONFIGURE_FLAGS ?= DEBUG ?= 0 ifndef BITLBEE_VERSION # Want to use the full package version number instead of just the release. BITLBEE_CONFIGURE_VERSION ?= BITLBEE_VERSION="$(shell dpkg-parsechangelog | awk '/^Version:/ {print $$2}')" endif ifneq ($(BITLBEE_LIBPURPLE),1) DH_OPTIONS += -Nbitlbee-libpurple endif ifneq ($(BITLBEE_OTR),plugin) DH_OPTIONS += -Nbitlbee-plugin-otr endif ifneq ($(BITLBEE_SKYPE),plugin) DH_OPTIONS += -Nbitlbee-plugin-skype -Nskyped endif build: build-stamp build-stamp: dh_testdir mkdir -p debian/build-native $(shell dpkg-buildflags --export=configure) ROOT=$$PWD; cd debian/build-native; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --events=libevent --otr=$(BITLBEE_OTR) --skype=$(BITLBEE_SKYPE) $(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) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --purple=1 $(BITLBEE_CONFIGURE_FLAGS) $(MAKE) -C debian/build-libpurple endif $(MAKE) -C doc touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp rm -rf build-arch-stamp debian/build-* debian/bitlbee-libpurple.prerm $(MAKE) distclean dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs $(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 $(MAKE) -C debian/build-native install-plugin-skype DESTDIR=`pwd`/debian/skyped ifneq ($(BITLBEE_SKYPE),0) mkdir -p debian/bitlbee-plugin-skype/usr mv debian/skyped/usr/lib debian/bitlbee-plugin-skype/usr mkdir -p debian/skyped/usr/share/man/man1 mv debian/bitlbee-common/usr/share/man/man1/skyped* debian/skyped/usr/share/man/man1 endif 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 patch debian/bitlbee-common/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff chmod 640 debian/bitlbee-common/etc/bitlbee/bitlbee.conf binary-common: dh_testdir dh_testroot dh_installchangelogs doc/CHANGES dh_installexamples dh_installdocs #--link-doc=bitlbee-common # TODO: Restore --link-doc up here and remove the hack below once # 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 dh_installinit --init-script=bitlbee dh_installman dh_lintian dh_strip dh_link dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary-indep: build install DH_OPTIONS=-i $(MAKE) -f debian/rules binary-common binary-arch: build install DH_OPTIONS=-a $(MAKE) -f debian/rules binary-common binary-%: build install DH_OPTIONS=-p$* $(MAKE) -f debian/rules binary-common binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary-common binary install