source: debian/rules @ b5fb903

Last change on this file since b5fb903 was b5fb903, checked in by dequis <dx@…>, at 2017-01-27T00:46:49Z

debian: Merge changes from 3.4.2-1.1 NMU into 3.5-1

Because apparently not having build-arch is now a build failure, even
though lintian only considered it a warning and a "recommended" target

  • Property mode set to 100755
File size: 4.4 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# https://bugs.debian.org/821967
44build-indep: binary-indep
45build-arch: binary-arch
46
47build: build-stamp
48build-stamp:
49        dh_testdir
50
51        mkdir -p debian/build-native
52        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)
53        $(MAKE) -C debian/build-native
54
55ifeq ($(BITLBEE_LIBPURPLE),1)
56        mkdir -p debian/build-libpurple
57        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)
58        $(MAKE) -C debian/build-libpurple
59endif
60
61        $(MAKE) -C doc
62        $(MAKE) -C doc/user-guide
63
64        touch build-stamp
65
66clean:
67        dh_testdir
68        dh_testroot
69        rm -f build-stamp
70
71        rm -rf build-arch-stamp debian/build-* debian/bitlbee-libpurple.prerm
72        $(MAKE) distclean
73
74        dh_clean
75
76install: build
77        dh_testdir
78        dh_testroot
79        dh_prep
80        dh_installdirs
81
82        $(MAKE) -C debian/build-native install-bin DESTDIR=`pwd`/debian/bitlbee
83        $(MAKE) -C debian/build-native install-etc install-doc DESTDIR=`pwd`/debian/bitlbee-common
84        $(MAKE) -C debian/build-native install-dev DESTDIR=`pwd`/debian/bitlbee-dev
85        $(MAKE) -C debian/build-native install-plugin-otr DESTDIR=`pwd`/debian/bitlbee-plugin-otr
86        $(MAKE) -C debian/build-native install-plugin-skype DESTDIR=`pwd`/debian/skyped
87
88ifeq ($(HAS_DH_SYSTEMD),1)
89        $(MAKE) -C debian/build-native install-systemd DESTDIR=`pwd`/debian/bitlbee-common
90endif
91
92ifneq ($(BITLBEE_SKYPE),0)
93        mkdir -p debian/bitlbee-plugin-skype/usr
94        mv debian/skyped/usr/lib debian/bitlbee-plugin-skype/usr
95
96        mkdir -p debian/skyped/usr/share/man/man1
97        mv debian/bitlbee-common/usr/share/man/man1/skyped* debian/skyped/usr/share/man/man1
98endif
99
100ifeq ($(BITLBEE_LIBPURPLE),1)
101        $(MAKE) -C debian/build-libpurple install-bin DESTDIR=`pwd`/debian/bitlbee-libpurple
102        ln -sf debian/bitlbee.prerm debian/bitlbee-libpurple.prerm
103endif
104
105        patch debian/bitlbee-common/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff
106        chmod 640 debian/bitlbee-common/etc/bitlbee/bitlbee.conf
107
108binary-common:
109        dh_testdir
110        dh_testroot
111
112        dh_installchangelogs doc/CHANGES
113        dh_installexamples
114        dh_installdocs #--link-doc=bitlbee-common
115        # TODO: Restore --link-doc up here and remove the hack below once
116        # Hardy and Lenny are deprecated.
117        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
118        dh_installdebconf
119ifeq ($(HAS_DH_SYSTEMD),1)
120        dh_systemd_enable
121        dh_installinit --init-script=bitlbee
122        dh_systemd_start
123else
124        dh_installinit --init-script=bitlbee
125endif
126        dh_installman
127        dh_lintian
128        dh_strip
129        dh_link
130        dh_compress
131        dh_fixperms
132        dh_installdeb
133        dh_shlibdeps
134        dh_gencontrol
135        dh_md5sums
136        dh_builddeb
137
138binary-indep: build install
139        DH_OPTIONS=-i $(MAKE) -f debian/rules binary-common
140
141binary-arch: build install
142        DH_OPTIONS=-a $(MAKE) -f debian/rules binary-common
143
144binary-%: build install
145        DH_OPTIONS=-p$* $(MAKE) -f debian/rules binary-common
146
147binary: binary-indep binary-arch
148.PHONY: build clean binary-indep binary-arch binary-common binary install
Note: See TracBrowser for help on using the repository browser.