source: debian/rules @ 57da960

Last change on this file since 57da960 was 57da960, checked in by Wilmer van der Gaast <wilmer@…>, at 2011-12-10T22:43:10Z

Skype module packaging.

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