1
0

rules 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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_systemd_enable:
  8. dh_systemd_enable --name=matrix-synapse
  9. override_dh_installinit:
  10. dh_installinit --name=matrix-synapse
  11. # we don't really want to strip the symbols from our object files.
  12. override_dh_strip:
  13. # dh_shlibdeps calls dpkg-shlibdeps, which finds all the binary files
  14. # (executables and shared libs) in the package, and looks for the shared
  15. # libraries that they depend on. It then adds a dependency on the package that
  16. # contains that library to the package.
  17. #
  18. # We make two modifications to that process...
  19. #
  20. override_dh_shlibdeps:
  21. # Firstly, postgres is not a hard dependency for us, so we want to make
  22. # the things that psycopg2 depends on (such as libpq) be
  23. # recommendations rather than hard dependencies. We do so by
  24. # running dpkg-shlibdeps manually on psycopg2's libs.
  25. #
  26. find debian/$(PACKAGE_NAME)/ -path '*/site-packages/psycopg2/*.so' | \
  27. xargs dpkg-shlibdeps -Tdebian/$(PACKAGE_NAME).substvars \
  28. -pshlibs1 -dRecommends
  29. # secondly, we exclude PIL's libraries from the process. They are known
  30. # to be self-contained, but they have interdependencies and
  31. # dpkg-shlibdeps doesn't know how to resolve them.
  32. #
  33. # As of Pillow 7.1.0, these libraries are in
  34. # site-packages/Pillow.libs. Previously, they were in
  35. # site-packages/PIL/.libs.
  36. #
  37. # (we also need to exclude psycopg2, of course, since we've already
  38. # dealt with that.)
  39. #
  40. dh_shlibdeps \
  41. -X site-packages/PIL/.libs \
  42. -X site-packages/Pillow.libs \
  43. -X site-packages/psycopg2
  44. override_dh_virtualenv:
  45. ./debian/build_virtualenv
  46. %:
  47. dh $@ --with python-virtualenv