source: debian/rules @ d20ea9f

Last change on this file since d20ea9f was d20ea9f, checked in by Wilmer van der Gaast <wilmer@…>, at 2010-08-17T10:39:21Z

Debian change: set BITLBEE_LIBPURPLE=0 to only build the native variant.

  • Property mode set to 100755
File size: 3.3 KB
RevLine 
[19a8088]1#!/usr/bin/make -f
[095a5f0]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#
[19a8088]9
[d20ea9f]10# Include the bitlbee-libpurple variant by default
11BITLBEE_LIBPURPLE ?= 1
[b5b40ff]12BITLBEE_CONFIGURE_FLAGS ?=
[19a8088]13DEBUG ?= 0
14
[4c03881]15ifndef BITLBEE_VERSION
[19a8088]16# Want to use the full package version number instead of just the release.
[095a5f0]17BITLBEE_CONFIGURE_VERSION ?= BITLBEE_VERSION=\"$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}')\"
[379c08a]18endif
[19a8088]19
[095a5f0]20build: build-stamp
21build-stamp:
22        dh_testdir
[19a8088]23
[4772500]24        mkdir -p debian/build-native
[095a5f0]25        ROOT=$$PWD; cd debian/build-native; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --events=libevent $(BITLBEE_CONFIGURE_FLAGS)
26        $(MAKE) -C debian/build-native
[19a8088]27
[d20ea9f]28ifeq ($(BITLBEE_LIBPURPLE),1)
[4772500]29        mkdir -p debian/build-libpurple
[095a5f0]30        ROOT=$$PWD; cd debian/build-libpurple; $(BITLBEE_CONFIGURE_VERSION) $$ROOT/configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee --purple=1 $(BITLBEE_CONFIGURE_FLAGS)
31        $(MAKE) -C debian/build-libpurple
[d20ea9f]32endif
[19a8088]33
[bc49ec2]34        $(MAKE) -C doc
35
[095a5f0]36        touch build-stamp
[46d4230]37
[095a5f0]38clean:
39        dh_testdir
40        dh_testroot
41        rm -f build-stamp
[46d4230]42
[095a5f0]43        rm -rf build-arch-stamp debian/build-*
44        $(MAKE) distclean
[46d4230]45
[095a5f0]46        dh_clean
47
48install: build
49        dh_testdir
50        dh_testroot
[560d0a0]51        dh_clean -k
[095a5f0]52        dh_installdirs
53
54        $(MAKE) -C debian/build-native install install-etc DESTDIR=`pwd`/debian/bitlbee
55        $(MAKE) -C debian/build-native install-dev DESTDIR=`pwd`/debian/bitlbee-dev
56        patch debian/bitlbee/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff
[d20ea9f]57
58ifeq ($(BITLBEE_LIBPURPLE),1)
59        $(MAKE) -C debian/build-libpurple install install-etc DESTDIR=`pwd`/debian/bitlbee-libpurple
[095a5f0]60        patch debian/bitlbee-libpurple/etc/bitlbee/bitlbee.conf debian/patches/bitlbee.conf.diff
[d20ea9f]61endif
[095a5f0]62
63        mkdir -p debian/bitlbee-common/usr
64        mv debian/bitlbee/usr/share debian/bitlbee-common/usr
65        rm -rf debian/bitlbee-libpurple/usr/share
66
67binary-common:
68        dh_testdir
69        dh_testroot
70
[4772500]71        dh_installchangelogs doc/CHANGES
[095a5f0]72        dh_installexamples
[560d0a0]73        dh_installdocs #--link-doc=bitlbee-common
74        # TODO: Restore --link-doc up here and remove the hack below once
75        # Hardy and Lenny are deprecated.
[d20ea9f]76        for p in bitlbee bitlbee-libpurple bitlbee-dev; do rm -r debian/$$p/usr/share/doc/$$p && ln -s bitlbee-common debian/$$p/usr/share/doc/$$p; done
[095a5f0]77        dh_installdebconf
78        dh_installinit
[d20ea9f]79ifeq ($(BITLBEE_LIBPURPLE)$(DH_OPTIONS),1-a)
[4c03881]80        cp -a debian/bitlbee/etc debian/bitlbee-libpurple
81endif
[095a5f0]82        dh_installman
83        dh_strip
84        dh_link
85        dh_compress
86        dh_fixperms
87        dh_installdeb
[d20ea9f]88ifeq ($(BITLBEE_LIBPURPLE)$(DH_OPTIONS),1-a)
[bc49ec2]89        cp -a debian/bitlbee/DEBIAN/post* debian/bitlbee/DEBIAN/pre* debian/bitlbee-libpurple/DEBIAN
[4c03881]90endif
[095a5f0]91        dh_shlibdeps
[4c03881]92ifdef BITLBEE_VERSION
[4772500]93        dh_gencontrol -- -v1:$(BITLBEE_VERSION)-0  -Vbee:Version=1:$(BITLBEE_VERSION)-0
[095a5f0]94else
[8f984a0]95        dh_gencontrol -- -Vbee:Version=$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}' | sed -e 's/+b[0-9]\+$$//')
[095a5f0]96endif
97        dh_md5sums
[d20ea9f]98ifeq ($(BITLBEE_LIBPURPLE),1)
[095a5f0]99        dh_builddeb
[d20ea9f]100else
101        dh_builddeb -Nbitlbee-libpurple
102endif
[46d4230]103
[095a5f0]104binary-indep: build install
105        $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
[46d4230]106
[095a5f0]107binary-arch: build install
108        $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
[19a8088]109
[095a5f0]110binary-%: build install
111        make -f debian/rules binary-common DH_OPTIONS=-p$*
[19a8088]112
[095a5f0]113binary: binary-indep binary-arch
114.PHONY: build clean binary-indep binary-arch binary-common binary install
Note: See TracBrowser for help on using the repository browser.