source: debian/rules @ b1b9453

Last change on this file since b1b9453 was 53cb4ae, checked in by Wilmer van der Gaast <wilmer@…>, at 2017-01-28T22:36:26Z

More troubles because the fix from the Debian bug didn't match the fix
actually NMU'd. :-( Now this fix really should work. Third time's the
charm after all, innit.

  • Property mode set to 100755
File size: 4.5 KB
Line 
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.
13BITLBEE_LIBPURPLE ?= 1
14BITLBEE_OTR ?= plugin
15BITLBEE_SKYPE ?= 0
16BITLBEE_CONFIGURE_FLAGS ?=
17DEBUG ?= 0
18
19ifndef BITLBEE_VERSION
20# Want to use the full package version number instead of just the release.
21BITLBEE_CONFIGURE_VERSION ?= BITLBEE_VERSION="$(shell dpkg-parsechangelog | awk '/^Version:/ {print $$2}')"
22endif
23
24ifneq ($(BITLBEE_LIBPURPLE),1)
25DH_OPTIONS += -Nbitlbee-libpurple
26endif
27
28ifneq ($(BITLBEE_OTR),plugin)
29DH_OPTIONS += -Nbitlbee-plugin-otr
30endif
31
32ifneq ($(BITLBEE_SKYPE),plugin)
33DH_OPTIONS += -Nbitlbee-plugin-skype -Nskyped
34endif
35
36CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
37CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
38LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
39
40CONFIGURE_OVERRIDES:=CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
41
42HAS_DH_SYSTEMD:=$(shell dpkg-query -W -f='$${Status}' dh-systemd 2>/dev/null | grep -c "ok installed")
43
44# No difference at the build stage so just call main build target.
45# (Well indep could be docs-only but we prebuild them plus it's really
46# not that much work.)
47build-arch build-indep: build
48
49build: build-stamp
50build-stamp:
51        dh_testdir
52
53        mkdir -p debian/build-native
54        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)
55        $(MAKE) -C debian/build-native
56
57ifeq ($(BITLBEE_LIBPURPLE),1)
58        mkdir -p debian/build-libpurple
59        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)
60        $(MAKE) -C debian/build-libpurple
61endif
62
63        $(MAKE) -C doc
64        $(MAKE) -C doc/user-guide
65
66        touch build-stamp
67
68clean:
69        dh_testdir
70        dh_testroot
71        rm -f build-stamp
72
73        rm -rf build-arch-stamp debian/build-* debian/bitlbee-libpurple.prerm
74        $(MAKE) distclean
75
76        dh_clean
77
78install: build
79        dh_testdir
80        dh_testroot
81        dh_prep
82        dh_installdirs
83
84        $(MAKE) -C debian/build-native install-bin DESTDIR=`pwd`/debian/bitlbee
85        $(MAKE) -C debian/build-native install-etc install-doc DESTDIR=`pwd`/debian/bitlbee-common
86        $(MAKE) -C debian/build-native install-dev DESTDIR=`pwd`/debian/bitlbee-dev
87        $(MAKE) -C debian/build-native install-plugin-otr DESTDIR=`pwd`/debian/bitlbee-plugin-otr
88        $(MAKE) -C debian/build-native install-plugin-skype DESTDIR=`pwd`/debian/skyped
89
90ifeq ($(HAS_DH_SYSTEMD),1)
91        $(MAKE) -C debian/build-native install-systemd DESTDIR=`pwd`/debian/bitlbee-common
92endif
93
94ifneq ($(BITLBEE_SKYPE),0)
95        mkdir -p debian/bitlbee-plugin-skype/usr
96        mv debian/skyped/usr/lib debian/bitlbee-plugin-skype/usr
97
98        mkdir -p debian/skyped/usr/share/man/man1
99        mv debian/bitlbee-common/usr/share/man/man1/skyped* debian/skyped/usr/share/man/man1
100endif
101
102ifeq ($(BITLBEE_LIBPURPLE),1)
103        $(MAKE) -C debian/build-libpurple install-bin DESTDIR=`pwd`/debian/bitlbee-libpurple
104        ln -sf debian/bitlbee.prerm debian/bitlbee-libpurple.prerm
105endif
106
107        patch debian/bitlbee-common/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff
108        chmod 640 debian/bitlbee-common/etc/bitlbee/bitlbee.conf
109
110binary-common:
111        dh_testdir
112        dh_testroot
113
114        dh_installchangelogs doc/CHANGES
115        dh_installexamples
116        dh_installdocs #--link-doc=bitlbee-common
117        # TODO: Restore --link-doc up here and remove the hack below once
118        # Hardy and Lenny are deprecated.
119        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
120        dh_installdebconf
121ifeq ($(HAS_DH_SYSTEMD),1)
122        dh_systemd_enable
123        dh_installinit --init-script=bitlbee
124        dh_systemd_start
125else
126        dh_installinit --init-script=bitlbee
127endif
128        dh_installman
129        dh_lintian
130        dh_strip
131        dh_link
132        dh_compress
133        dh_fixperms
134        dh_installdeb
135        dh_shlibdeps
136        dh_gencontrol
137        dh_md5sums
138        dh_builddeb
139
140binary-indep: build install
141        DH_OPTIONS=-i $(MAKE) -f debian/rules binary-common
142
143binary-arch: build install
144        DH_OPTIONS=-a $(MAKE) -f debian/rules binary-common
145
146binary-%: build install
147        DH_OPTIONS=-p$* $(MAKE) -f debian/rules binary-common
148
149binary: binary-indep binary-arch
150.PHONY: build clean binary-indep binary-arch binary-common binary install
Note: See TracBrowser for help on using the repository browser.