source: debian/rules @ 79b5c41

Last change on this file since 79b5c41 was 27b407f, checked in by Wilmer van der Gaast <wilmer@…>, at 2010-10-09T18:28:33Z

Added Debian packaging for OTR plugin. It's built by default but this can
be disabled by setting BITLBEE_OTR to 0 (or 1 to compile it into the binary).

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