source: debian/rules @ 8d7b0a4

Last change on this file since 8d7b0a4 was 8d7b0a4, checked in by dequis <dx@…>, at 2018-04-11T01:49:27Z

debian: add ${DEB_HOST_MULTIARCH} to pkgconfig install path

Fixes lintian pkg-config-unavailable-for-cross-compilation

  • Property mode set to 100755
File size: 4.3 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
37# No difference at the build stage so just call main build target.
38# (Well indep could be docs-only but we prebuild them plus it's really
39# not that much work.)
40build-arch build-indep: build
41
42build: build-stamp
43build-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) --systemdsystemunitdir=/lib/systemd/system --pcdir=/usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig $(BITLBEE_CONFIGURE_FLAGS)
48        $(MAKE) -C debian/build-native
49
50ifeq ($(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 --systemdsystemunitdir=/lib/systemd/system --pcdir=/usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig --purple=1 $(BITLBEE_CONFIGURE_FLAGS)
53        $(MAKE) -C debian/build-libpurple
54endif
55
56        $(MAKE) -C doc
57        $(MAKE) -C doc/user-guide
58
59        touch build-stamp
60
61clean:
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
71install: build
72        dh_testdir
73        dh_testroot
74        dh_prep
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
82ifeq ($(HAS_DH_SYSTEMD),1)
83        $(MAKE) -C debian/build-native install-systemd DESTDIR=`pwd`/debian/bitlbee-common
84endif
85
86ifeq ($(BITLBEE_LIBPURPLE),1)
87        $(MAKE) -C debian/build-libpurple install-bin DESTDIR=`pwd`/debian/bitlbee-libpurple
88        ln -sf debian/bitlbee.prerm debian/bitlbee-libpurple.prerm
89endif
90
91        patch debian/bitlbee-common/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff
92        chmod 640 debian/bitlbee-common/etc/bitlbee/bitlbee.conf
93
94binary-common:
95        dh_testdir
96        dh_testroot
97
98        dh_installchangelogs doc/CHANGES
99        dh_installexamples
100        dh_installdocs #--link-doc=bitlbee-common
101        # TODO: Restore --link-doc up here and remove the hack below once
102        # Hardy and Lenny are deprecated.
103        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
104        dh_installdebconf
105ifeq ($(HAS_DH_SYSTEMD),1)
106        dh_systemd_enable -p bitlbee-common --no-enable bitlbee.socket
107        dh_systemd_enable -p bitlbee-common bitlbee.service
108        dh_installinit -p bitlbee-common --init-script=bitlbee
109        dh_systemd_start -p bitlbee-common
110else
111        dh_installinit -p bitlbee-common --init-script=bitlbee
112endif
113        dh_installman
114        dh_lintian
115        dh_strip
116        dh_link
117        dh_compress
118        dh_fixperms
119        dh_installdeb
120        dh_shlibdeps
121        dh_gencontrol
122        dh_md5sums
123        dh_builddeb
124
125binary-indep: build install
126        DH_OPTIONS=-i $(MAKE) -f debian/rules binary-common
127
128binary-arch: build install
129        DH_OPTIONS=-a $(MAKE) -f debian/rules binary-common
130
131binary-%: build install
132        DH_OPTIONS=-p$* $(MAKE) -f debian/rules binary-common
133
134binary: binary-indep binary-arch
135.PHONY: build clean binary-indep binary-arch binary-common binary install
Note: See TracBrowser for help on using the repository browser.