rules 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/usr/bin/make -f
  2. DIR:=$(shell pwd)
  3. arch=$(shell dpkg --print-architecture)
  4. cidir=debian/tmp/DEBIAN
  5. build:
  6. $(checkdir)
  7. ./configure --prefix=/usr
  8. $(MAKE)
  9. touch build
  10. clean:
  11. $(checkdir)
  12. -rm -f build
  13. -$(MAKE) -i distclean || $(MAKE) -f Makefile.in -i distclean
  14. -rm -rf debian/tmp* *~ *.orig ./#*# tmp.* debian/files*
  15. -rm -f config.cache config.status config.h install config.log
  16. find -name '*~' -print0 | xargs -r0 rm --
  17. binary: checkroot build
  18. -rm -rf debian/tmp
  19. mkdir debian/tmp debian/tmp/DEBIAN
  20. install -d debian/tmp/usr/doc/{copyright,dpkg}
  21. set -e; if [ $(arch) = i386 ]; then \
  22. dpkg-gencontrol -Vlibcver=' (>= 5.2.18-2)' >$(cidir)/control ; \
  23. sed -e 's/^# i386elf: //' <debian/preinst >$(cidir)/preinst ; \
  24. else \
  25. dpkg-gencontrol -Vlibcver='' >$(cidir)/control ; \
  26. sed -e '/^# i386elf: /d' debian/preinst >$(cidir)/preinst ; \
  27. fi
  28. cp debian/{prerm,postinst} debian/tmp/DEBIAN/.
  29. chmod +x debian/tmp/DEBIAN/{postinst,prerm,preinst}
  30. $(MAKE) prefix=$(DIR)/debian/tmp/usr \
  31. datadir=$(DIR)/debian/tmp/var/lib/dpkg \
  32. etcdir=$(DIR)/debian/tmp/etc \
  33. install
  34. gzip -9 debian/tmp/usr/info/guidelines.info*
  35. cp debian/copyright debian/tmp/usr/doc/copyright/dpkg
  36. cp TODO debian/tmp/usr/doc/dpkg/WISHLIST
  37. touch debian/tmp/var/lib/dpkg/{status,available}
  38. chown -R root.root debian/tmp
  39. chmod -R g-ws debian/tmp
  40. set -e; cd debian/tmp; \
  41. version=`sed -n 's/^Version: //p' DEBIAN/control`; \
  42. file=dpkg_$${version}_$(arch).nondebbin.tar; \
  43. tar cf ../../../$${file} usr var && gzip -9vf ../../../$${file}; \
  44. cd ../..; dpkg-distaddfile $${file}.gz byhand -
  45. mv debian/tmp/usr/bin/dpkg-deb{,.dist}
  46. rm debian/tmp/var/lib/dpkg/{status,available}
  47. dpkg-deb --build debian/tmp ..
  48. define checkdir
  49. test -f include/dpkg.h
  50. endef
  51. checkroot:
  52. $(checkdir)
  53. test root = "`whoami`"
  54. .PHONY: binary source diff clean checkroot