From d75adf324cb1badb832b7c65bf9ffbaafe115bc1 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Sun, 16 Jul 2023 19:01:54 +0200 Subject: move docker dir --- container/bin/buildpackage.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 container/bin/buildpackage.sh (limited to 'container/bin/buildpackage.sh') diff --git a/container/bin/buildpackage.sh b/container/bin/buildpackage.sh new file mode 100755 index 0000000..a1dd8c3 --- /dev/null +++ b/container/bin/buildpackage.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +echo "BUILDING: $PACKAGE_NAME" +echo "PACKAGER: $PACKAGER" + +INTERMED_DEST="/pkgdest" + +cd /workdir || exit 1 + +while read -r NAME BASE VER _; do + echo "$NAME $VER for $ARCH" + OUTNAME="$NAME-$VER-$ARCH.pkg" + + # Only build when needed + if [ ! "$FORCE_REBUILD" = "yes" ] && compgen -G "/pkgout/${OUTNAME}*"; then + echo "$NAME $VER ($ARCH) is already built. Skipping." + continue + fi + + sudo --user=aurbuilder \ + git clone "https://aur.archlinux.org/$BASE.git" "$BASE" + cd "$BASE" || exit 1 + + sudo -u aurbuilder CARCH="$ARCH" PACKAGER="$PACKAGER" PKGDEST="$INTERMED_DEST" \ + makepkg --force --syncdeps --noconfirm --install + + cp --no-preserve=ownership "$INTERMED_DEST/"*.pkg.tar.zst /pkgout + #test -n "$CHOWN" && sudo chown "$CHOWN" "/pkgout/${OUTNAME}"* +done <<< "$(getpackage.py "$PACKAGE_NAME")" -- cgit v1.2.3