1 | #!/usr/bin/make -f |
---|
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 | # |
---|
9 | |
---|
10 | # Include the bitlbee-libpurple variant by default |
---|
11 | BITLBEE_LIBPURPLE ?= 1 |
---|
12 | BITLBEE_CONFIGURE_FLAGS ?= |
---|
13 | DEBUG ?= 0 |
---|
14 | |
---|
15 | ifndef BITLBEE_VERSION |
---|
16 | # Want to use the full package version number instead of just the release. |
---|
17 | BITLBEE_CONFIGURE_VERSION ?= BITLBEE_VERSION=\"$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}')\" |
---|
18 | endif |
---|
19 | |
---|
20 | build: build-stamp |
---|
21 | build-stamp: |
---|
22 | dh_testdir |
---|
23 | |
---|
24 | mkdir -p debian/build-native |
---|
25 | ROOT=$$PWD; cd debian/build-native; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --events=libevent $(BITLBEE_CONFIGURE_FLAGS) |
---|
26 | $(MAKE) -C debian/build-native |
---|
27 | |
---|
28 | ifeq ($(BITLBEE_LIBPURPLE),1) |
---|
29 | mkdir -p debian/build-libpurple |
---|
30 | ROOT=$$PWD; cd debian/build-libpurple; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --purple=1 $(BITLBEE_CONFIGURE_FLAGS) |
---|
31 | $(MAKE) -C debian/build-libpurple |
---|
32 | endif |
---|
33 | |
---|
34 | $(MAKE) -C doc |
---|
35 | |
---|
36 | touch build-stamp |
---|
37 | |
---|
38 | clean: |
---|
39 | dh_testdir |
---|
40 | dh_testroot |
---|
41 | rm -f build-stamp |
---|
42 | |
---|
43 | rm -rf build-arch-stamp debian/build-* |
---|
44 | $(MAKE) distclean |
---|
45 | |
---|
46 | dh_clean |
---|
47 | |
---|
48 | install: build |
---|
49 | dh_testdir |
---|
50 | dh_testroot |
---|
51 | dh_clean -k |
---|
52 | dh_installdirs |
---|
53 | |
---|
54 | $(MAKE) -C debian/build-native install install-etc DESTDIR=`pwd`/debian/bitlbee |
---|
55 | $(MAKE) -C debian/build-native install-dev DESTDIR=`pwd`/debian/bitlbee-dev |
---|
56 | patch debian/bitlbee/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff |
---|
57 | |
---|
58 | ifeq ($(BITLBEE_LIBPURPLE),1) |
---|
59 | $(MAKE) -C debian/build-libpurple install install-etc DESTDIR=`pwd`/debian/bitlbee-libpurple |
---|
60 | patch debian/bitlbee-libpurple/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff |
---|
61 | endif |
---|
62 | |
---|
63 | mkdir -p debian/bitlbee-common/usr |
---|
64 | mv debian/bitlbee/usr/share debian/bitlbee-common/usr |
---|
65 | rm -rf debian/bitlbee-libpurple/usr/share |
---|
66 | |
---|
67 | binary-common: |
---|
68 | dh_testdir |
---|
69 | dh_testroot |
---|
70 | |
---|
71 | dh_installchangelogs doc/CHANGES |
---|
72 | dh_installexamples |
---|
73 | dh_installdocs #--link-doc=bitlbee-common |
---|
74 | # TODO: Restore --link-doc up here and remove the hack below once |
---|
75 | # Hardy and Lenny are deprecated. |
---|
76 | for p in bitlbee bitlbee-libpurple bitlbee-dev; do rm -r debian/$$p/usr/share/doc/$$p && ln -s bitlbee-common debian/$$p/usr/share/doc/$$p; done |
---|
77 | dh_installdebconf |
---|
78 | dh_installinit |
---|
79 | ifeq ($(BITLBEE_LIBPURPLE)$(DH_OPTIONS),1-a) |
---|
80 | cp -a debian/bitlbee/etc debian/bitlbee-libpurple |
---|
81 | endif |
---|
82 | dh_installman |
---|
83 | dh_strip |
---|
84 | dh_link |
---|
85 | dh_compress |
---|
86 | dh_fixperms |
---|
87 | dh_installdeb |
---|
88 | ifeq ($(BITLBEE_LIBPURPLE)$(DH_OPTIONS),1-a) |
---|
89 | cp -a debian/bitlbee/DEBIAN/post* debian/bitlbee/DEBIAN/pre* debian/bitlbee-libpurple/DEBIAN |
---|
90 | endif |
---|
91 | dh_shlibdeps |
---|
92 | ifdef BITLBEE_VERSION |
---|
93 | dh_gencontrol -- -v1:$(BITLBEE_VERSION)-0 -Vbee:Version=1:$(BITLBEE_VERSION)-0 |
---|
94 | else |
---|
95 | dh_gencontrol -- -Vbee:Version=$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}' | sed -e 's/+b[0-9]\+$$//') |
---|
96 | endif |
---|
97 | dh_md5sums |
---|
98 | ifeq ($(BITLBEE_LIBPURPLE),1) |
---|
99 | dh_builddeb |
---|
100 | else |
---|
101 | dh_builddeb -Nbitlbee-libpurple |
---|
102 | endif |
---|
103 | |
---|
104 | binary-indep: build install |
---|
105 | $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common |
---|
106 | |
---|
107 | binary-arch: build install |
---|
108 | $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common |
---|
109 | |
---|
110 | binary-%: build install |
---|
111 | make -f debian/rules binary-common DH_OPTIONS=-p$* |
---|
112 | |
---|
113 | binary: binary-indep binary-arch |
---|
114 | .PHONY: build clean binary-indep binary-arch binary-common binary install |
---|