#!/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 by default BITLBEE_LIBPURPLE ?= 1 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 | grep ^Version: | awk '{print $$2}')\" endif build: build-stamp build-stamp: dh_testdir mkdir -p debian/build-native ROOT=$$PWD; cd debian/build-native; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --events=libevent $(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-* $(MAKE) distclean dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs $(MAKE) -C debian/build-native install install-etc DESTDIR=`pwd`/debian/bitlbee $(MAKE) -C debian/build-native install-dev DESTDIR=`pwd`/debian/bitlbee-dev patch debian/bitlbee/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff ifeq ($(BITLBEE_LIBPURPLE),1) $(MAKE) -C debian/build-libpurple install install-etc DESTDIR=`pwd`/debian/bitlbee-libpurple patch debian/bitlbee-libpurple/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff endif mkdir -p debian/bitlbee-common/usr mv debian/bitlbee/usr/share debian/bitlbee-common/usr rm -rf debian/bitlbee-libpurple/usr/share 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; do rm -r debian/$$p/usr/share/doc/$$p && ln -s bitlbee-common debian/$$p/usr/share/doc/$$p; done dh_installdebconf dh_installinit ifeq ($(BITLBEE_LIBPURPLE)$(DH_OPTIONS),1-a) cp -a debian/bitlbee/etc debian/bitlbee-libpurple endif dh_installman dh_strip dh_link dh_compress dh_fixperms dh_installdeb ifeq ($(BITLBEE_LIBPURPLE)$(DH_OPTIONS),1-a) cp -a debian/bitlbee/DEBIAN/post* debian/bitlbee/DEBIAN/pre* debian/bitlbee-libpurple/DEBIAN endif dh_shlibdeps ifdef BITLBEE_VERSION dh_gencontrol -- -v1:$(BITLBEE_VERSION)-0 -Vbee:Version=1:$(BITLBEE_VERSION)-0 else dh_gencontrol -- -Vbee:Version=$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}' | sed -e 's/+b[0-9]\+$$//') endif dh_md5sums ifeq ($(BITLBEE_LIBPURPLE),1) dh_builddeb else dh_builddeb -Nbitlbee-libpurple endif binary-indep: build install $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common binary-arch: build install $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common binary-%: build install make -f debian/rules binary-common DH_OPTIONS=-p$* binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary-common binary install