2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-05 04:47:53 +00:00
qpdf/build-scripts/build-appimage
Jay Berkenbilt cfafac8d13 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.
2020-10-21 10:07:34 -04:00

34 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
#
# Any extra args are passed to the docker run command before the
# invocation of qpdfbuild. This is useful for iterating locally as
# described in README-maintainer.
#
set -ex
cd appimage
docker build -t qpdfbuild .
rm -rf build
mkdir build
cd ..
git clone .git appimage/build/qpdf
docker run --privileged --rm \
-v $PWD/appimage/build:/tmp/build ${1+"$@"} qpdfbuild
rm -rf distribution
mkdir distribution
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/*