2018-02-20 20:36:13 -05:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
if [ $(id -u) = 0 ]; then
|
2018-06-22 22:11:35 -04:00
|
|
|
if [ ! -d /tmp/build ]; then
|
|
|
|
echo "/tmp/build must exist"
|
2018-02-20 20:36:13 -05:00
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
id=$(stat -c %u /tmp/build)
|
|
|
|
adduser --home /tmp/build --no-create-home --uid $id --disabled-password --gecos build build
|
2022-03-11 20:54:48 -05:00
|
|
|
touch /tmp/.env
|
|
|
|
echo "export SKIP_TESTS=$SKIP_TESTS" >> /tmp/.env
|
|
|
|
echo "export RUN_SHELL=$RUN_SHELL" >> /tmp/.env
|
|
|
|
chown build /tmp/.env
|
2018-02-20 20:36:13 -05:00
|
|
|
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
|
2022-03-11 20:54:48 -05:00
|
|
|
source /tmp/.env
|
|
|
|
if [ "$RUN_SHELL" = "1" ]; then
|
|
|
|
bash
|
|
|
|
else
|
|
|
|
./appimage/build-appimage
|
2018-02-24 23:38:07 -05:00
|
|
|
fi
|