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