2
0

rules 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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=python_distutils
  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 -X"*_d.so" "debian/tmp/usr/lib/python2*/*-packages" -p python-dulwich
  37. dh_install -X"*_d.so" "debian/tmp/usr/lib/python3*/*-packages" -p python3-dulwich
  38. # Install the debug extensions to python-dulwich-dbg
  39. dh_install "debian/tmp/usr/lib/python*/*-packages/dulwich/*_d.so" -p python-dulwich-dbg
  40. ifneq (,$(findstring pypy,$(pyflavours)))
  41. # Install the pypy files to pypy-dulwich
  42. dh_install "debian/tmp/usr/lib/pypy/" -p pypy-dulwich
  43. endif
  44. override_dh_installdocs:
  45. dh_installdocs -ppython-dulwich-dbg --link-doc=python-dulwich
  46. dh_installdocs -ppython3-dulwich-dbg --link-doc=python3-dulwich
  47. dh_installdocs -ppython-dulwich docs/tutorial -X.gitignore -XMakefile
  48. dh_installdocs -ppython3-dulwich docs/tutorial -X.gitignore -XMakefile
  49. ifneq (,$(findstring pypy,$(pyflavours)))
  50. dh_installdocs -ppypy-dulwich docs/tutorial -X.gitignore -XMakefile
  51. endif
  52. override_dh_strip:
  53. dh_strip -p python-dulwich --dbgsym-migration='python-dulwich-dbg (<< 0.16.4-1)'
  54. dh_strip -p python3-dulwich --dbgsym-migration='python3-dulwich-dbg (<< 0.16.4-1)'
  55. ifneq (,$(findstring pypy,$(pyflavours)))
  56. dh_strip -p pypy-dulwich
  57. endif
  58. override_dh_installchangelogs:
  59. dh_installchangelogs NEWS