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