summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2020-10-21 16:07:34 +0200
committerJay Berkenbilt <ejb@ql.org>2020-10-21 16:07:34 +0200
commitcfafac8d135be02f69df49365a5cbf16a7a2aefe (patch)
tree54f5fc6eb8b51fdfaded3de201e975e54763b766
parent758e3e38f5aceea2502179c7c4840911337f8a3f (diff)
downloadqpdf-cfafac8d135be02f69df49365a5cbf16a7a2aefe.tar.zst
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.
-rw-r--r--ChangeLog11
-rw-r--r--TODO1
-rwxr-xr-xbuild-scripts/build-appimage11
-rw-r--r--make/libtool.mk2
4 files changed, 24 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 3c748cc3..8d772d91 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2020-10-21 Jay Berkenbilt <ejb@ql.org>
+
+ * Add qpdf-<version>-linux-x86_64.zip to the list of built
+ distributions. This is a simple zip file that contains just the
+ qpdf executables and the dependent shared libraries that would not
+ ordinarily be present on a base system. This minimal binary
+ distribution works as is when used as a Lambda layer in AWS and
+ could be suitable for inclusion in a docker image or other
+ standalone Linux/x86_64 environment where you want minimal support
+ for running the qpdf executable. Fixes #352.
+
2020-10-20 Jay Berkenbilt <ejb@ql.org>
* Add --warning-exit-0 option to the qpdf command line. When
diff --git a/TODO b/TODO
index 98512644..2e76e5f8 100644
--- a/TODO
+++ b/TODO
@@ -2,7 +2,6 @@ Candidates for upcoming release
===============================
* Easy build/test
- * #352: building standalone executables (lambda layer)
* #460: potential malware in fuzzer seed corpus
* Consider building workflow on a schedule to detect build rot. This
may enable safe use of *-latest especially if Windows wildcard is
diff --git a/build-scripts/build-appimage b/build-scripts/build-appimage
index 8a614701..3ba7175e 100755
--- a/build-scripts/build-appimage
+++ b/build-scripts/build-appimage
@@ -19,4 +19,15 @@ cp -p appimage/build/qpdf/appimage/build/qpdf*AppImage* distribution
for i in distribution/*; do
mv $i $(echo $i | sed -e 's/\.AppImage/-ci.AppImage/')
done
+
+# Extract a standalone copy of binaries and libraries from the
+# AppImage. This is suitable for use in AWS Lambda, docker, or other
+# self-contained environments.
+version=$(basename distribution/qpdf*AppImage | cut -d- -f 2)
+./distribution/qpdf*AppImage --appimage-extract
+D=$PWD/distribution
+(cd squashfs-root/usr; \
+ zip -9 --symlinks $D/qpdf-$version-bin-linux-x86_64-ci.zip \
+ bin/{qpdf,fix-qdf,zlib-flate} lib/*)
+
sha256sum distribution/*
diff --git a/make/libtool.mk b/make/libtool.mk
index 6a2bbc1a..a259afe0 100644
--- a/make/libtool.mk
+++ b/make/libtool.mk
@@ -106,6 +106,8 @@ endef
# Install target
+# NOTE: If installing any new executables, remember to update the
+# lambda layer code in build-scripts/build-appimage.
install: all
./mkinstalldirs -m 0755 $(DESTDIR)$(libdir)/pkgconfig
./mkinstalldirs -m 0755 $(DESTDIR)$(bindir)