rules 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #!/usr/bin/make -f
  2. #
  3. # Build Debian package using https://github.com/spotify/dh-virtualenv
  4. #
  5. # assume we only have one package
  6. PACKAGE_NAME:=`dh_listpackages`
  7. override_dh_installsystemd:
  8. dh_installsystemd --name=matrix-synapse
  9. # we don't really want to strip the symbols from our object files.
  10. override_dh_strip:
  11. override_dh_auto_configure:
  12. # many libraries pulled from PyPI have allocatable sections after
  13. # non-allocatable ones on which dwz errors out. For those without the issue the
  14. # gains are only marginal
  15. override_dh_dwz:
  16. # dh_shlibdeps calls dpkg-shlibdeps, which finds all the binary files
  17. # (executables and shared libs) in the package, and looks for the shared
  18. # libraries that they depend on. It then adds a dependency on the package that
  19. # contains that library to the package.
  20. #
  21. # We make two modifications to that process...
  22. #
  23. override_dh_shlibdeps:
  24. # Firstly, postgres is not a hard dependency for us, so we want to make
  25. # the things that psycopg2 depends on (such as libpq) be
  26. # recommendations rather than hard dependencies. We do so by
  27. # running dpkg-shlibdeps manually on psycopg2's libs.
  28. #
  29. find debian/$(PACKAGE_NAME)/ -path '*/site-packages/psycopg2/*.so' | \
  30. xargs dpkg-shlibdeps -Tdebian/$(PACKAGE_NAME).substvars \
  31. -pshlibs1 -dRecommends
  32. # secondly, we exclude PIL's libraries from the process. They are known
  33. # to be self-contained, but they have interdependencies and
  34. # dpkg-shlibdeps doesn't know how to resolve them.
  35. #
  36. # As of Pillow 7.1.0, these libraries are in
  37. # site-packages/Pillow.libs. Previously, they were in
  38. # site-packages/PIL/.libs.
  39. #
  40. # (we also need to exclude psycopg2, of course, since we've already
  41. # dealt with that.)
  42. #
  43. dh_shlibdeps \
  44. -X site-packages/PIL/.libs \
  45. -X site-packages/Pillow.libs \
  46. -X site-packages/psycopg2
  47. override_dh_virtualenv:
  48. ./debian/build_virtualenv
  49. override_dh_builddeb:
  50. # force the compression to xzip, to stop dpkg-deb on impish defaulting to zstd
  51. # (which requires reprepro 5.3.0-1.3, which is currently only in 'experimental' in Debian:
  52. # https://metadata.ftp-master.debian.org/changelogs/main/r/reprepro/reprepro_5.3.0-1.3_changelog)
  53. dh_builddeb -- -Zxz
  54. %:
  55. dh $@ --with python-virtualenv