source: debian/rules @ b28d55a

Last change on this file since b28d55a was e979b0f, checked in by Wilmer van der Gaast <wilmer@…>, at 2019-03-02T23:20:02Z

Swap dh_installdocs and dh_installchangelogs calls or the symlinking
done by the former won't work, which upsets Lintian (missing copyright
files).

  • Property mode set to 100755
File size: 3.7 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.
11BITLBEE_LIBPURPLE ?= 1
12BITLBEE_OTR ?= plugin
13BITLBEE_CONFIGURE_FLAGS ?=
14DEBUG ?= 0
15
16ifndef BITLBEE_VERSION
17# Want to use the full package version number instead of just the release.
18BITLBEE_CONFIGURE_VERSION ?= BITLBEE_VERSION="$(shell dpkg-parsechangelog | awk '/^Version:/ {print $$2}')"
19endif
20
21ifneq ($(BITLBEE_LIBPURPLE),1)
22DH_OPTIONS += -Nbitlbee-libpurple
23endif
24
25ifneq ($(BITLBEE_OTR),plugin)
26DH_OPTIONS += -Nbitlbee-plugin-otr
27endif
28
29CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
30CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
31LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
32
33CONFIGURE_OVERRIDES:=CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
34
35HAS_DH_SYSTEMD:=$(shell dpkg-query -W -f='$${Status}' dh-systemd 2>/dev/null | grep -c "ok installed")
36
37build-arch: build
38
39build: build-stamp
40build-stamp:
41        dh_testdir
42
43        mkdir -p debian/build-native
44        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) --systemdsystemunitdir=/lib/systemd/system --pcdir=/usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig $(BITLBEE_CONFIGURE_FLAGS)
45        $(MAKE) -C debian/build-native
46
47ifeq ($(BITLBEE_LIBPURPLE),1)
48        mkdir -p debian/build-libpurple
49        ROOT=$$PWD; cd debian/build-libpurple; $(BITLBEE_CONFIGURE_VERSION) $(CONFIGURE_OVERRIDES) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --systemdsystemunitdir=/lib/systemd/system --pcdir=/usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig --purple=1 $(BITLBEE_CONFIGURE_FLAGS)
50        $(MAKE) -C debian/build-libpurple
51endif
52
53        $(MAKE) -C doc
54        $(MAKE) -C doc/user-guide
55
56        touch build-stamp
57
58clean:
59        dh_testdir
60        dh_testroot
61        rm -f build-stamp
62
63        rm -rf build-arch-stamp debian/build-* debian/bitlbee-libpurple.prerm
64        $(MAKE) distclean
65
66        dh_clean
67
68install: build
69        dh_testdir
70        dh_testroot
71        dh_prep
72        dh_installdirs
73
74        $(MAKE) -C debian/build-native install-bin DESTDIR=`pwd`/debian/bitlbee
75        $(MAKE) -C debian/build-native install-etc install-doc DESTDIR=`pwd`/debian/bitlbee-common
76        $(MAKE) -C debian/build-native install-dev DESTDIR=`pwd`/debian/bitlbee-dev
77        $(MAKE) -C debian/build-native install-plugin-otr DESTDIR=`pwd`/debian/bitlbee-plugin-otr
78
79ifeq ($(HAS_DH_SYSTEMD),1)
80        $(MAKE) -C debian/build-native install-systemd DESTDIR=`pwd`/debian/bitlbee-common
81endif
82
83ifeq ($(BITLBEE_LIBPURPLE),1)
84        $(MAKE) -C debian/build-libpurple install-bin DESTDIR=`pwd`/debian/bitlbee-libpurple
85        ln -sf debian/bitlbee.prerm debian/bitlbee-libpurple.prerm
86endif
87
88        patch debian/bitlbee-common/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff
89        chmod 640 debian/bitlbee-common/etc/bitlbee/bitlbee.conf
90
91binary-common:
92        dh_testdir
93        dh_testroot
94
95        dh_installexamples
96        dh_installdocs --link-doc=bitlbee-common
97        dh_installchangelogs doc/CHANGES
98        dh_installdebconf
99ifeq ($(HAS_DH_SYSTEMD),1)
100        dh_systemd_enable -p bitlbee-common --no-enable bitlbee.socket
101        dh_systemd_enable -p bitlbee-common bitlbee.service
102        dh_installinit -p bitlbee-common --init-script=bitlbee
103        dh_systemd_start -p bitlbee-common
104else
105        dh_installinit -p bitlbee-common --init-script=bitlbee
106endif
107        dh_installman
108        dh_lintian
109        dh_strip
110        dh_link
111        dh_compress
112        dh_fixperms
113        dh_installdeb
114        dh_shlibdeps
115        dh_gencontrol
116        dh_md5sums
117        dh_builddeb
118
119binary-arch: build install
120        DH_OPTIONS=-a $(MAKE) -f debian/rules binary-common
121
122binary-%: build install
123        DH_OPTIONS=-p$* $(MAKE) -f debian/rules binary-common
124
125binary: binary-arch
126.PHONY: build clean binary-arch binary-common binary install
Note: See TracBrowser for help on using the repository browser.