diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2023-07-17 00:16:48 +0200 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2023-07-17 00:16:48 +0200 |
commit | df9f3bd75b32406fa7c34376af5ef97e230361bc (patch) | |
tree | c55848ab9bab9784f530d9102ee1ed0ed45868f1 /pkgbuild | |
parent | 635ec022a87cb0789c6322275b41c3dfc51d36a4 (diff) | |
download | aurbuilder-df9f3bd75b32406fa7c34376af5ef97e230361bc.tar.gz |
readme, file structure
Diffstat (limited to 'pkgbuild')
-rw-r--r-- | pkgbuild/PKGBUILD | 32 | ||||
-rw-r--r-- | pkgbuild/aurbuilder.install | 18 |
2 files changed, 50 insertions, 0 deletions
diff --git a/pkgbuild/PKGBUILD b/pkgbuild/PKGBUILD new file mode 100644 index 0000000..93d4710 --- /dev/null +++ b/pkgbuild/PKGBUILD @@ -0,0 +1,32 @@ +# Maintainer: Your Name <youremail@domain.com> +pkgname=aurbuilder +pkgver=0.0 +pkgrel=1 +pkgdesc="AUR Package builder" +arch=( any ) +url="https://gitea.lauch.link/jonas/aurbuilder" +license=('CUSTOM') +groups=() +depends=( podman bash ) +makedepends=() +optdepends=() +source=(git+$url.git) +sha256sums=( SKIP ) +install=$pkgname.install + +pkgver() { + date +%Y%m%d +} + +build() { + cd "$pkgname" +} + +package() { + cd "$srcdir/$pkgname" + install -Dt $pkgdir/usr/share/aurbuilder container/{Dockerfile,sudoers} + install -Dt $pkgdir/usr/share/aurbuilder/bin container/bin/* + install -Dt $pkgdir/usr/lib/aurbuilder scripts/* + install -Dt $pkgdir/usr/lib/systemd/system unitfiles/* + install -Dt $pkgdir/etc/aurbuilder configs/* +} diff --git a/pkgbuild/aurbuilder.install b/pkgbuild/aurbuilder.install new file mode 100644 index 0000000..c8f383c --- /dev/null +++ b/pkgbuild/aurbuilder.install @@ -0,0 +1,18 @@ +pre_install() { + pkgname=aurbuilder + + if ! id -u $pkgname > /dev/null 2>&1; then + useradd -r -U $pkgname -d /var/lib/$pkgname -m -s /usr/bin/nologin + uid=$(id -u $pkgname) + gid=$(id -g $pkgname) + + usermod --add-subuids "${uid}000-${uid}999" \ + --add-subgids "${gid}000-${gid}999" \ + $pkgname + + loginctl enable-linger "$uid" + fi + + mkdir -p /srv/pkg + chown $pkgname:$pkgname /srv/pkg +} |