[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. |
---|
[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. |
---|
[0edb57f] | 18 | BITLBEE_CONFIGURE_VERSION ?= BITLBEE_VERSION="$(shell dpkg-parsechangelog | awk '/^Version:/ {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 | |
---|
[e01ff50] | 29 | CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) |
---|
| 30 | CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) |
---|
| 31 | LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) |
---|
| 32 | |
---|
| 33 | CONFIGURE_OVERRIDES:=CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" |
---|
| 34 | |
---|
[135271c] | 35 | HAS_DH_SYSTEMD:=$(shell dpkg-query -W -f='$${Status}' dh-systemd 2>/dev/null | grep -c "ok installed") |
---|
[53cb4ae] | 36 | |
---|
[f8d2cff] | 37 | build-arch: build |
---|
[135271c] | 38 | |
---|
[095a5f0] | 39 | build: build-stamp |
---|
| 40 | build-stamp: |
---|
| 41 | dh_testdir |
---|
[19a8088] | 42 | |
---|
[4772500] | 43 | mkdir -p debian/build-native |
---|
[8d7b0a4] | 44 | ROOT=$$PWD; cd debian/build-native; $(BITLBEE_CONFIGURE_VERSION) $(CONFIGURE_OVERRIDES) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --events=libevent --otr=$(BITLBEE_OTR) --systemdsystemunitdir=/lib/systemd/system --pcdir=/usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig $(BITLBEE_CONFIGURE_FLAGS) |
---|
[095a5f0] | 45 | $(MAKE) -C debian/build-native |
---|
[19a8088] | 46 | |
---|
[d20ea9f] | 47 | ifeq ($(BITLBEE_LIBPURPLE),1) |
---|
[4772500] | 48 | mkdir -p debian/build-libpurple |
---|
[8d7b0a4] | 49 | ROOT=$$PWD; cd debian/build-libpurple; $(BITLBEE_CONFIGURE_VERSION) $(CONFIGURE_OVERRIDES) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --systemdsystemunitdir=/lib/systemd/system --pcdir=/usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig --purple=1 $(BITLBEE_CONFIGURE_FLAGS) |
---|
[095a5f0] | 50 | $(MAKE) -C debian/build-libpurple |
---|
[d20ea9f] | 51 | endif |
---|
[19a8088] | 52 | |
---|
[bc49ec2] | 53 | $(MAKE) -C doc |
---|
[0d8add8a] | 54 | $(MAKE) -C doc/user-guide |
---|
[bc49ec2] | 55 | |
---|
[095a5f0] | 56 | touch build-stamp |
---|
[46d4230] | 57 | |
---|
[095a5f0] | 58 | clean: |
---|
| 59 | dh_testdir |
---|
| 60 | dh_testroot |
---|
| 61 | rm -f build-stamp |
---|
[46d4230] | 62 | |
---|
[5b94e9e] | 63 | rm -rf build-arch-stamp debian/build-* debian/bitlbee-libpurple.prerm |
---|
[095a5f0] | 64 | $(MAKE) distclean |
---|
[46d4230] | 65 | |
---|
[095a5f0] | 66 | dh_clean |
---|
| 67 | |
---|
| 68 | install: build |
---|
| 69 | dh_testdir |
---|
| 70 | dh_testroot |
---|
[e9a3e8c] | 71 | dh_prep |
---|
[095a5f0] | 72 | dh_installdirs |
---|
| 73 | |
---|
[27b407f] | 74 | $(MAKE) -C debian/build-native install-bin DESTDIR=`pwd`/debian/bitlbee |
---|
| 75 | $(MAKE) -C debian/build-native install-etc install-doc DESTDIR=`pwd`/debian/bitlbee-common |
---|
[095a5f0] | 76 | $(MAKE) -C debian/build-native install-dev DESTDIR=`pwd`/debian/bitlbee-dev |
---|
[57da960] | 77 | $(MAKE) -C debian/build-native install-plugin-otr DESTDIR=`pwd`/debian/bitlbee-plugin-otr |
---|
| 78 | |
---|
[135271c] | 79 | ifeq ($(HAS_DH_SYSTEMD),1) |
---|
| 80 | $(MAKE) -C debian/build-native install-systemd DESTDIR=`pwd`/debian/bitlbee-common |
---|
| 81 | endif |
---|
| 82 | |
---|
[d20ea9f] | 83 | ifeq ($(BITLBEE_LIBPURPLE),1) |
---|
[27b407f] | 84 | $(MAKE) -C debian/build-libpurple install-bin DESTDIR=`pwd`/debian/bitlbee-libpurple |
---|
[5b94e9e] | 85 | ln -sf debian/bitlbee.prerm debian/bitlbee-libpurple.prerm |
---|
[d20ea9f] | 86 | endif |
---|
[095a5f0] | 87 | |
---|
[27b407f] | 88 | patch debian/bitlbee-common/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff |
---|
| 89 | chmod 640 debian/bitlbee-common/etc/bitlbee/bitlbee.conf |
---|
[095a5f0] | 90 | |
---|
| 91 | binary-common: |
---|
| 92 | dh_testdir |
---|
| 93 | dh_testroot |
---|
| 94 | |
---|
| 95 | dh_installexamples |
---|
[f8d2cff] | 96 | dh_installdocs --link-doc=bitlbee-common |
---|
[e979b0f] | 97 | dh_installchangelogs doc/CHANGES |
---|
[095a5f0] | 98 | dh_installdebconf |
---|
[135271c] | 99 | ifeq ($(HAS_DH_SYSTEMD),1) |
---|
[46b5ed1] | 100 | dh_systemd_enable -p bitlbee-common --no-enable bitlbee.socket |
---|
| 101 | dh_systemd_enable -p bitlbee-common bitlbee.service |
---|
| 102 | dh_installinit -p bitlbee-common --init-script=bitlbee |
---|
| 103 | dh_systemd_start -p bitlbee-common |
---|
[135271c] | 104 | else |
---|
[46b5ed1] | 105 | dh_installinit -p bitlbee-common --init-script=bitlbee |
---|
[135271c] | 106 | endif |
---|
[095a5f0] | 107 | dh_installman |
---|
[6c2b430] | 108 | dh_lintian |
---|
[095a5f0] | 109 | dh_strip |
---|
| 110 | dh_link |
---|
| 111 | dh_compress |
---|
| 112 | dh_fixperms |
---|
| 113 | dh_installdeb |
---|
| 114 | dh_shlibdeps |
---|
[256164c] | 115 | dh_gencontrol |
---|
[095a5f0] | 116 | dh_md5sums |
---|
| 117 | dh_builddeb |
---|
[46d4230] | 118 | |
---|
[095a5f0] | 119 | binary-arch: build install |
---|
[763a3ab] | 120 | DH_OPTIONS=-a $(MAKE) -f debian/rules binary-common |
---|
[19a8088] | 121 | |
---|
[095a5f0] | 122 | binary-%: build install |
---|
[763a3ab] | 123 | DH_OPTIONS=-p$* $(MAKE) -f debian/rules binary-common |
---|
[19a8088] | 124 | |
---|
[f8d2cff] | 125 | binary: binary-arch |
---|
[c81b412] | 126 | .PHONY: build clean binary-arch binary-common binary install build-indep |
---|
| 127 | |
---|
| 128 | build-indep: |
---|