| 1 |
#!/usr/bin/make -f |
| 2 |
# |
| 3 |
|
| 4 |
export PYTHON = python3 |
| 5 |
|
| 6 |
# Include the bitlbee-libpurple variant and OTR plugin by default. |
| 7 |
BITLBEE_LIBPURPLE ?= 1 |
| 8 |
BITLBEE_OTR ?= plugin |
| 9 |
BITLBEE_CONFIGURE_FLAGS ?= |
| 10 |
DEBUG ?= 0 |
| 11 |
|
| 12 |
ifndef BITLBEE_VERSION |
| 13 |
# Want to use the full package version number instead of just the release. |
| 14 |
include /usr/share/dpkg/default.mk |
| 15 |
BITLBEE_CONFIGURE_VERSION ?= BITLBEE_VERSION=$(DEB_VERSION) |
| 16 |
endif |
| 17 |
|
| 18 |
ifneq ($(BITLBEE_LIBPURPLE),1) |
| 19 |
DH_OPTIONS += -Nbitlbee-libpurple |
| 20 |
endif |
| 21 |
|
| 22 |
ifneq ($(BITLBEE_OTR),plugin) |
| 23 |
DH_OPTIONS += -Nbitlbee-plugin-otr |
| 24 |
endif |
| 25 |
|
| 26 |
CONFIGURE_OVERRIDES:=CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" |
| 27 |
|
| 28 |
%: |
| 29 |
dh $@ |
| 30 |
|
| 31 |
override_dh_auto_configure: |
| 32 |
echo "Configure and build are done in dh_auto_build" |
| 33 |
|
| 34 |
override_dh_auto_build: |
| 35 |
mkdir -p debian/build-native |
| 36 |
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) |
| 37 |
$(MAKE) -C debian/build-native |
| 38 |
|
| 39 |
ifeq ($(BITLBEE_LIBPURPLE),1) |
| 40 |
mkdir -p debian/build-libpurple |
| 41 |
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) |
| 42 |
$(MAKE) -C debian/build-libpurple |
| 43 |
endif |
| 44 |
|
| 45 |
$(MAKE) -C doc |
| 46 |
$(MAKE) -C doc/user-guide |
| 47 |
|
| 48 |
SYSTEMDSYSTEMUNITDIR=/usr/lib/systemd/system/ make systemd |
| 49 |
|
| 50 |
override_dh_auto_clean: |
| 51 |
rm -rf debian/build-* debian/bitlbee-libpurple.prerm |
| 52 |
$(MAKE) distclean |
| 53 |
|
| 54 |
override_dh_auto_test: |
| 55 |
echo "FIXME: Run upstream build time test" |
| 56 |
|
| 57 |
override_dh_auto_install: |
| 58 |
$(MAKE) -C debian/build-native install-bin DESTDIR=`pwd`/debian/bitlbee |
| 59 |
$(MAKE) -C debian/build-native install-etc install-doc DESTDIR=`pwd`/debian/bitlbee-common |
| 60 |
$(MAKE) -C debian/build-native install-dev DESTDIR=`pwd`/debian/bitlbee-dev |
| 61 |
$(MAKE) -C debian/build-native install-plugin-otr DESTDIR=`pwd`/debian/bitlbee-plugin-otr |
| 62 |
|
| 63 |
ifeq ($(BITLBEE_LIBPURPLE),1) |
| 64 |
$(MAKE) -C debian/build-libpurple install-bin DESTDIR=`pwd`/debian/bitlbee-libpurple |
| 65 |
ln -sf debian/bitlbee.prerm debian/bitlbee-libpurple.prerm |
| 66 |
endif |
| 67 |
|
| 68 |
chmod 640 debian/bitlbee-common/etc/bitlbee/bitlbee.conf |
| 69 |
|
| 70 |
override_dh_installdocs: |
| 71 |
dh_installdocs --link-doc=bitlbee-common |
| 72 |
|
| 73 |
override_dh_installchangelogs: |
| 74 |
dh_installchangelogs doc/CHANGES |
| 75 |
|
| 76 |
override_dh_installinit: |
| 77 |
dh_installinit -p bitlbee-common --init-script=bitlbee |