2
0

rules 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. # Get the supported Python versions
  7. PYTHONS = $(shell pyversions -r) pypy
  8. # Get the default Python version
  9. PYVERSION = $(shell pyversions -d -v)
  10. # Callable functions to determine the correct PYTHONPATH
  11. pythonpath = $$(ls -d $(CURDIR)/build/lib.*-$(1))
  12. pythonpath_dbg = $$(ls -d $(CURDIR)/build/lib_d.*-$(1) 2>/dev/null || ls -d $(CURDIR)/build/lib.*$(1)-pydebug)
  13. %:
  14. dh $* --with python2,pypy --buildsystem=python_distutils
  15. override_dh_auto_build:
  16. dh_auto_build
  17. pypy setup.py build -b build-pypy
  18. override_dh_auto_clean:
  19. dh_auto_clean
  20. rm -rf build-pypy
  21. override_dh_auto_test:
  22. ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
  23. $(MAKE) check
  24. PYTHONPATH=$(shell echo $(CURDIR)/build-pypy/lib*) pypy -m unittest dulwich.tests.test_suite
  25. endif
  26. override_dh_auto_install:
  27. dh_auto_install
  28. pypy setup.py build -b build-pypy install --root debian/tmp --install-layout deb
  29. rm -rf debian/tmp/usr/lib/pypy/bin
  30. # Install everything excluding the *_d.so debug extensions to python-dulwich
  31. dh_install -X"*_d.so" "debian/tmp/usr/lib/python*/*-packages" -p python-dulwich
  32. # Install the debug extensions to python-dulwich-dbg
  33. dh_install "debian/tmp/usr/lib/python*/*-packages/dulwich/*_d.so" -p python-dulwich-dbg
  34. # Install the pypy files to pypy-dulwich
  35. dh_install "debian/tmp/usr/lib/pypy/" -p pypy-dulwich
  36. override_dh_installdocs:
  37. dh_installdocs -ppython-dulwich-dbg --link-doc=python-dulwich
  38. dh_installdocs -ppython-dulwich docs/tutorial -X.gitignore -XMakefile
  39. dh_installdocs -ppypy-dulwich docs/tutorial -X.gitignore -XMakefile
  40. override_dh_strip:
  41. ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
  42. dh_strip --dbg-package=python-dulwich-dbg
  43. endif
  44. override_dh_installchangelogs:
  45. dh_installchangelogs NEWS