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