rules 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #! /usr/bin/make -f
  2. # debian/rules
  3. # Part of Debian ‘python-lockfile’ package.
  4. #
  5. # Copyright © 2009–2016 Ben Finney <bignose@debian.org>
  6. # This is free software; you may copy, modify, and/or distribute this work
  7. # under the terms of the Expat license as published by James Clark.
  8. # No warranty expressed or implied.
  9. export PYBUILD_NAME = lockfile
  10. export PYBUILD_TEST_NOSE = 1
  11. DOC_SRC_DIR = doc/source
  12. DOC_HTML_DIR = doc/html
  13. GENERATED_FILES += ${DOC_HTML_DIR}
  14. # Send HTTP traffic to the “discard” service during packaging actions.
  15. export http_proxy = http://127.0.1.1:9/
  16. export https_proxy = ${http_proxy}
  17. SPHINX = sphinx-build
  18. SPHINX_OPTS = -N
  19. %:
  20. dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild
  21. .PHONY: get-packaged-orig-source
  22. get-packaged-orig-source:
  23. $(uscan-download-source) --download-current-version
  24. # Policy §4.9 strongly recommends the ‘get-orig-source’ target:
  25. # “This target is optional, but providing it if possible is a good idea.”
  26. #
  27. # This target is an anomaly: per Policy §4.9, it fetches the *latest*
  28. # upstream source, regardless of this package's version. To fetch the
  29. # upstream source corresponding to this package's *declared* version
  30. # in ‘debian/changelog’, use ‘get-packaged-orig-source’ instead.
  31. .PHONY: get-orig-source
  32. get-orig-source:
  33. $(uscan-download-source)
  34. get-orig-source get-packaged-orig-source: http_proxy =
  35. get-orig-source get-packaged-orig-source: makefile_dir = $(abspath $(dir $(firstword ${MAKEFILE_LIST})))
  36. get-orig-source get-packaged-orig-source: package_dir = $(abspath $(dir ${makefile_dir}))
  37. define uscan-download-source
  38. uscan --noconf --verbose \
  39. --force-download \
  40. --rename \
  41. --destdir=$(CURDIR) \
  42. --check-dirname-level=0 ${package_dir}
  43. endef # uscan-download-source
  44. .PHONY: override_dh_auto_clean
  45. override_dh_auto_clean:
  46. $(RM) -r ${GENERATED_FILES}
  47. dh_auto_clean
  48. .PHONY: override_dh_auto_build
  49. override_dh_auto_build:
  50. dh_auto_build
  51. $(SPHINX) ${SPHINX_OPTS} -bhtml ${DOC_SRC_DIR}/ ${DOC_HTML_DIR}/
  52. # Local variables:
  53. # mode: makefile
  54. # coding: utf-8
  55. # End:
  56. # vim: filetype=make fileencoding=utf-8 :