[19a8088] | 1 | #!/usr/bin/make -f |
---|
[095a5f0] | 2 | # |
---|
| 3 | # Finally switching to debhelper. |
---|
| 4 | # |
---|
| 5 | # Not using debhelper was an exercise suggested to me by my AM (Gergely |
---|
| 6 | # Nagy). It was educating at the time but I finally decided that the |
---|
| 7 | # exercise is over now. |
---|
| 8 | # |
---|
[19a8088] | 9 | |
---|
[27b407f] | 10 | # Include the bitlbee-libpurple variant and OTR plugin by default |
---|
[d20ea9f] | 11 | BITLBEE_LIBPURPLE ?= 1 |
---|
[27b407f] | 12 | BITLBEE_OTR ?= plugin |
---|
[b5b40ff] | 13 | BITLBEE_CONFIGURE_FLAGS ?= |
---|
[19a8088] | 14 | DEBUG ?= 0 |
---|
| 15 | |
---|
[4c03881] | 16 | ifndef BITLBEE_VERSION |
---|
[19a8088] | 17 | # Want to use the full package version number instead of just the release. |
---|
[095a5f0] | 18 | BITLBEE_CONFIGURE_VERSION ?= BITLBEE_VERSION=\"$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}')\" |
---|
[379c08a] | 19 | endif |
---|
[19a8088] | 20 | |
---|
[763a3ab] | 21 | ifneq ($(BITLBEE_LIBPURPLE),1) |
---|
| 22 | DH_OPTIONS += -Nbitlbee-libpurple |
---|
| 23 | endif |
---|
| 24 | |
---|
[27b407f] | 25 | ifneq ($(BITLBEE_OTR),plugin) |
---|
| 26 | DH_OPTIONS += -Nbitlbee-plugin-otr |
---|
| 27 | endif |
---|
| 28 | |
---|
[095a5f0] | 29 | build: build-stamp |
---|
| 30 | build-stamp: |
---|
| 31 | dh_testdir |
---|
[19a8088] | 32 | |
---|
[4772500] | 33 | mkdir -p debian/build-native |
---|
[27b407f] | 34 | ROOT=$$PWD; cd debian/build-native; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --events=libevent --otr=$(BITLBEE_OTR) $(BITLBEE_CONFIGURE_FLAGS) |
---|
[095a5f0] | 35 | $(MAKE) -C debian/build-native |
---|
[19a8088] | 36 | |
---|
[d20ea9f] | 37 | ifeq ($(BITLBEE_LIBPURPLE),1) |
---|
[4772500] | 38 | mkdir -p debian/build-libpurple |
---|
[095a5f0] | 39 | ROOT=$$PWD; cd debian/build-libpurple; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --purple=1 $(BITLBEE_CONFIGURE_FLAGS) |
---|
| 40 | $(MAKE) -C debian/build-libpurple |
---|
[d20ea9f] | 41 | endif |
---|
[19a8088] | 42 | |
---|
[bc49ec2] | 43 | $(MAKE) -C doc |
---|
| 44 | |
---|
[095a5f0] | 45 | touch build-stamp |
---|
[46d4230] | 46 | |
---|
[095a5f0] | 47 | clean: |
---|
| 48 | dh_testdir |
---|
| 49 | dh_testroot |
---|
| 50 | rm -f build-stamp |
---|
[46d4230] | 51 | |
---|
[5b94e9e] | 52 | rm -rf build-arch-stamp debian/build-* debian/bitlbee-libpurple.prerm |
---|
[095a5f0] | 53 | $(MAKE) distclean |
---|
[46d4230] | 54 | |
---|
[095a5f0] | 55 | dh_clean |
---|
| 56 | |
---|
| 57 | install: build |
---|
| 58 | dh_testdir |
---|
| 59 | dh_testroot |
---|
[560d0a0] | 60 | dh_clean -k |
---|
[095a5f0] | 61 | dh_installdirs |
---|
| 62 | |
---|
[27b407f] | 63 | $(MAKE) -C debian/build-native install-bin DESTDIR=`pwd`/debian/bitlbee |
---|
| 64 | $(MAKE) -C debian/build-native install-etc install-doc DESTDIR=`pwd`/debian/bitlbee-common |
---|
[095a5f0] | 65 | $(MAKE) -C debian/build-native install-dev DESTDIR=`pwd`/debian/bitlbee-dev |
---|
[27b407f] | 66 | $(MAKE) -C debian/build-native install-plugins DESTDIR=`pwd`/debian/bitlbee-plugin-otr |
---|
[d20ea9f] | 67 | |
---|
| 68 | ifeq ($(BITLBEE_LIBPURPLE),1) |
---|
[27b407f] | 69 | $(MAKE) -C debian/build-libpurple install-bin DESTDIR=`pwd`/debian/bitlbee-libpurple |
---|
[5b94e9e] | 70 | ln -sf debian/bitlbee.prerm debian/bitlbee-libpurple.prerm |
---|
[d20ea9f] | 71 | endif |
---|
[095a5f0] | 72 | |
---|
[27b407f] | 73 | patch debian/bitlbee-common/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff |
---|
| 74 | chmod 640 debian/bitlbee-common/etc/bitlbee/bitlbee.conf |
---|
[095a5f0] | 75 | |
---|
| 76 | binary-common: |
---|
| 77 | dh_testdir |
---|
| 78 | dh_testroot |
---|
| 79 | |
---|
[4772500] | 80 | dh_installchangelogs doc/CHANGES |
---|
[095a5f0] | 81 | dh_installexamples |
---|
[560d0a0] | 82 | dh_installdocs #--link-doc=bitlbee-common |
---|
| 83 | # TODO: Restore --link-doc up here and remove the hack below once |
---|
| 84 | # Hardy and Lenny are deprecated. |
---|
[27b407f] | 85 | 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 |
---|
[095a5f0] | 86 | dh_installdebconf |
---|
[5b94e9e] | 87 | dh_installinit --init-script=bitlbee |
---|
[095a5f0] | 88 | dh_installman |
---|
[6c2b430] | 89 | dh_lintian |
---|
[095a5f0] | 90 | dh_strip |
---|
| 91 | dh_link |
---|
| 92 | dh_compress |
---|
| 93 | dh_fixperms |
---|
| 94 | dh_installdeb |
---|
| 95 | dh_shlibdeps |
---|
[4c03881] | 96 | ifdef BITLBEE_VERSION |
---|
[a658f10] | 97 | dh_gencontrol -- -v$(BITLBEE_VERSION) -Vbee:Version=$(BITLBEE_VERSION) |
---|
[095a5f0] | 98 | else |
---|
[8f984a0] | 99 | dh_gencontrol -- -Vbee:Version=$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}' | sed -e 's/+b[0-9]\+$$//') |
---|
[095a5f0] | 100 | endif |
---|
| 101 | dh_md5sums |
---|
| 102 | dh_builddeb |
---|
[46d4230] | 103 | |
---|
[095a5f0] | 104 | binary-indep: build install |
---|
[763a3ab] | 105 | DH_OPTIONS=-i $(MAKE) -f debian/rules binary-common |
---|
[46d4230] | 106 | |
---|
[095a5f0] | 107 | binary-arch: build install |
---|
[763a3ab] | 108 | DH_OPTIONS=-a $(MAKE) -f debian/rules binary-common |
---|
[19a8088] | 109 | |
---|
[095a5f0] | 110 | binary-%: build install |
---|
[763a3ab] | 111 | DH_OPTIONS=-p$* $(MAKE) -f debian/rules binary-common |
---|
[19a8088] | 112 | |
---|
[095a5f0] | 113 | binary: binary-indep binary-arch |
---|
| 114 | .PHONY: build clean binary-indep binary-arch binary-common binary install |
---|