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 | BITLBEE_CONFIGURE_FLAGS ?= |
---|
11 | DEBUG ?= 0 |
---|
12 | |
---|
13 | ifdef BITLBEE_VERSION |
---|
14 | BITLBEE_FORCE_VERSION=1 |
---|
15 | else |
---|
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 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 | mkdir debian/build-libpurple |
---|
29 | ROOT=$$PWD; cd debian/build-libpurple; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --purple=1 $(BITLBEE_CONFIGURE_FLAGS) |
---|
30 | $(MAKE) -C debian/build-libpurple |
---|
31 | |
---|
32 | touch build-stamp |
---|
33 | |
---|
34 | clean: |
---|
35 | dh_testdir |
---|
36 | dh_testroot |
---|
37 | rm -f build-stamp |
---|
38 | |
---|
39 | rm -rf build-arch-stamp debian/build-* |
---|
40 | $(MAKE) distclean |
---|
41 | |
---|
42 | dh_clean |
---|
43 | |
---|
44 | install: build |
---|
45 | dh_testdir |
---|
46 | dh_testroot |
---|
47 | dh_prep |
---|
48 | dh_installdirs |
---|
49 | |
---|
50 | $(MAKE) -C debian/build-native install install-etc DESTDIR=`pwd`/debian/bitlbee |
---|
51 | $(MAKE) -C debian/build-libpurple install install-etc DESTDIR=`pwd`/debian/bitlbee-libpurple |
---|
52 | $(MAKE) -C debian/build-native install-dev DESTDIR=`pwd`/debian/bitlbee-dev |
---|
53 | |
---|
54 | patch debian/bitlbee/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff |
---|
55 | patch debian/bitlbee-libpurple/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff |
---|
56 | |
---|
57 | mkdir -p debian/bitlbee-common/usr |
---|
58 | mv debian/bitlbee/usr/share debian/bitlbee-common/usr |
---|
59 | rm -rf debian/bitlbee-libpurple/usr/share |
---|
60 | |
---|
61 | binary-common: |
---|
62 | dh_testdir |
---|
63 | dh_testroot |
---|
64 | |
---|
65 | dh_installdocs --link-doc=bitlbee-common |
---|
66 | dh_installchangelogs |
---|
67 | dh_installexamples |
---|
68 | dh_installdebconf |
---|
69 | dh_installinit |
---|
70 | dh_installman |
---|
71 | dh_strip |
---|
72 | dh_link |
---|
73 | dh_compress |
---|
74 | dh_fixperms |
---|
75 | dh_installdeb |
---|
76 | dh_shlibdeps |
---|
77 | ifdef BITLBEE_FORCE_VERSION |
---|
78 | dh_gencontrol -- -v1:$(BITLBEE_VERSION)-0 |
---|
79 | else |
---|
80 | dh_gencontrol |
---|
81 | endif |
---|
82 | dh_md5sums |
---|
83 | dh_builddeb |
---|
84 | |
---|
85 | binary-indep: build install |
---|
86 | $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common |
---|
87 | |
---|
88 | binary-arch: build install |
---|
89 | $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common |
---|
90 | |
---|
91 | binary-%: build install |
---|
92 | make -f debian/rules binary-common DH_OPTIONS=-p$* |
---|
93 | |
---|
94 | binary: binary-indep binary-arch |
---|
95 | .PHONY: build clean binary-indep binary-arch binary-common binary install |
---|