source: debian/rules @ be999a5

Last change on this file since be999a5 was 763a3ab, checked in by Wilmer van der Gaast <wilmer@…>, at 2010-08-18T10:01:10Z

Pass the -Npackage flag the right way so bitlbee-libpurple doesn't appear
in debian/files. The previous hack broke genchanges/debsign.

  • Property mode set to 100755
File size: 3.2 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 by default
11BITLBEE_LIBPURPLE ?= 1
12BITLBEE_CONFIGURE_FLAGS ?=
13DEBUG ?= 0
14
15ifndef BITLBEE_VERSION
16# Want to use the full package version number instead of just the release.
17BITLBEE_CONFIGURE_VERSION ?= BITLBEE_VERSION=\"$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}')\"
18endif
19
20ifneq ($(BITLBEE_LIBPURPLE),1)
21DH_OPTIONS += -Nbitlbee-libpurple
22endif
23
24build: build-stamp
25build-stamp:
26        dh_testdir
27
28        mkdir -p debian/build-native
29        ROOT=$$PWD; cd debian/build-native; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --events=libevent $(BITLBEE_CONFIGURE_FLAGS)
30        $(MAKE) -C debian/build-native
31
32ifeq ($(BITLBEE_LIBPURPLE),1)
33        mkdir -p debian/build-libpurple
34        ROOT=$$PWD; cd debian/build-libpurple; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --purple=1 $(BITLBEE_CONFIGURE_FLAGS)
35        $(MAKE) -C debian/build-libpurple
36endif
37
38        $(MAKE) -C doc
39
40        touch build-stamp
41
42clean:
43        dh_testdir
44        dh_testroot
45        rm -f build-stamp
46
47        rm -rf build-arch-stamp debian/build-* debian/bitlbee-libpurple.prerm
48        $(MAKE) distclean
49
50        dh_clean
51
52install: build
53        dh_testdir
54        dh_testroot
55        dh_clean -k
56        dh_installdirs
57
58        $(MAKE) -C debian/build-native install DESTDIR=`pwd`/debian/bitlbee
59        $(MAKE) -C debian/build-native install-etc DESTDIR=`pwd`/debian/bitlbee-common
60        $(MAKE) -C debian/build-native install-dev DESTDIR=`pwd`/debian/bitlbee-dev
61        patch debian/bitlbee-common/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff
62
63ifeq ($(BITLBEE_LIBPURPLE),1)
64        $(MAKE) -C debian/build-libpurple install DESTDIR=`pwd`/debian/bitlbee-libpurple
65        ln -sf debian/bitlbee.prerm debian/bitlbee-libpurple.prerm
66endif
67
68        mkdir -p debian/bitlbee-common/usr
69        mv debian/bitlbee/usr/share debian/bitlbee-common/usr
70        rm -rf debian/bitlbee-libpurple/usr/share
71
72binary-common:
73        dh_testdir
74        dh_testroot
75
76        dh_installchangelogs doc/CHANGES
77        dh_installexamples
78        dh_installdocs #--link-doc=bitlbee-common
79        # TODO: Restore --link-doc up here and remove the hack below once
80        # Hardy and Lenny are deprecated.
81        for p in bitlbee bitlbee-libpurple bitlbee-dev; do rm -r debian/$$p/usr/share/doc/$$p && ln -s bitlbee-common debian/$$p/usr/share/doc/$$p; done
82        dh_installdebconf
83        dh_installinit --init-script=bitlbee
84        dh_installman
85        dh_strip
86        dh_link
87        dh_compress
88        dh_fixperms
89        dh_installdeb
90        dh_shlibdeps
91ifdef BITLBEE_VERSION
92        dh_gencontrol -- -v1:$(BITLBEE_VERSION)-0  -Vbee:Version=1:$(BITLBEE_VERSION)-0
93else
94        dh_gencontrol -- -Vbee:Version=$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}' | sed -e 's/+b[0-9]\+$$//')
95endif
96        dh_md5sums
97        dh_builddeb
98
99binary-indep: build install
100        DH_OPTIONS=-i $(MAKE) -f debian/rules binary-common
101
102binary-arch: build install
103        DH_OPTIONS=-a $(MAKE) -f debian/rules binary-common
104
105binary-%: build install
106        DH_OPTIONS=-p$* $(MAKE) -f debian/rules binary-common
107
108binary: binary-indep binary-arch
109.PHONY: build clean binary-indep binary-arch binary-common binary install
Note: See TracBrowser for help on using the repository browser.