rules 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. %:
  10. dh $* --with python2,python3,pypy --buildsystem=python_distutils
  11. override_dh_auto_build:
  12. dh_auto_build
  13. # Work around bug #799485
  14. CFLAGS=-I/usr/lib/pypy pypy setup.py build -b build-pypy
  15. override_dh_auto_clean:
  16. dh_auto_clean
  17. rm -rf build*
  18. rm -f dulwich/*.so dulwich/*.o
  19. override_dh_auto_test:
  20. ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
  21. $(MAKE) check PYTHON=python
  22. $(MAKE) check PYTHON=python3
  23. PYTHONPATH=$(shell echo $(CURDIR)/build-pypy/lib*) pypy -m unittest dulwich.tests.test_suite
  24. endif
  25. override_dh_auto_install:
  26. dh_auto_install
  27. set -ex; for python in $(shell py3versions -r); do \
  28. $$python setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb; \
  29. done;
  30. pypy setup.py build -b build-pypy install --root=$(CURDIR)/debian/tmp --install-layout deb
  31. rm -rf debian/tmp/usr/lib/pypy/bin
  32. # Install everything excluding the *_d.so debug extensions to python-dulwich and python3-dulwich
  33. dh_install -X"*_d.so" "debian/tmp/usr/lib/python2*/*-packages" -p python-dulwich
  34. dh_install -X"*_d.so" "debian/tmp/usr/lib/python3*/*-packages" -p python3-dulwich
  35. # Install the debug extensions to python-dulwich-dbg
  36. dh_install "debian/tmp/usr/lib/python*/*-packages/dulwich/*_d.so" -p python-dulwich-dbg
  37. # Install the pypy files to pypy-dulwich
  38. dh_install "debian/tmp/usr/lib/pypy/" -p pypy-dulwich
  39. override_dh_installdocs:
  40. dh_installdocs -ppython-dulwich-dbg --link-doc=python-dulwich
  41. dh_installdocs -ppython3-dulwich-dbg --link-doc=python3-dulwich
  42. dh_installdocs -ppython-dulwich docs/tutorial -X.gitignore -XMakefile
  43. dh_installdocs -ppython3-dulwich docs/tutorial -X.gitignore -XMakefile
  44. dh_installdocs -ppypy-dulwich docs/tutorial -X.gitignore -XMakefile
  45. override_dh_strip:
  46. dh_strip -p python-dulwich --dbg-package=python-dulwich-dbg
  47. dh_strip -p python3-dulwich --dbg-package=python3-dulwich-dbg
  48. # For the moment, there is no dbg package for pypy-dulwich.
  49. dh_strip -p pypy-dulwich
  50. override_dh_installchangelogs:
  51. dh_installchangelogs NEWS