source: debian/rules @ bc49ec2

Last change on this file since bc49ec2 was bc49ec2, checked in by Wilmer van der Gaast <wilmer@…>, at 2010-06-06T09:55:07Z

Make this build work even from fresh bzr branches. Also stop using {x,y}
stuff which somehow magically doesn't work on my laptop.

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