builder/autobuilder/build
fbt d42669565c universalize!
Signed-off-by: fbt <fbt@fleshless.org>
2021-03-06 07:06:47 +03:00

21 lines
525 B
Bash
Executable File

#!/usr/bin/env bash
# The builder user is already created in the rootfs
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
export LC_ALL=en_US.UTF-8
# Upgrade
pacman -Suy --noconfirm
# gnupg dir permissions
chown -R "$BUILDUSER:$BUILDUSER" /.gnupg
# Add sudo permissions for pacman to install dependencies
printf '%s ALL=(ALL) NOPASSWD: /usr/bin/pacman\n' "$BUILDUSER" > /etc/sudoers.d/builduser
# Workdir
cd /buildroot
# Build the damn thing
sudo -u "$BUILDUSER" GNUPGHOME="/.gnupg" makepkg "$@"