rules 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/usr/bin/make -f
  2. CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
  3. CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
  4. CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
  5. LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
  6. # Callable functions to determine the correct PYTHONPATH
  7. pythonpath = $$(ls -d $(CURDIR)/build/lib.*-$(1))
  8. pythonpath_dbg = $$(ls -d $(CURDIR)/build/lib_d.*-$(1) 2>/dev/null || ls -d $(CURDIR)/build/lib.*$(1)-pydebug)
  9. pyflavours = python2,python3$(shell which pypy >/dev/null && echo -n ,pypy)
  10. %:
  11. dh $* --with $(pyflavours) --buildsystem=pybuild
  12. override_dh_auto_build:
  13. dh_auto_build
  14. override_dh_auto_clean:
  15. dh_auto_clean
  16. rm -rf build*
  17. rm -f dulwich/*.so dulwich/*.o
  18. override_dh_auto_test:
  19. ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
  20. $(MAKE) check PYTHON=python
  21. $(MAKE) check PYTHON=python3
  22. ifneq (,$(findstring pypy,$(pyflavours)))
  23. $(MAKE) check PYTHON=pypy
  24. endif
  25. endif
  26. override_dh_auto_install:
  27. dh_auto_install
  28. set -ex; for python in $(shell py3versions -r); do \
  29. $$python setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb; \
  30. done;
  31. ifneq (,$(findstring pypy,$(pyflavours)))
  32. pypy setup.py build -b build-pypy install --root=$(CURDIR)/debian/tmp --install-layout deb
  33. rm -rf debian/tmp/usr/lib/pypy/bin
  34. endif
  35. # Install everything excluding the *_d.so debug extensions to python-dulwich and python3-dulwich
  36. dh_install -p python-dulwich -X"*_d.so" -Xpypy "debian/tmp/usr/lib/python2*/*-packages"
  37. dh_install -p python3-dulwich -X"*_d.so" -Xpypy "debian/tmp/usr/lib/python3*/*-packages"
  38. ifneq (,$(findstring pypy,$(pyflavours)))
  39. # Install the pypy files to pypy-dulwich
  40. dh_install -p pypy-dulwich "debian/tmp/usr/lib/pypy/"
  41. endif
  42. override_dh_installdocs:
  43. dh_installdocs -ppython-dulwich docs/tutorial -X.gitignore -XMakefile
  44. dh_installdocs -ppython3-dulwich docs/tutorial -X.gitignore -XMakefile
  45. ifneq (,$(findstring pypy,$(pyflavours)))
  46. dh_installdocs -ppypy-dulwich docs/tutorial -X.gitignore -XMakefile
  47. endif
  48. override_dh_strip:
  49. dh_strip -p python-dulwich --dbgsym-migration='python-dulwich-dbg (<< 0.16.4-1)'
  50. dh_strip -p python3-dulwich --dbgsym-migration='python3-dulwich-dbg (<< 0.16.4-1)'
  51. ifneq (,$(findstring pypy,$(pyflavours)))
  52. dh_strip -p pypy-dulwich
  53. endif
  54. override_dh_installchangelogs:
  55. dh_installchangelogs NEWS