rules 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #! /usr/bin/make -f
  2. #
  3. # debian/rules
  4. # Part of Debian ‘xkcdpass’ package.
  5. #
  6. # Copyright © 2010–2016 Ben Finney <bignose@debian.org>
  7. # This is free software; you may copy, modify and/or distribute this work
  8. # under the terms of the BSD 3-clause license.
  9. # No warranty expressed or implied.
  10. # See the file ‘LICENSE.BSD’ for details.
  11. DOCUMENTATION_DIR = debian
  12. MANPAGE_SUFFIX = .1
  13. TEMPFILE_SUFFIX = .tmp
  14. manpage_names = xkcdpass
  15. .INTERMEDIATE: ${DOCUMENTATION_DIR}/*${MANPAGE_SUFFIX}${TEMPFILE_SUFFIX}
  16. manpage_paths = $(addprefix ${DOCUMENTATION_DIR}/,${manpage_names})
  17. manpages = $(addsuffix ${MANPAGE_SUFFIX},${manpage_paths})
  18. GENERATED_FILES += ${DOCUMENTATION_DIR}/*${MANPAGE_SUFFIX}
  19. MAIN_PYTHON_PACKAGE = xkcdpass
  20. export PYBUILD_NAME = ${MAIN_PYTHON_PACKAGE}
  21. # Send HTTP traffic to the “discard” service during packaging actions.
  22. export http_proxy = http://127.0.1.1:9/
  23. export https_proxy = ${http_proxy}
  24. RST_SUFFIX = .txt
  25. RST2MAN = rst2man
  26. %:
  27. dh $@ --with bash-completion,python3 --buildsystem=pybuild
  28. .PHONY: override_dh_auto_build
  29. override_dh_auto_build: ${manpages}
  30. %.1: %.1${RST_SUFFIX}
  31. $(RST2MAN) $< > $@${TEMPFILE_SUFFIX}
  32. cat debian/manpage_encoding_declaration.UTF-8 $@${TEMPFILE_SUFFIX} > $@
  33. .PHONY: override_dh_auto_clean
  34. override_dh_auto_clean:
  35. dh_auto_clean
  36. $(RM) -r ${GENERATED_FILES}
  37. .PHONY: get-packaged-orig-source
  38. get-packaged-orig-source:
  39. $(uscan-download-source) --download-current-version
  40. # Policy §4.9 strongly recommends the ‘get-orig-source’ target:
  41. # “This target is optional, but providing it if possible is a good idea.”
  42. #
  43. # This target is an anomaly: per Policy §4.9, it fetches the *latest*
  44. # upstream source, regardless of this package's version. To fetch the
  45. # upstream source corresponding to this package's *declared* version
  46. # in ‘debian/changelog’, use ‘get-packaged-orig-source’ instead.
  47. .PHONY: get-orig-source
  48. get-orig-source:
  49. $(uscan-download-source)
  50. get-orig-source get-packaged-orig-source: http_proxy =
  51. get-orig-source get-packaged-orig-source: makefile_dir = $(abspath $(dir $(firstword ${MAKEFILE_LIST})))
  52. get-orig-source get-packaged-orig-source: package_dir = $(abspath $(dir ${makefile_dir}))
  53. define uscan-download-source
  54. uscan --noconf --verbose \
  55. --force-download \
  56. --rename \
  57. --destdir=$(CURDIR) \
  58. --check-dirname-level=0 ${package_dir}
  59. endef # uscan-download-source
  60. # Local variables:
  61. # coding: utf-8
  62. # mode: makefile
  63. # End:
  64. # vim: fileencoding=utf-8 filetype=make :