source: debian/rules @ fc5cf88

Last change on this file since fc5cf88 was cbaac62, checked in by Wilmer van der Gaast <wilmer@…>, at 2007-07-14T17:20:18Z

Adding an epoch to "spoofed" version numbers to make sure apt doesn't
stick with distro packages.

  • Property mode set to 100755
File size: 3.3 KB
Line 
1#!/usr/bin/make -f
2
3DEBUG ?= 0
4
5# Want to use the full package version number instead of just the release.
6BITLBEE_VERSION ?= "$(shell dpkg-parsechangelog | grep ^Version: | awk '{print $$2}')"
7export BITLBEE_VERSION
8
9
10build-arch: build-arch-stamp
11build-arch-stamp:
12        if [ ! -d debian ]; then exit 1; fi
13        ./configure --debug=$(DEBUG) --prefix=/usr --etcdir=/etc/bitlbee $(DEB_BUILD_OPTIONS)
14        $(MAKE)
15#       $(MAKE) -C doc/ all
16        touch build-arch-stamp
17
18clean:
19        if [ "`whoami`" != "root" -o ! -d debian ]; then exit 1; fi
20        rm -rf build-arch-stamp debian/bitlbee debian/*.substvars debian/files
21        -$(MAKE) distclean
22#       -$(MAKE) -C doc/ clean
23                               
24
25install-arch: build-arch
26        if [ "`whoami`" != "root" -o ! -d debian ]; then exit 1; fi
27        mkdir -p debian/bitlbee/DEBIAN/
28        $(MAKE) install install-etc DESTDIR=`pwd`/debian/bitlbee
29
30        mkdir -p debian/bitlbee/usr/share/doc/bitlbee/
31        cp doc/user-guide/user-guide.txt debian/bitlbee/usr/share/doc/bitlbee/
32        cp doc/user-guide/user-guide.html debian/bitlbee/usr/share/doc/bitlbee/
33
34binary-arch: build-arch install-arch
35        if [ "`whoami`" != "root" -o ! -d debian ]; then exit 1; fi
36
37        chmod 755 debian/post* debian/pre* debian/config debian/bitlbee.init
38
39        mkdir -p debian/bitlbee/usr/share/doc/bitlbee/examples/ debian/bitlbee/etc/init.d/
40        -cp doc/RELEASE-SPEECH* debian/bitlbee/usr/share/doc/bitlbee/ && gzip -9 debian/bitlbee/usr/share/doc/bitlbee/RELEASE-SPEECH*
41        cp doc/CREDITS doc/AUTHORS doc/README doc/FAQ debian/README.Debian debian/bitlbee/usr/share/doc/bitlbee/
42        cp debian/changelog debian/bitlbee/usr/share/doc/bitlbee/changelog.Debian
43        cp debian/copyright debian/bitlbee/usr/share/doc/bitlbee/copyright
44        cp doc/CHANGES debian/bitlbee/usr/share/doc/bitlbee/changelog
45        cp utils/* debian/bitlbee/usr/share/doc/bitlbee/examples/
46        cp debian/bitlbee.init debian/bitlbee/etc/init.d/bitlbee
47        cd debian/bitlbee/usr/share/; \
48                gzip -9 doc/bitlbee/changelog.Debian doc/bitlbee/changelog doc/bitlbee/user-guide.txt \
49                        doc/bitlbee/examples/* man/man8/bitlbee.8 man/man5/bitlbee.conf.5
50       
51        chown -R root.root debian/bitlbee/
52        find debian/bitlbee/usr/share/ -type d -exec chmod 755 {} \;
53        find debian/bitlbee/usr/share/ -type f -exec chmod 644 {} \;
54       
55        cp debian/prerm debian/bitlbee/DEBIAN/
56        cp debian/postinst debian/bitlbee/DEBIAN/
57        cp debian/postrm debian/bitlbee/DEBIAN/
58        cp debian/config debian/bitlbee/DEBIAN/
59
60        po2debconf debian/templates > debian/bitlbee/DEBIAN/templates
61        cp debian/conffiles debian/bitlbee/DEBIAN/
62       
63        if [ "$(DEBUG)" = "0" ]; then strip -R .comment -R .note debian/bitlbee/usr/sbin/bitlbee; fi
64
65        cd debian/bitlbee; \
66                find usr -type f -exec md5sum {} \; > DEBIAN/md5sums
67        dpkg-shlibdeps -Tdebian/bitlbee.substvars -dDepends debian/bitlbee/usr/sbin/bitlbee
68ifdef BITLBEE_VERSION
69        dpkg-gencontrol -ldebian/changelog -isp -pbitlbee -Tdebian/bitlbee.substvars -Pdebian/bitlbee -v1:$(BITLBEE_VERSION)-0 -V'debconf-depends=debconf (>= 1.2.0) | debconf-2.0'
70else
71        dpkg-gencontrol -ldebian/changelog -isp -pbitlbee -Tdebian/bitlbee.substvars -Pdebian/bitlbee -V'debconf-depends=debconf (>= 1.2.0) | debconf-2.0'
72endif
73
74        dpkg --build debian/bitlbee ..
75
76debug-build:
77        BITLBEE_VERSION=\"`date +%Y%m%d`-`hostname`-debug\" debian/rules clean binary DEBUG=1
78
79binary: binary-arch
80build: build-arch
81install: install-arch
82
83.PHONY: build-arch build clean binary-arch binary install-arch install
Note: See TracBrowser for help on using the repository browser.