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 | CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) |
---|
37 | CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) |
---|
38 | LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) |
---|
39 | |
---|
40 | CONFIGURE_OVERRIDES:=CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" |
---|
41 | |
---|
42 | build: build-stamp |
---|
43 | build-stamp: |
---|
44 | dh_testdir |
---|
45 | |
---|
46 | mkdir -p debian/build-native |
---|
47 | 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) --skype=$(BITLBEE_SKYPE) $(BITLBEE_CONFIGURE_FLAGS) |
---|
48 | $(MAKE) -C debian/build-native |
---|
49 | |
---|
50 | ifeq ($(BITLBEE_LIBPURPLE),1) |
---|
51 | mkdir -p debian/build-libpurple |
---|
52 | ROOT=$$PWD; cd debian/build-libpurple; $(BITLBEE_CONFIGURE_VERSION) $(CONFIGURE_OVERRIDES) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --purple=1 $(BITLBEE_CONFIGURE_FLAGS) |
---|
53 | $(MAKE) -C debian/build-libpurple |
---|
54 | endif |
---|
55 | |
---|
56 | $(MAKE) -C doc |
---|
57 | $(MAKE) -C doc/user-guide |
---|
58 | |
---|
59 | touch build-stamp |
---|
60 | |
---|
61 | clean: |
---|
62 | dh_testdir |
---|
63 | dh_testroot |
---|
64 | rm -f build-stamp |
---|
65 | |
---|
66 | rm -rf build-arch-stamp debian/build-* debian/bitlbee-libpurple.prerm |
---|
67 | $(MAKE) distclean |
---|
68 | |
---|
69 | dh_clean |
---|
70 | |
---|
71 | install: build |
---|
72 | dh_testdir |
---|
73 | dh_testroot |
---|
74 | dh_clean -k |
---|
75 | dh_installdirs |
---|
76 | |
---|
77 | $(MAKE) -C debian/build-native install-bin DESTDIR=`pwd`/debian/bitlbee |
---|
78 | $(MAKE) -C debian/build-native install-etc install-doc DESTDIR=`pwd`/debian/bitlbee-common |
---|
79 | $(MAKE) -C debian/build-native install-dev DESTDIR=`pwd`/debian/bitlbee-dev |
---|
80 | $(MAKE) -C debian/build-native install-plugin-otr DESTDIR=`pwd`/debian/bitlbee-plugin-otr |
---|
81 | $(MAKE) -C debian/build-native install-plugin-skype DESTDIR=`pwd`/debian/skyped |
---|
82 | |
---|
83 | ifneq ($(BITLBEE_SKYPE),0) |
---|
84 | mkdir -p debian/bitlbee-plugin-skype/usr |
---|
85 | mv debian/skyped/usr/lib debian/bitlbee-plugin-skype/usr |
---|
86 | |
---|
87 | mkdir -p debian/skyped/usr/share/man/man1 |
---|
88 | mv debian/bitlbee-common/usr/share/man/man1/skyped* debian/skyped/usr/share/man/man1 |
---|
89 | endif |
---|
90 | |
---|
91 | ifeq ($(BITLBEE_LIBPURPLE),1) |
---|
92 | $(MAKE) -C debian/build-libpurple install-bin DESTDIR=`pwd`/debian/bitlbee-libpurple |
---|
93 | ln -sf debian/bitlbee.prerm debian/bitlbee-libpurple.prerm |
---|
94 | endif |
---|
95 | |
---|
96 | patch debian/bitlbee-common/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff |
---|
97 | chmod 640 debian/bitlbee-common/etc/bitlbee/bitlbee.conf |
---|
98 | |
---|
99 | binary-common: |
---|
100 | dh_testdir |
---|
101 | dh_testroot |
---|
102 | |
---|
103 | dh_installchangelogs doc/CHANGES |
---|
104 | dh_installexamples |
---|
105 | dh_installdocs #--link-doc=bitlbee-common |
---|
106 | # TODO: Restore --link-doc up here and remove the hack below once |
---|
107 | # Hardy and Lenny are deprecated. |
---|
108 | 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 |
---|
109 | dh_installdebconf |
---|
110 | dh_installinit --init-script=bitlbee |
---|
111 | dh_installman |
---|
112 | dh_lintian |
---|
113 | dh_strip |
---|
114 | dh_link |
---|
115 | dh_compress |
---|
116 | dh_fixperms |
---|
117 | dh_installdeb |
---|
118 | dh_shlibdeps |
---|
119 | dh_gencontrol |
---|
120 | dh_md5sums |
---|
121 | dh_builddeb |
---|
122 | |
---|
123 | binary-indep: build install |
---|
124 | DH_OPTIONS=-i $(MAKE) -f debian/rules binary-common |
---|
125 | |
---|
126 | binary-arch: build install |
---|
127 | DH_OPTIONS=-a $(MAKE) -f debian/rules binary-common |
---|
128 | |
---|
129 | binary-%: build install |
---|
130 | DH_OPTIONS=-p$* $(MAKE) -f debian/rules binary-common |
---|
131 | |
---|
132 | binary: binary-indep binary-arch |
---|
133 | .PHONY: build clean binary-indep binary-arch binary-common binary install |
---|