24 lines
504 B
Bash
Executable File
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
|