Distribution files to build pacwrap repo and dist packages

This commit is contained in:
Xavier Moffett 2023-10-09 06:26:48 -04:00
parent efb9ef7fa2
commit 1f5e13a579
7 changed files with 76 additions and 0 deletions

35
dist/pacwrap-base-dist/PKGBUILD vendored Normal file
View file

@ -0,0 +1,35 @@
# Maintainer: Xavier R.M. (sapphirus at azorium dot net)
pkgname=('pacwrap-base-dist')
pkgver=0.3.1
pkgrel=3
pkgdesc=""
arch=('any')
url="https://pacwrap.sapphirus.org/"
license=('GPLv3-only')
conflicts=('pacwrap-base-dist')
depends=('fakeroot' 'fakechroot')
source=("${pkgname}-${pkgver}-${pkgrel}.tar.zst::${pkgname}-${pkgver}-${pkgrel}.tar.zst")
sha512sums=('1506e1fd29baf29e1147c7989e5ff0f7f9da7d1bbf0c0d51db24d9d4bc632f74937496187a6245603d38d49c7f16d854c810008f18d74f255ad8fdfe7ea633bd')
package() {
cd "${srcdir}"
local pacman_hooks=('20-systemd-sysusers'
'30-systemd-tmpfiles'
'30-systemd-daemon-reload'
'30-systemd-sysctl'
'30-systemd-catalog'
'30-systemd-update'
'30-systemd-udev-reload'
'30-systemd-hwdb'
'dbus-reload')
mkdir -p "$pkgdir/etc/pacman.d/hooks/"
for pacman_hook in ${pacman_hooks[@]}; do
ln -s /dev/null "$pkgdir/etc/pacman.d/hooks/$pacman_hook.hook"; done
install -Dm 644 "dist_src/0-pacwrap-dist.hook" "${pkgdir}/usr/share/libalpm/hooks/0-pacwrap-dist.hook"
install -Dm 644 "dist_src/42-trust-permission.hook" "${pkgdir}/usr/share/libalpm/hooks/42-trust-permission.hook"
install -Dm 755 "dist_src/pacwrap-dist" "${pkgdir}/usr/bin/pacwrap-dist"
}

View file

@ -0,0 +1,9 @@
[Trigger]
Operation = Install
Type = Package
Target = pacwrap-base-dist
[Action]
Description = Configuring base container..
When = PostTransaction
Exec = /usr/bin/pacwrap-dist

View file

@ -0,0 +1,11 @@
[Trigger]
Operation = Install
Operation = Upgrade
Operation = Remove
Type = Path
Target = usr/share/ca-certificates/trust-source/*
[Action]
Description = Permissing certificate store...
When = PostTransaction
Exec = /usr/bin/chmod -R 755 /usr/share/ca-certificates /etc/ca-certificates

View file

@ -0,0 +1,4 @@
#!/bin/bash
echo 'user:x:1000:1000::/:/usr/bin/nologin' >> /etc/passwd
rm /usr/share/libalpm/hooks/0-pacwrap-dist.hook /usr/bin/pacwrap-dist
echo "Completed setup."

2
dist/tools/clean.sh vendored Executable file
View file

@ -0,0 +1,2 @@
rm ./dist/dist-repo/*
rm ./dist/pacwrap-base-dist/*.tar.zst

8
dist/tools/package.sh vendored Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
cd ./dist/$1/
tar acvf $1-$2-$3.tar.zst dist_src
SUM=($(sha512sum $1-$2-$3.tar.zst))
cp PKGBUILD PKGBUILD.tmp
sed -e "s/sha512sums=(.*)/sha512sums=('${SUM[0]}')/g;s/pkgver=.*/pkgver=$2/g;s/pkgrel=.*/pkgrel=$3/g" < "PKGBUILD.tmp" > "PKGBUILD"
makepkg -sf
rm -r src pkg PKGBUILD.tmp

7
dist/tools/repo.sh vendored Executable file
View file

@ -0,0 +1,7 @@
echo "Preparing repo.."
./dist/tools/clean.sh
echo "Packaging.."
./dist/tools/package.sh pacwrap-base-dist $1 $2
echo "Building repo.."
cp ./dist/*/*.pkg.tar.zst ./dist/dist-repo/
repose pacwrap -zfr ./dist/dist-repo/