source: debian/rules @ 0c57277

Last change on this file since 0c57277 was d203495, checked in by Jelmer Vernooij <jelmer@…>, at 2014-07-19T23:55:24Z

Allow LDFLAGS to be provided in the environment and consistently use $(LDFLAGS)
when linking (not partially linking).

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