source: debian/rules @ 6e9ae72

Last change on this file since 6e9ae72 was e46db53, checked in by Wilmer van der Gaast <wilmer@…>, at 2011-12-11T12:12:24Z

Another packaging fix: Don't put skyped manpage in bitlbee-common.

  • Property mode set to 100755
File size: 3.8 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
77        mkdir -p debian/skyped/usr/share/man/man1
78        mv debian/bitlbee-common/usr/share/man/man1/skyped* debian/skyped/usr/share/man/man1
79
80ifeq ($(BITLBEE_LIBPURPLE),1)
81        $(MAKE) -C debian/build-libpurple install-bin DESTDIR=`pwd`/debian/bitlbee-libpurple
82        ln -sf debian/bitlbee.prerm debian/bitlbee-libpurple.prerm
83endif
84
85        patch debian/bitlbee-common/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff
86        chmod 640 debian/bitlbee-common/etc/bitlbee/bitlbee.conf
87
88binary-common:
89        dh_testdir
90        dh_testroot
91
92        dh_installchangelogs doc/CHANGES
93        dh_installexamples
94        dh_installdocs #--link-doc=bitlbee-common
95        # TODO: Restore --link-doc up here and remove the hack below once
96        # Hardy and Lenny are deprecated.
97        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
98        dh_installdebconf
99        dh_installinit --init-script=bitlbee
100        dh_installman
101        dh_lintian
102        dh_strip
103        dh_link
104        dh_compress
105        dh_fixperms
106        dh_installdeb
107        dh_shlibdeps
108ifdef BITLBEE_VERSION
109        dh_gencontrol -- -v$(BITLBEE_VERSION)  -Vbee:Version=$(BITLBEE_VERSION)
110else
111        dh_gencontrol -- -Vbee:Version=$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}' | sed -e 's/+b[0-9]\+$$//')
112endif
113        dh_md5sums
114        dh_builddeb
115
116binary-indep: build install
117        DH_OPTIONS=-i $(MAKE) -f debian/rules binary-common
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-indep binary-arch
126.PHONY: build clean binary-indep binary-arch binary-common binary install
Note: See TracBrowser for help on using the repository browser.