[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: |
---|
[46d4230] | 15 | [ -d debian ] |
---|
[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: |
---|
[46d4230] | 22 | [ "`whoami`" = "root" -a -d debian ] |
---|
| 23 | rm -rf build-arch-stamp debian/bitlbee debian/*.substvars debian/files debian/bitlbee-dev |
---|
[e565ce2] | 24 | $(MAKE) distclean |
---|
[19a8088] | 25 | # -$(MAKE) -C doc/ clean |
---|
| 26 | |
---|
| 27 | |
---|
| 28 | install-arch: build-arch |
---|
[46d4230] | 29 | [ "`whoami`" = "root" -a -d debian ] |
---|
[19a8088] | 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 | |
---|
[46d4230] | 37 | install-indep: install-arch |
---|
| 38 | [ "`whoami`" = "root" -a -d debian ] |
---|
| 39 | mkdir -p debian/bitlbee-dev/DEBIAN/ |
---|
| 40 | $(MAKE) install-dev DESTDIR=`pwd`/debian/bitlbee-dev |
---|
| 41 | |
---|
| 42 | mkdir -p debian/bitlbee-dev/usr/share/doc/bitlbee-dev/ |
---|
| 43 | |
---|
[19a8088] | 44 | binary-arch: build-arch install-arch |
---|
[46d4230] | 45 | [ "`whoami`" = "root" -a -d debian ] |
---|
[19a8088] | 46 | |
---|
| 47 | chmod 755 debian/post* debian/pre* debian/config debian/bitlbee.init |
---|
| 48 | |
---|
| 49 | mkdir -p debian/bitlbee/usr/share/doc/bitlbee/examples/ debian/bitlbee/etc/init.d/ |
---|
| 50 | -cp doc/RELEASE-SPEECH* debian/bitlbee/usr/share/doc/bitlbee/ && gzip -9 debian/bitlbee/usr/share/doc/bitlbee/RELEASE-SPEECH* |
---|
| 51 | cp doc/CREDITS doc/AUTHORS doc/README doc/FAQ debian/README.Debian debian/bitlbee/usr/share/doc/bitlbee/ |
---|
| 52 | cp debian/changelog debian/bitlbee/usr/share/doc/bitlbee/changelog.Debian |
---|
| 53 | cp debian/copyright debian/bitlbee/usr/share/doc/bitlbee/copyright |
---|
| 54 | cp doc/CHANGES debian/bitlbee/usr/share/doc/bitlbee/changelog |
---|
| 55 | cp utils/* debian/bitlbee/usr/share/doc/bitlbee/examples/ |
---|
| 56 | cp debian/bitlbee.init debian/bitlbee/etc/init.d/bitlbee |
---|
[0a4f6f4] | 57 | patch -p0 < debian/patches/bitlbee.conf.diff |
---|
[19a8088] | 58 | cd debian/bitlbee/usr/share/; \ |
---|
| 59 | gzip -9 doc/bitlbee/changelog.Debian doc/bitlbee/changelog doc/bitlbee/user-guide.txt \ |
---|
| 60 | doc/bitlbee/examples/* man/man8/bitlbee.8 man/man5/bitlbee.conf.5 |
---|
| 61 | |
---|
[46d4230] | 62 | chown -R root:root debian/bitlbee/ |
---|
[19a8088] | 63 | find debian/bitlbee/usr/share/ -type d -exec chmod 755 {} \; |
---|
| 64 | find debian/bitlbee/usr/share/ -type f -exec chmod 644 {} \; |
---|
| 65 | |
---|
| 66 | cp debian/prerm debian/bitlbee/DEBIAN/ |
---|
| 67 | cp debian/postinst debian/bitlbee/DEBIAN/ |
---|
| 68 | cp debian/postrm debian/bitlbee/DEBIAN/ |
---|
| 69 | cp debian/config debian/bitlbee/DEBIAN/ |
---|
| 70 | |
---|
| 71 | po2debconf debian/templates > debian/bitlbee/DEBIAN/templates |
---|
| 72 | cp debian/conffiles debian/bitlbee/DEBIAN/ |
---|
| 73 | |
---|
| 74 | if [ "$(DEBUG)" = "0" ]; then strip -R .comment -R .note debian/bitlbee/usr/sbin/bitlbee; fi |
---|
| 75 | |
---|
| 76 | cd debian/bitlbee; \ |
---|
| 77 | find usr -type f -exec md5sum {} \; > DEBIAN/md5sums |
---|
| 78 | dpkg-shlibdeps -Tdebian/bitlbee.substvars -dDepends debian/bitlbee/usr/sbin/bitlbee |
---|
[379c08a] | 79 | ifdef BITLBEE_FORCE_VERSION |
---|
[cbaac62] | 80 | 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] | 81 | else |
---|
| 82 | dpkg-gencontrol -ldebian/changelog -isp -pbitlbee -Tdebian/bitlbee.substvars -Pdebian/bitlbee -V'debconf-depends=debconf (>= 1.2.0) | debconf-2.0' |
---|
| 83 | endif |
---|
| 84 | |
---|
| 85 | dpkg --build debian/bitlbee .. |
---|
| 86 | |
---|
[46d4230] | 87 | binary-indep: install-indep |
---|
| 88 | [ "`whoami`" = "root" -a -d debian ] |
---|
| 89 | |
---|
| 90 | chown -R root.root debian/bitlbee-dev/ |
---|
| 91 | find debian/bitlbee-dev/usr/share/ -type d -exec chmod 755 {} \; |
---|
| 92 | find debian/bitlbee-dev/usr/share/ -type f -exec chmod 644 {} \; |
---|
| 93 | |
---|
| 94 | cp debian/changelog debian/bitlbee-dev/usr/share/doc/bitlbee-dev/changelog.Debian |
---|
| 95 | gzip -9 debian/bitlbee-dev/usr/share/doc/bitlbee-dev/changelog.Debian |
---|
| 96 | cp debian/copyright debian/bitlbee-dev/usr/share/doc/bitlbee-dev/copyright |
---|
| 97 | |
---|
| 98 | cd debian/bitlbee-dev; \ |
---|
| 99 | find usr -type f -exec md5sum {} \; > DEBIAN/md5sums |
---|
| 100 | |
---|
| 101 | dpkg-gencontrol -ldebian/changelog -isp -pbitlbee-dev -Pdebian/bitlbee-dev |
---|
| 102 | |
---|
| 103 | dpkg --build debian/bitlbee-dev .. |
---|
[19a8088] | 104 | |
---|
[46d4230] | 105 | binary: binary-arch binary-indep |
---|
[19a8088] | 106 | build: build-arch |
---|
[46d4230] | 107 | install: install-arch install-indep |
---|
[19a8088] | 108 | |
---|
[46d4230] | 109 | .PHONY: build-arch build clean binary-arch binary install-arch install binary-indep install-indep |
---|