Commit cfafac8d135be02f69df49365a5cbf16a7a2aefe
1 parent
758e3e38
Create a minimal Linux binary distribution (fixes #352)
This is suitable for use as a Lambda layer in AWS, inclusion in a docker container, or other places where a minimal binary distribution is desired.
Showing
4 changed files
with
24 additions
and
1 deletions
ChangeLog
| 1 | +2020-10-21 Jay Berkenbilt <ejb@ql.org> | ||
| 2 | + | ||
| 3 | + * Add qpdf-<version>-linux-x86_64.zip to the list of built | ||
| 4 | + distributions. This is a simple zip file that contains just the | ||
| 5 | + qpdf executables and the dependent shared libraries that would not | ||
| 6 | + ordinarily be present on a base system. This minimal binary | ||
| 7 | + distribution works as is when used as a Lambda layer in AWS and | ||
| 8 | + could be suitable for inclusion in a docker image or other | ||
| 9 | + standalone Linux/x86_64 environment where you want minimal support | ||
| 10 | + for running the qpdf executable. Fixes #352. | ||
| 11 | + | ||
| 1 | 2020-10-20 Jay Berkenbilt <ejb@ql.org> | 12 | 2020-10-20 Jay Berkenbilt <ejb@ql.org> |
| 2 | 13 | ||
| 3 | * Add --warning-exit-0 option to the qpdf command line. When | 14 | * Add --warning-exit-0 option to the qpdf command line. When |
TODO
| @@ -2,7 +2,6 @@ Candidates for upcoming release | @@ -2,7 +2,6 @@ Candidates for upcoming release | ||
| 2 | =============================== | 2 | =============================== |
| 3 | 3 | ||
| 4 | * Easy build/test | 4 | * Easy build/test |
| 5 | - * #352: building standalone executables (lambda layer) | ||
| 6 | * #460: potential malware in fuzzer seed corpus | 5 | * #460: potential malware in fuzzer seed corpus |
| 7 | * Consider building workflow on a schedule to detect build rot. This | 6 | * Consider building workflow on a schedule to detect build rot. This |
| 8 | may enable safe use of *-latest especially if Windows wildcard is | 7 | may enable safe use of *-latest especially if Windows wildcard is |
build-scripts/build-appimage
| @@ -19,4 +19,15 @@ cp -p appimage/build/qpdf/appimage/build/qpdf*AppImage* distribution | @@ -19,4 +19,15 @@ cp -p appimage/build/qpdf/appimage/build/qpdf*AppImage* distribution | ||
| 19 | for i in distribution/*; do | 19 | for i in distribution/*; do |
| 20 | mv $i $(echo $i | sed -e 's/\.AppImage/-ci.AppImage/') | 20 | mv $i $(echo $i | sed -e 's/\.AppImage/-ci.AppImage/') |
| 21 | done | 21 | done |
| 22 | + | ||
| 23 | +# Extract a standalone copy of binaries and libraries from the | ||
| 24 | +# AppImage. This is suitable for use in AWS Lambda, docker, or other | ||
| 25 | +# self-contained environments. | ||
| 26 | +version=$(basename distribution/qpdf*AppImage | cut -d- -f 2) | ||
| 27 | +./distribution/qpdf*AppImage --appimage-extract | ||
| 28 | +D=$PWD/distribution | ||
| 29 | +(cd squashfs-root/usr; \ | ||
| 30 | + zip -9 --symlinks $D/qpdf-$version-bin-linux-x86_64-ci.zip \ | ||
| 31 | + bin/{qpdf,fix-qdf,zlib-flate} lib/*) | ||
| 32 | + | ||
| 22 | sha256sum distribution/* | 33 | sha256sum distribution/* |
make/libtool.mk
| @@ -106,6 +106,8 @@ endef | @@ -106,6 +106,8 @@ endef | ||
| 106 | 106 | ||
| 107 | # Install target | 107 | # Install target |
| 108 | 108 | ||
| 109 | +# NOTE: If installing any new executables, remember to update the | ||
| 110 | +# lambda layer code in build-scripts/build-appimage. | ||
| 109 | install: all | 111 | install: all |
| 110 | ./mkinstalldirs -m 0755 $(DESTDIR)$(libdir)/pkgconfig | 112 | ./mkinstalldirs -m 0755 $(DESTDIR)$(libdir)/pkgconfig |
| 111 | ./mkinstalldirs -m 0755 $(DESTDIR)$(bindir) | 113 | ./mkinstalldirs -m 0755 $(DESTDIR)$(bindir) |