2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-14 08:44:04 +00:00
qpdf/appimage/entrypoint
2018-06-23 07:50:11 -04:00

29 lines
646 B
Bash
Executable File

#!/bin/bash
set -e
if [ "$SKIP_TESTS" = "1" ]; then
touch /tmp/skip-tests
fi
if [ $(id -u) = 0 ]; then
if [ ! -d /tmp/build ]; then
echo "/tmp/build must exist"
exit 2
fi
id=$(stat -c %u /tmp/build)
adduser --home /tmp/build --no-create-home --uid $id --disabled-password --gecos build build
exec sudo -iu build $0 "$@"
fi
cd /tmp/build
if [ ! -d qpdf ]; then
if [ "$1" == "" ]; then
echo "A repository and optional git clone arguments must be given"
exit 2
fi
git clone "$@" qpdf
fi
cd qpdf
if [ -f /tmp/skip-tests ]; then
export SKIP_TESTS=1
fi
./appimage/build-appimage