[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 | |
---|
[6c0fe9b] | 10 | # Include the bitlbee-libpurple variant and OTR plugin by default. |
---|
| 11 | # Don't build skype by default since it depends on deleted/non-free |
---|
| 12 | # packages. Need to at least get python-skype back into Debian. |
---|
[d20ea9f] | 13 | BITLBEE_LIBPURPLE ?= 1 |
---|
[27b407f] | 14 | BITLBEE_OTR ?= plugin |
---|
[6c0fe9b] | 15 | BITLBEE_SKYPE ?= 0 |
---|
[b5b40ff] | 16 | BITLBEE_CONFIGURE_FLAGS ?= |
---|
[19a8088] | 17 | DEBUG ?= 0 |
---|
| 18 | |
---|
[4c03881] | 19 | ifndef BITLBEE_VERSION |
---|
[19a8088] | 20 | # Want to use the full package version number instead of just the release. |
---|
[0edb57f] | 21 | BITLBEE_CONFIGURE_VERSION ?= BITLBEE_VERSION="$(shell dpkg-parsechangelog | awk '/^Version:/ {print $$2}')" |
---|
[379c08a] | 22 | endif |
---|
[19a8088] | 23 | |
---|
[763a3ab] | 24 | ifneq ($(BITLBEE_LIBPURPLE),1) |
---|
| 25 | DH_OPTIONS += -Nbitlbee-libpurple |
---|
| 26 | endif |
---|
| 27 | |
---|
[27b407f] | 28 | ifneq ($(BITLBEE_OTR),plugin) |
---|
| 29 | DH_OPTIONS += -Nbitlbee-plugin-otr |
---|
| 30 | endif |
---|
| 31 | |
---|
[57da960] | 32 | ifneq ($(BITLBEE_SKYPE),plugin) |
---|
| 33 | DH_OPTIONS += -Nbitlbee-plugin-skype -Nskyped |
---|
| 34 | endif |
---|
| 35 | |
---|
[095a5f0] | 36 | build: build-stamp |
---|
| 37 | build-stamp: |
---|
| 38 | dh_testdir |
---|
[19a8088] | 39 | |
---|
[4772500] | 40 | mkdir -p debian/build-native |
---|
[5f818ae] | 41 | ROOT=$$PWD; cd debian/build-native; $(BITLBEE_CONFIGURE_VERSION) $(shell dpkg-buildflags --export=configure) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --events=libevent --otr=$(BITLBEE_OTR) --skype=$(BITLBEE_SKYPE) $(BITLBEE_CONFIGURE_FLAGS) |
---|
[095a5f0] | 42 | $(MAKE) -C debian/build-native |
---|
[19a8088] | 43 | |
---|
[d20ea9f] | 44 | ifeq ($(BITLBEE_LIBPURPLE),1) |
---|
[4772500] | 45 | mkdir -p debian/build-libpurple |
---|
[d203495] | 46 | ROOT=$$PWD; cd debian/build-libpurple; $(BITLBEE_CONFIGURE_VERSION) $(shell dpkg-buildflags --export=configure) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --purple=1 $(BITLBEE_CONFIGURE_FLAGS) |
---|
[095a5f0] | 47 | $(MAKE) -C debian/build-libpurple |
---|
[d20ea9f] | 48 | endif |
---|
[19a8088] | 49 | |
---|
[bc49ec2] | 50 | $(MAKE) -C doc |
---|
[0d8add8a] | 51 | $(MAKE) -C doc/user-guide |
---|
[bc49ec2] | 52 | |
---|
[095a5f0] | 53 | touch build-stamp |
---|
[46d4230] | 54 | |
---|
[095a5f0] | 55 | clean: |
---|
| 56 | dh_testdir |
---|
| 57 | dh_testroot |
---|
| 58 | rm -f build-stamp |
---|
[46d4230] | 59 | |
---|
[5b94e9e] | 60 | rm -rf build-arch-stamp debian/build-* debian/bitlbee-libpurple.prerm |
---|
[095a5f0] | 61 | $(MAKE) distclean |
---|
[46d4230] | 62 | |
---|
[095a5f0] | 63 | dh_clean |
---|
| 64 | |
---|
| 65 | install: build |
---|
| 66 | dh_testdir |
---|
| 67 | dh_testroot |
---|
[560d0a0] | 68 | dh_clean -k |
---|
[095a5f0] | 69 | dh_installdirs |
---|
| 70 | |
---|
[27b407f] | 71 | $(MAKE) -C debian/build-native install-bin DESTDIR=`pwd`/debian/bitlbee |
---|
| 72 | $(MAKE) -C debian/build-native install-etc install-doc DESTDIR=`pwd`/debian/bitlbee-common |
---|
[095a5f0] | 73 | $(MAKE) -C debian/build-native install-dev DESTDIR=`pwd`/debian/bitlbee-dev |
---|
[57da960] | 74 | $(MAKE) -C debian/build-native install-plugin-otr DESTDIR=`pwd`/debian/bitlbee-plugin-otr |
---|
| 75 | $(MAKE) -C debian/build-native install-plugin-skype DESTDIR=`pwd`/debian/skyped |
---|
| 76 | |
---|
[6c0fe9b] | 77 | ifneq ($(BITLBEE_SKYPE),0) |
---|
[57da960] | 78 | mkdir -p debian/bitlbee-plugin-skype/usr |
---|
| 79 | mv debian/skyped/usr/lib debian/bitlbee-plugin-skype/usr |
---|
[d20ea9f] | 80 | |
---|
[e46db53] | 81 | mkdir -p debian/skyped/usr/share/man/man1 |
---|
| 82 | mv debian/bitlbee-common/usr/share/man/man1/skyped* debian/skyped/usr/share/man/man1 |
---|
[6c0fe9b] | 83 | endif |
---|
[e46db53] | 84 | |
---|
[d20ea9f] | 85 | ifeq ($(BITLBEE_LIBPURPLE),1) |
---|
[27b407f] | 86 | $(MAKE) -C debian/build-libpurple install-bin DESTDIR=`pwd`/debian/bitlbee-libpurple |
---|
[5b94e9e] | 87 | ln -sf debian/bitlbee.prerm debian/bitlbee-libpurple.prerm |
---|
[d20ea9f] | 88 | endif |
---|
[095a5f0] | 89 | |
---|
[27b407f] | 90 | patch debian/bitlbee-common/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff |
---|
| 91 | chmod 640 debian/bitlbee-common/etc/bitlbee/bitlbee.conf |
---|
[095a5f0] | 92 | |
---|
| 93 | binary-common: |
---|
| 94 | dh_testdir |
---|
| 95 | dh_testroot |
---|
| 96 | |
---|
[4772500] | 97 | dh_installchangelogs doc/CHANGES |
---|
[095a5f0] | 98 | dh_installexamples |
---|
[560d0a0] | 99 | dh_installdocs #--link-doc=bitlbee-common |
---|
| 100 | # TODO: Restore --link-doc up here and remove the hack below once |
---|
| 101 | # Hardy and Lenny are deprecated. |
---|
[27b407f] | 102 | 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] | 103 | dh_installdebconf |
---|
[5b94e9e] | 104 | dh_installinit --init-script=bitlbee |
---|
[095a5f0] | 105 | dh_installman |
---|
[6c2b430] | 106 | dh_lintian |
---|
[095a5f0] | 107 | dh_strip |
---|
| 108 | dh_link |
---|
| 109 | dh_compress |
---|
| 110 | dh_fixperms |
---|
| 111 | dh_installdeb |
---|
| 112 | dh_shlibdeps |
---|
[256164c] | 113 | dh_gencontrol |
---|
[095a5f0] | 114 | dh_md5sums |
---|
| 115 | dh_builddeb |
---|
[46d4230] | 116 | |
---|
[095a5f0] | 117 | binary-indep: build install |
---|
[763a3ab] | 118 | DH_OPTIONS=-i $(MAKE) -f debian/rules binary-common |
---|
[46d4230] | 119 | |
---|
[095a5f0] | 120 | binary-arch: build install |
---|
[763a3ab] | 121 | DH_OPTIONS=-a $(MAKE) -f debian/rules binary-common |
---|
[19a8088] | 122 | |
---|
[095a5f0] | 123 | binary-%: build install |
---|
[763a3ab] | 124 | DH_OPTIONS=-p$* $(MAKE) -f debian/rules binary-common |
---|
[19a8088] | 125 | |
---|
[095a5f0] | 126 | binary: binary-indep binary-arch |
---|
| 127 | .PHONY: build clean binary-indep binary-arch binary-common binary install |
---|