rules 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/usr/bin/make -f
  2. export DEB_BUILD_MAINT_OPTIONS = hardening=+all
  3. %:
  4. dh $@ --with autoreconf
  5. override_dh_clean:
  6. dh_clean
  7. -rm debian/bgpdump.1
  8. -rm -rf debian/tests/test_out/
  9. override_dh_auto_clean:
  10. # some extra loops for cleanup *after* build
  11. if [ -d m4 ] ; then \
  12. cp -v debian/Makefile.am debian/configure.ac . ; \
  13. fi
  14. dh_auto_clean
  15. -rm Makefile.am configure.ac
  16. override_dh_autoreconf_clean:
  17. dh_autoreconf_clean
  18. # restore upstream files
  19. for file in Makefile.in configure.in ; do \
  20. if [ -f $$file.orig ] ; then \
  21. mv -v $$file.orig $$file ; \
  22. fi ; \
  23. done
  24. override_dh_update_autotools_config:
  25. cp -v debian/Makefile.am debian/configure.ac .
  26. mkdir -p m4
  27. # move upstream files out of the way
  28. for file in Makefile.in configure.in ; do \
  29. if [ -f $$file ] && [ ! -f $$file.orig ] ; then \
  30. mv -v $$file $$file.orig ; \
  31. fi ; \
  32. done
  33. dh_update_autotools_config
  34. override_dh_auto_configure:
  35. dh_auto_configure
  36. VERSION_AC="$$(awk '($$2=="VERSION"){print $$3}' bgpdump-config.h | cut -d'"' -f2)" ; \
  37. VERSION_DEB="$$(dpkg-parsechangelog -SVersion | cut -d- -f1)" ; \
  38. if [ "$$VERSION_AC" != "$$VERSION_DEB" ] ; then \
  39. echo "Mismatch! Debian: $$VERSION_DEB, AC: $$VERSION_AC" ; \
  40. echo "Fix debian/configure.ac to match debian/changelog" ; \
  41. false ; \
  42. fi
  43. override_dh_install:
  44. dh_install
  45. # don't ship the library for the time being, see README.Debian
  46. rm -rf debian/bgpdump/usr/lib/
  47. rm -rf debian/bgpdump/usr/include/
  48. override_dh_installman:
  49. a2x --format=manpage --no-xmllint debian/bgpdump.txt
  50. dh_installman