include.am 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # vim:ft=automake
  2. DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
  3. deb:
  4. # Setup meta folders
  5. mkdir -p debian/libwolfssl/DEBIAN debian/libwolfssl-dev/DEBIAN
  6. # "Install" wolfSSL
  7. make install exec_prefix=$(CURDIR)/debian/libwolfssl/usr \
  8. prefix=$(CURDIR)/debian/libwolfssl-dev/usr
  9. # deb shared lib stuff
  10. fakeroot dh_makeshlibs
  11. dh_shlibdeps
  12. dh_installdeb
  13. # Generate the lib and src descriptions
  14. fakeroot dh_gencontrol
  15. # Make adjustments to the package structure and to satisfy lintian checks
  16. # Correct doc dir name
  17. @rm -rf debian/libwolfssl-dev/usr/share/doc/libwolfssl-dev
  18. @mv debian/libwolfssl-dev/usr/share/doc/wolfssl \
  19. debian/libwolfssl-dev/usr/share/doc/libwolfssl-dev
  20. # Clear lib folder
  21. @rm -rf debian/libwolfssl-dev/usr/lib
  22. @mkdir -p debian/libwolfssl-dev/usr/lib
  23. # Move the top level .so into the dev pkg
  24. @mv debian/libwolfssl/usr/lib/libwolfssl.so debian/libwolfssl-dev/usr/lib
  25. # Create correct pkg doc dir
  26. @rm -rf debian/libwolfssl/usr/share/doc/libwolfssl
  27. @mkdir -p debian/libwolfssl/usr/share/doc/libwolfssl
  28. # Place changelog
  29. @gzip -n -9 -c debian/changelog | \
  30. tee debian/libwolfssl/usr/share/doc/libwolfssl/changelog.gz > \
  31. debian/libwolfssl-dev/usr/share/doc/libwolfssl-dev/changelog.gz
  32. # Place copyright
  33. @cp debian/copyright debian/libwolfssl/usr/share/doc/libwolfssl
  34. @cp debian/copyright debian/libwolfssl-dev/usr/share/doc/libwolfssl-dev
  35. # Remove .la file https://wiki.debian.org/ReleaseGoals/LAFileRemoval
  36. @rm debian/libwolfssl/usr/lib/libwolfssl.la
  37. # Strip unwanted symbols
  38. # https://www.debian.org/doc/debian-policy/ch-files.html#binaries
  39. @strip --strip-unneeded debian/libwolfssl/usr/lib/libwolfssl.so.*.*.*
  40. # Place pkgconfig so that it is available for cross-compilation
  41. # https://lintian.debian.org/tags/pkg-config-unavailable-for-cross-compilation
  42. @rm -rf debian/libwolfssl/usr/lib/$(DEB_HOST_MULTIARCH)
  43. @mkdir -p debian/libwolfssl/usr/lib/$(DEB_HOST_MULTIARCH)
  44. @mv debian/libwolfssl/usr/lib/pkgconfig \
  45. debian/libwolfssl/usr/lib/$(DEB_HOST_MULTIARCH)
  46. # Set the expected access rules
  47. @chmod 644 debian/libwolfssl/usr/lib/libwolfssl.so.*.*.*
  48. @chmod 644 debian/libwolfssl/usr/share/doc/libwolfssl/changelog.gz \
  49. debian/libwolfssl/usr/share/doc/libwolfssl/copyright \
  50. debian/libwolfssl-dev/usr/share/doc/libwolfssl-dev/changelog.gz \
  51. debian/libwolfssl-dev/usr/share/doc/libwolfssl-dev/copyright
  52. # Do this as the last step to mark all directories with the correct access bits
  53. @find debian/libwolfssl*/usr -type d | xargs chmod 755
  54. # Generate debs
  55. dpkg-deb --root-owner-group -b debian/libwolfssl .
  56. dpkg-deb --root-owner-group -b debian/libwolfssl-dev .
  57. # Check that everything is correct with lintian
  58. # - we don't provide a manual page for wolfssl-config
  59. # - we don't care about matching the soname for our debs
  60. lintian *.deb --fail-on error,warning --tag-display-limit 0 \
  61. --suppress-tags no-manual-page,package-name-doesnt-match-sonames
  62. # Clean up the working dirs
  63. make deb-clean
  64. deb-docker:
  65. docker build -t "debian-builder:Dockerfile" Docker/packaging/debian
  66. docker run --rm -v $(CURDIR):/opt/wolfssl debian-builder:Dockerfile \
  67. bash -c 'cd /opt/wolfssl && ./config.status --recheck && make deb && \
  68. make clean deb-clean &> /dev/null'
  69. # To allow the user to keep using the configuration on the host
  70. @./config.status --recheck &> /dev/null
  71. deb-clean:
  72. rm -rf debian/libwolfssl debian/libwolfssl-dev debian/files \
  73. debian/*.substvars debian/.debhelper