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