Add aurutils
This commit is contained in:
73
aurutils/Containerfile
Normal file
73
aurutils/Containerfile
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
FROM docker.io/archlinux/archlinux:latest
|
||||||
|
|
||||||
|
# Update pacma dtaabase
|
||||||
|
# Initialize pacman key
|
||||||
|
# Ensure archlinux-keyring package is up to date
|
||||||
|
# Update all packages
|
||||||
|
|
||||||
|
RUN pacman -Sy && \
|
||||||
|
pacman-key --init && \
|
||||||
|
pacman -S --noconfirm archlinux-keyring && \
|
||||||
|
pacman -Su --noconfirm
|
||||||
|
|
||||||
|
# Install packages required for cloning and building the aur-utils repo
|
||||||
|
|
||||||
|
RUN pacman -S --noconfirm base-devel git curl jq man-db man-pages nano
|
||||||
|
|
||||||
|
# Install additional aurutils dependencies
|
||||||
|
# https://github.com/aurutils/aurutils/blob/release/makepkg/PKGBUILD#L14
|
||||||
|
|
||||||
|
RUN pacman -S --noconfirm pacutils trurl perl perl-json-xs
|
||||||
|
|
||||||
|
# Copy in makepkg config file, aur sudo ocnfig, custom repo config, and include custom repo config in main pacman config
|
||||||
|
|
||||||
|
COPY --chown=root:root --chmod=0664 makepkg.conf /etc/makepkg.conf.d/makepkg.conf
|
||||||
|
COPY --chown=root:root --chmod=0600 aur.sudo /etc/sudoers.d/aur
|
||||||
|
COPY --chown=root:root --chmod=0664 home.repo.conf /etc/pacman.d/home.repo.conf
|
||||||
|
RUN cat <<EOF >> /etc/pacman.conf
|
||||||
|
|
||||||
|
[home]
|
||||||
|
Include = /etc/pacman.d/home.repo.conf
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Create the aur system user
|
||||||
|
|
||||||
|
RUN useradd -r -U -m -d /aur aur && \
|
||||||
|
mkdir /repo && \
|
||||||
|
chmod 0775 /repo && \
|
||||||
|
chown aur:aur /repo
|
||||||
|
|
||||||
|
# Switch to aur user for build operations
|
||||||
|
|
||||||
|
USER aur
|
||||||
|
|
||||||
|
# Git clone the aur-utils repo
|
||||||
|
# Checkout the latest release, fetching latest release version from github API via curl
|
||||||
|
|
||||||
|
RUN git clone https://github.com/aurutils/aurutils.git /aur/aurutils && \
|
||||||
|
cd /aur/aurutils && \
|
||||||
|
git switch --detach $(curl -sSfL https://api.github.com/repos/aurutils/aurutils/releases/latest | jq -r .tag_name)
|
||||||
|
|
||||||
|
# Ensure makepkg dirs exist
|
||||||
|
|
||||||
|
RUN mkdir -p /aur/{builddir,srcdest,srcpkgdest,log}
|
||||||
|
|
||||||
|
# Init the home repo db
|
||||||
|
# Update pacman sources
|
||||||
|
|
||||||
|
RUN repo-add /repo/home.db.tar.zst && \
|
||||||
|
sudo pacman -Sy
|
||||||
|
|
||||||
|
# Build the aurutils package
|
||||||
|
|
||||||
|
RUN makepkg --nosign -i --noconfirm -D /aur/aurutils/makepkg
|
||||||
|
|
||||||
|
RUN rm /repo/aurutils-git*.pkg.tar.zst && \
|
||||||
|
rm -r /aur/aurutils
|
||||||
|
|
||||||
|
# Set working directory and entrypoint
|
||||||
|
|
||||||
|
WORKDIR /aur
|
||||||
|
ENV PATH=/usr/local/bin:/usr/bin
|
||||||
|
ENTRYPOINT ["/bin/bash"]
|
||||||
1
aurutils/aur.sudo
Normal file
1
aurutils/aur.sudo
Normal file
@@ -0,0 +1 @@
|
|||||||
|
aur ALL=(root) NOPASSWD: /usr/lib/aurutils/*, /usr/bin/pacman *
|
||||||
3
aurutils/home.repo.conf
Normal file
3
aurutils/home.repo.conf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# SigLevel = Required TrustedOnly
|
||||||
|
SigLevel = Optional TrustAll
|
||||||
|
Server = file:///repo
|
||||||
20
aurutils/makepkg.conf
Normal file
20
aurutils/makepkg.conf
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# Global Options
|
||||||
|
|
||||||
|
OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge debug lto autodeps)
|
||||||
|
MAKEFLAGS="-j2"
|
||||||
|
PACKAGER="Balsillie Homelab <admin@balsillie.net>"
|
||||||
|
|
||||||
|
# Build Environment
|
||||||
|
|
||||||
|
BUILDDIR=/aur/builddir
|
||||||
|
BUILDENV=(!distcc color !ccache check sign)
|
||||||
|
GPGKEY=$AUR_GPG_KEY_THUMBPRINT
|
||||||
|
|
||||||
|
# Outputs
|
||||||
|
|
||||||
|
PKGDEST=/repo
|
||||||
|
SRCDEST=/aur/srcdest
|
||||||
|
SRCPKGDEST=/aur/srcpkgdest
|
||||||
|
LOGDEST=/aur/log
|
||||||
|
PKGEXT=".pkg.tar.zst"
|
||||||
|
SRCEXT=".src.tar.zst"
|
||||||
Reference in New Issue
Block a user