2021-02-26 23:50:00 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Upgrade
|
2021-03-01 12:43:07 +00:00
|
|
|
pacman -Suy --noconfirm
|
2021-02-26 23:50:00 +00:00
|
|
|
|
2021-10-06 07:57:26 +00:00
|
|
|
# Create a builder user
|
|
|
|
groupadd -g 1100 builder
|
|
|
|
useradd -g 1100 -u 1100 builder
|
|
|
|
|
2021-03-06 03:41:56 +00:00
|
|
|
# gnupg dir permissions
|
2021-10-06 07:57:26 +00:00
|
|
|
chown -R builder:builder /.gnupg /buildroot
|
2021-03-06 03:41:56 +00:00
|
|
|
|
2021-03-06 03:48:58 +00:00
|
|
|
# Add sudo permissions for pacman to install dependencies
|
2021-10-06 07:57:26 +00:00
|
|
|
printf '%s ALL=(ALL) NOPASSWD: /usr/bin/pacman\n' builder > /etc/sudoers.d/builduser
|
2021-03-06 03:48:58 +00:00
|
|
|
|
2021-02-26 23:50:00 +00:00
|
|
|
# Workdir
|
|
|
|
cd /buildroot
|
|
|
|
|
|
|
|
# Build the damn thing
|
2021-10-06 07:57:26 +00:00
|
|
|
sudo -u builder GNUPGHOME="/.gnupg" makepkg "$@"
|
|
|
|
|
|
|
|
# Return the permissions
|
|
|
|
chown -R root:root /buildroot
|