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