builder/autobuilder/build
fbt 0a31377fcd work with no keep-id
Signed-off-by: fbt <fbt@fleshless.org>
2021-10-06 10:57:26 +03:00

24 lines
504 B
Bash
Executable File

#!/usr/bin/env bash
# Upgrade
pacman -Suy --noconfirm
# Create a builder user
groupadd -g 1100 builder
useradd -g 1100 -u 1100 builder
# gnupg dir permissions
chown -R builder:builder /.gnupg /buildroot
# Add sudo permissions for pacman to install dependencies
printf '%s ALL=(ALL) NOPASSWD: /usr/bin/pacman\n' builder > /etc/sudoers.d/builduser
# Workdir
cd /buildroot
# Build the damn thing
sudo -u builder GNUPGHOME="/.gnupg" makepkg "$@"
# Return the permissions
chown -R root:root /buildroot