source: debian/rules @ b7d3cc34

0.99
Last change on this file since b7d3cc34 was b7d3cc34, checked in by Wilmer van der Gaast <wilmer@…>, at 2005-11-06T18:23:18Z

Initial repository (0.99 release tree)

  • Property mode set to 100755
File size: 3.9 KB
Line 
1#!/usr/bin/make -f
2
3DEBUG ?= 0
4
5ifeq (,$(wildcard /usr/bin/po2debconf))
6PO2DEBCONF := no
7MINDEBCONFVER := 0.5
8else
9PO2DEBCONF := yes
10MINDEBCONFVER := 1.2.0
11endif
12
13
14build-arch: build-arch-stamp
15build-arch-stamp:
16        if [ ! -d debian ]; then exit 1; fi
17        ./configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee $(DEB_BUILD_OPTIONS)
18        $(MAKE)
19#       $(MAKE) -C doc/ all
20        touch build-arch-stamp
21
22clean:
23        if [ "`whoami`" != "root" -o ! -d debian ]; then exit 1; fi
24        rm -rf build-arch-stamp debian/bitlbee debian/*.substvars debian/files
25        -$(MAKE) distclean
26#       -$(MAKE) -C doc/ clean
27ifeq ($(PO2DEBCONF),yes)
28        # Hack for woody compatibility. This makes sure that the
29        # debian/templates file shipped in the source package doesn't
30        # specify encodings, which woody's debconf can't handle. If building
31        # on a system with po-debconf installed (conveniently debhelper (>=
32        # 4.1.16) depends on it), the binary-arch target will generate a
33        # better version for sarge.
34        echo 1 > debian/po/output
35        po2debconf debian/bitlbee.templates.master > debian/bitlbee.templates
36        rm -f debian/po/output
37endif
38                               
39
40install-arch: build-arch
41        if [ "`whoami`" != "root" -o ! -d debian ]; then exit 1; fi
42        mkdir -p debian/bitlbee/DEBIAN/
43        $(MAKE) install install-etc DESTDIR=`pwd`/debian/bitlbee
44
45        mkdir -p debian/bitlbee/usr/share/doc/bitlbee/
46        cp doc/user-guide/user-guide.txt debian/bitlbee/usr/share/doc/bitlbee/
47        cp doc/user-guide/user-guide.html debian/bitlbee/usr/share/doc/bitlbee/
48
49binary-arch: build-arch install-arch
50        if [ "`whoami`" != "root" -o ! -d debian ]; then exit 1; fi
51
52        chmod 755 debian/bitlbee.p* debian/bitlbee.config
53
54        mkdir -p debian/bitlbee/usr/share/doc/bitlbee/examples/
55        -cp doc/RELEASE-SPEECH* debian/bitlbee/usr/share/doc/bitlbee/ && gzip -9 debian/bitlbee/usr/share/doc/bitlbee/RELEASE-SPEECH*
56        cp doc/CREDITS doc/AUTHORS doc/TODO doc/README doc/FAQ debian/README.Debian debian/bitlbee/usr/share/doc/bitlbee/
57        cp debian/changelog debian/bitlbee/usr/share/doc/bitlbee/changelog.Debian
58        cp debian/copyright debian/bitlbee/usr/share/doc/bitlbee/copyright
59        cp doc/CHANGES debian/bitlbee/usr/share/doc/bitlbee/changelog
60        cp utils/* debian/bitlbee/usr/share/doc/bitlbee/examples/
61        cp debian/motd.txt debian/bitlbee/etc/bitlbee/
62        cd debian/bitlbee/usr/share/; \
63                gzip -9 doc/bitlbee/changelog.Debian doc/bitlbee/changelog doc/bitlbee/user-guide.txt \
64                        doc/bitlbee/examples/* man/man8/bitlbee.8 man/man5/bitlbee.conf.5
65       
66        chown -R root.root debian/bitlbee/
67        find debian/bitlbee/usr/share/ -type d -exec chmod 755 {} \;
68        find debian/bitlbee/usr/share/ -type f -exec chmod 644 {} \;
69       
70        cp debian/bitlbee.preinst debian/bitlbee/DEBIAN/preinst
71        cp debian/bitlbee.postinst debian/bitlbee/DEBIAN/postinst
72        cp debian/bitlbee.postrm debian/bitlbee/DEBIAN/postrm
73        cp debian/bitlbee.config debian/bitlbee/DEBIAN/config
74ifeq ($(PO2DEBCONF),yes)
75        po2debconf -e utf8 debian/bitlbee.templates.master > debian/bitlbee.templates
76endif
77        cp debian/bitlbee.templates debian/bitlbee/DEBIAN/templates
78        cp debian/bitlbee.conffiles debian/bitlbee/DEBIAN/conffiles
79       
80        if [ "$(DEBUG)" = "0" ]; then strip -R .comment -R .note debian/bitlbee/usr/sbin/bitlbee; fi
81
82        cd debian/bitlbee; \
83                find usr -type f -exec md5sum {} \; > DEBIAN/md5sums
84        dpkg-shlibdeps -Tdebian/bitlbee.substvars -dDepends debian/bitlbee/usr/sbin/bitlbee
85ifdef BITLBEE_VERSION
86        dpkg-gencontrol -ldebian/changelog -isp -pbitlbee -Tdebian/bitlbee.substvars -Pdebian/bitlbee -v$(BITLBEE_VERSION)-0 -V'debconf-depends=debconf (>= $(MINDEBCONFVER)) | debconf-2.0'
87else
88        dpkg-gencontrol -ldebian/changelog -isp -pbitlbee -Tdebian/bitlbee.substvars -Pdebian/bitlbee -V'debconf-depends=debconf (>= $(MINDEBCONFVER)) | debconf-2.0'
89endif
90
91        dpkg --build debian/bitlbee ..
92
93debug-build:
94        BITLBEE_VERSION=\"`date +%Y%m%d`-`hostname`-debug\" debian/rules clean binary DEBUG=1
95
96binary: binary-arch
97build: build-arch
98install: install-arch
99
100.PHONY: build-arch build clean binary-arch binary install-arch install
Note: See TracBrowser for help on using the repository browser.