[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 | |
---|
[b5b40ff] | 10 | BITLBEE_CONFIGURE_FLAGS ?= |
---|
[19a8088] | 11 | DEBUG ?= 0 |
---|
| 12 | |
---|
[4c03881] | 13 | ifndef BITLBEE_VERSION |
---|
[19a8088] | 14 | # Want to use the full package version number instead of just the release. |
---|
[095a5f0] | 15 | BITLBEE_CONFIGURE_VERSION ?= BITLBEE_VERSION=\"$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}')\" |
---|
[379c08a] | 16 | endif |
---|
[19a8088] | 17 | |
---|
[095a5f0] | 18 | build: build-stamp |
---|
| 19 | build-stamp: |
---|
| 20 | dh_testdir |
---|
[19a8088] | 21 | |
---|
[095a5f0] | 22 | mkdir debian/build-native |
---|
| 23 | ROOT=$$PWD; cd debian/build-native; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --events=libevent $(BITLBEE_CONFIGURE_FLAGS) |
---|
| 24 | $(MAKE) -C debian/build-native |
---|
[19a8088] | 25 | |
---|
[095a5f0] | 26 | mkdir debian/build-libpurple |
---|
| 27 | ROOT=$$PWD; cd debian/build-libpurple; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --purple=1 $(BITLBEE_CONFIGURE_FLAGS) |
---|
| 28 | $(MAKE) -C debian/build-libpurple |
---|
[19a8088] | 29 | |
---|
[095a5f0] | 30 | touch build-stamp |
---|
[46d4230] | 31 | |
---|
[095a5f0] | 32 | clean: |
---|
| 33 | dh_testdir |
---|
| 34 | dh_testroot |
---|
| 35 | rm -f build-stamp |
---|
[46d4230] | 36 | |
---|
[095a5f0] | 37 | rm -rf build-arch-stamp debian/build-* |
---|
| 38 | $(MAKE) distclean |
---|
[46d4230] | 39 | |
---|
[095a5f0] | 40 | dh_clean |
---|
| 41 | |
---|
| 42 | install: build |
---|
| 43 | dh_testdir |
---|
| 44 | dh_testroot |
---|
| 45 | dh_prep |
---|
| 46 | dh_installdirs |
---|
| 47 | |
---|
| 48 | $(MAKE) -C debian/build-native install install-etc DESTDIR=`pwd`/debian/bitlbee |
---|
| 49 | $(MAKE) -C debian/build-libpurple install install-etc DESTDIR=`pwd`/debian/bitlbee-libpurple |
---|
| 50 | $(MAKE) -C debian/build-native install-dev DESTDIR=`pwd`/debian/bitlbee-dev |
---|
| 51 | |
---|
| 52 | patch debian/bitlbee/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff |
---|
| 53 | patch debian/bitlbee-libpurple/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff |
---|
| 54 | |
---|
| 55 | mkdir -p debian/bitlbee-common/usr |
---|
| 56 | mv debian/bitlbee/usr/share debian/bitlbee-common/usr |
---|
| 57 | rm -rf debian/bitlbee-libpurple/usr/share |
---|
| 58 | |
---|
| 59 | binary-common: |
---|
| 60 | dh_testdir |
---|
| 61 | dh_testroot |
---|
| 62 | |
---|
| 63 | dh_installdocs --link-doc=bitlbee-common |
---|
| 64 | dh_installchangelogs |
---|
| 65 | dh_installexamples |
---|
| 66 | dh_installdebconf |
---|
| 67 | dh_installinit |
---|
[4c03881] | 68 | ifeq ($(DH_OPTIONS),-a) |
---|
| 69 | cp -a debian/bitlbee/etc debian/bitlbee-libpurple |
---|
| 70 | endif |
---|
[095a5f0] | 71 | dh_installman |
---|
| 72 | dh_strip |
---|
| 73 | dh_link |
---|
| 74 | dh_compress |
---|
| 75 | dh_fixperms |
---|
| 76 | dh_installdeb |
---|
[4c03881] | 77 | ifeq ($(DH_OPTIONS),-a) |
---|
| 78 | cp -a debian/bitlbee/DEBIAN/{post,pre}* debian/bitlbee-libpurple/DEBIAN |
---|
| 79 | endif |
---|
[095a5f0] | 80 | dh_shlibdeps |
---|
[4c03881] | 81 | ifdef BITLBEE_VERSION |
---|
[095a5f0] | 82 | dh_gencontrol -- -v1:$(BITLBEE_VERSION)-0 |
---|
| 83 | else |
---|
| 84 | dh_gencontrol |
---|
| 85 | endif |
---|
| 86 | dh_md5sums |
---|
| 87 | dh_builddeb |
---|
[46d4230] | 88 | |
---|
[095a5f0] | 89 | binary-indep: build install |
---|
| 90 | $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common |
---|
[46d4230] | 91 | |
---|
[095a5f0] | 92 | binary-arch: build install |
---|
| 93 | $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common |
---|
[19a8088] | 94 | |
---|
[095a5f0] | 95 | binary-%: build install |
---|
| 96 | make -f debian/rules binary-common DH_OPTIONS=-p$* |
---|
[19a8088] | 97 | |
---|
[095a5f0] | 98 | binary: binary-indep binary-arch |
---|
| 99 | .PHONY: build clean binary-indep binary-arch binary-common binary install |
---|