install deps

Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
Jack L. Frost 2021-10-06 12:26:25 +03:00
parent 0a31377fcd
commit c9740dac87

View File

@ -1,21 +1,27 @@
#!/usr/bin/env bash
shopt -s nullglob
# Upgrade
pacman -Suy --noconfirm
# Create a builder user
groupadd -g 1100 builder
useradd -g 1100 -u 1100 builder
useradd -U builder
builder_uid=$(id -u builder)
builder_gid=$(id -g builder)
# gnupg dir permissions
chown -R builder:builder /.gnupg /buildroot
chown -R "$builder_uid:$builder_gid" /.gnupg /buildroot
# Add sudo permissions for pacman to install dependencies
printf '%s ALL=(ALL) NOPASSWD: /usr/bin/pacman\n' builder > /etc/sudoers.d/builduser
printf '%s ALL=(ALL) NOPASSWD: /usr/bin/pacman\n' 'builder' > /etc/sudoers.d/builduser
# Workdir
cd /buildroot
# Install all additional packages
deps=( ./deps/* )
[[ $deps ]] && pacman -U "${deps[@]}"
# Build the damn thing
sudo -u builder GNUPGHOME="/.gnupg" makepkg "$@"