ilot/authentik: clean-up packaging, add pyc subpkg
This commit is contained in:
parent
7566c53ff7
commit
5f8fbe32aa
1 changed files with 55 additions and 32 deletions
|
@ -181,7 +181,7 @@ source="
|
||||||
go-downgrade-1.22.patch
|
go-downgrade-1.22.patch
|
||||||
"
|
"
|
||||||
builddir="$srcdir/"authentik-version-$pkgver
|
builddir="$srcdir/"authentik-version-$pkgver
|
||||||
subpackages="$pkgname-openrc $pkgname-doc"
|
subpackages="$pkgname-openrc $pkgname-doc $pkgname-pyc"
|
||||||
pkgusers="authentik"
|
pkgusers="authentik"
|
||||||
pkggroups="authentik"
|
pkggroups="authentik"
|
||||||
|
|
||||||
|
@ -261,53 +261,76 @@ with open(\"local.env.yml\", \"w\") as _config:
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
msg "Packaging $pkgname"
|
msg "Packaging $pkgname"
|
||||||
mkdir -p "$pkgdir"/usr/share/webapps/authentik/web
|
local prefix="/usr/share/webapps"
|
||||||
mkdir -p "$pkgdir"/usr/share/webapps/authentik/website
|
local destdir="$pkgdir"$prefix/authentik
|
||||||
mkdir -p "$pkgdir"/var/lib/authentik
|
|
||||||
mkdir -p "$pkgdir"/usr/share/doc
|
|
||||||
mkdir -p "$pkgdir"/usr/bin
|
|
||||||
cp -dr "$builddir"/authentik "$pkgdir"/usr/share/webapps/authentik
|
|
||||||
cp -dr "$builddir"/web/dist "$pkgdir"/usr/share/webapps/authentik/web/dist
|
|
||||||
cp -dr "$builddir"/web/authentik "$pkgdir"/usr/share/webapps/authentik/web/authentik
|
|
||||||
cp -dr "$builddir"/website/build "$pkgdir"/usr/share/doc/authentik
|
|
||||||
cp -dr "$builddir"/tests "$pkgdir"/usr/share/webapps/authentik/tests
|
|
||||||
cp -dr "$builddir"/lifecycle "$pkgdir"/usr/share/webapps/authentik/lifecycle
|
|
||||||
cp -dr "$builddir"/locale "$pkgdir"/usr/share/webapps/authentik/locale
|
|
||||||
cp -dr "$builddir"/blueprints "$pkgdir"/var/lib/authentik/blueprints
|
|
||||||
install -Dm755 "$builddir"/manage.py "$pkgdir"/usr/share/webapps/authentik/manage.py
|
|
||||||
install -Dm755 "$builddir"/server "$pkgdir"/usr/share/webapps/authentik/server
|
|
||||||
ln -s "/etc/authentik/config.yml" "$pkgdir"/usr/share/webapps/authentik/local.env.yml
|
|
||||||
|
|
||||||
install -Dm755 "$builddir"/proxy "$pkgdir"/usr/bin/authentik-proxy
|
# authentik install
|
||||||
install -Dm755 "$builddir"/ldap "$pkgdir"/usr/bin/authentik-ldap
|
install -d -m755 \
|
||||||
install -Dm755 "$builddir"/radius "$pkgdir"/usr/bin/authentik-radius
|
"$destdir" \
|
||||||
|
"$destdir"/web \
|
||||||
|
"$pkgdir"/usr/bin \
|
||||||
|
"$pkgdir"/usr/share/doc \
|
||||||
|
"$pkgdir"/var/lib/authentik
|
||||||
|
|
||||||
install -Dm755 "$srcdir"/$pkgname.openrc \
|
cp -rl authentik lifecycle locale tests \
|
||||||
"$pkgdir"/etc/init.d/$pkgname
|
"$destdir"/
|
||||||
install -Dm755 "$srcdir"/$pkgname-worker.openrc \
|
|
||||||
"$pkgdir"/etc/init.d/$pkgname-worker
|
cp -rl blueprints \
|
||||||
install -Dm755 "$srcdir"/$pkgname-ldap.openrc \
|
"$pkgdir"/var/lib/authentik/
|
||||||
"$pkgdir"/etc/init.d/$pkgname-ldap
|
|
||||||
install -Dm640 "$srcdir"/$pkgname-ldap.conf \
|
cp -rl web/dist web/authentik \
|
||||||
"$pkgdir"/etc/conf.d/$pkgname-ldap
|
"$destdir"/web/
|
||||||
|
|
||||||
|
install -m755 -t "$destdir" \
|
||||||
|
"$builddir"/server \
|
||||||
|
"$builddir"/ldap \
|
||||||
|
"$builddir"/radius \
|
||||||
|
"$builddir"/proxy \
|
||||||
|
"$builddir"/manage.py
|
||||||
|
|
||||||
|
cp -rl website/build/ "$pkgdir"/usr/share/doc/authentik/
|
||||||
|
|
||||||
|
# symbolic bin links to usr/bin
|
||||||
|
for i in server proxy ldap radius; do
|
||||||
|
ln -s $prefix/authentik/$i "$pkgdir"/usr/bin/authentik-$i
|
||||||
|
done
|
||||||
|
|
||||||
|
# openrc install
|
||||||
|
for i in $pkgname $pkgname-worker $pkgname-ldap; do
|
||||||
|
install -Dm755 "$srcdir"/$i.openrc "$pkgdir"/etc/init.d/$i
|
||||||
|
done
|
||||||
|
|
||||||
|
# config file setup
|
||||||
install -Dm640 "$builddir"/authentik/lib/default.yml \
|
install -Dm640 "$builddir"/authentik/lib/default.yml \
|
||||||
"$pkgdir"/etc/authentik/config.yml
|
"$pkgdir"/etc/authentik/config.yml
|
||||||
|
ln -s "/etc/authentik/config.yml" "$pkgdir"/usr/share/webapps/authentik/local.env.yml
|
||||||
chown root:www-data "$pkgdir"/etc/authentik/config.yml
|
chown root:www-data "$pkgdir"/etc/authentik/config.yml
|
||||||
|
|
||||||
mv "$pkgdir"/usr/share/webapps/authentik/web/dist/custom.css "$pkgdir"/etc/authentik/custom.css
|
|
||||||
ln -s "/etc/authentik/custom.css" "$pkgdir"/usr/share/webapps/authentik/web/dist/custom.css
|
|
||||||
chown root:www-data "$pkgdir"/etc/authentik/custom.css
|
|
||||||
|
|
||||||
sed -i 's|cert_discovery_dir.*|cert_discovery_dir: /var/lib/authentik/certs|' "$pkgdir"/etc/authentik/config.yml
|
sed -i 's|cert_discovery_dir.*|cert_discovery_dir: /var/lib/authentik/certs|' "$pkgdir"/etc/authentik/config.yml
|
||||||
sed -i 's|blueprints_dir.*|blueprints_dir: /var/lib/authentik/blueprints|' "$pkgdir"/etc/authentik/config.yml
|
sed -i 's|blueprints_dir.*|blueprints_dir: /var/lib/authentik/blueprints|' "$pkgdir"/etc/authentik/config.yml
|
||||||
sed -i 's|template_dir.*|template_dir: /var/lib/authentik/templates|' "$pkgdir"/etc/authentik/config.yml
|
sed -i 's|template_dir.*|template_dir: /var/lib/authentik/templates|' "$pkgdir"/etc/authentik/config.yml
|
||||||
printf "\ncsrf:\n trusted_origins: ['auth.example.com']" >> "$pkgdir"/etc/authentik/config.yml
|
printf "\ncsrf:\n trusted_origins: ['auth.example.com']" >> "$pkgdir"/etc/authentik/config.yml
|
||||||
printf "\nsecret_key: '@@SECRET_KEY@@'" >> "$pkgdir"/etc/authentik/config.yml
|
printf "\nsecret_key: '@@SECRET_KEY@@'" >> "$pkgdir"/etc/authentik/config.yml
|
||||||
|
|
||||||
|
# custom css location change
|
||||||
|
mv "$pkgdir"/usr/share/webapps/authentik/web/dist/custom.css "$pkgdir"/etc/authentik/custom.css
|
||||||
|
ln -s "/etc/authentik/custom.css" "$pkgdir"/usr/share/webapps/authentik/web/dist/custom.css
|
||||||
|
chown root:www-data "$pkgdir"/etc/authentik/custom.css
|
||||||
|
|
||||||
# Install wrapper script to /usr/bin.
|
# Install wrapper script to /usr/bin.
|
||||||
install -m755 -D "$srcdir"/authentik-manage.sh "$pkgdir"/usr/bin/authentik-manage
|
install -m755 -D "$srcdir"/authentik-manage.sh "$pkgdir"/usr/bin/authentik-manage
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pyc() {
|
||||||
|
default_pyc
|
||||||
|
|
||||||
|
cd "$pkgdir"
|
||||||
|
# shellcheck disable=SC3003
|
||||||
|
local IFS=$'\n'
|
||||||
|
# shellcheck disable=SC2046
|
||||||
|
amove $(find usr/share/webapps/authentik -type d -name __pycache__)
|
||||||
|
}
|
||||||
|
|
||||||
sha512sums="
|
sha512sums="
|
||||||
02e54183fa35e7a06780f68239db7b3b5e2ccd3c6e1fcaf97690d9b596077c7a5345dbb5b005f39ff67a0dae83bd9b71d1c6d18ba8fae9cc7174d5d856360bff authentik-2024.8.2.tar.gz
|
02e54183fa35e7a06780f68239db7b3b5e2ccd3c6e1fcaf97690d9b596077c7a5345dbb5b005f39ff67a0dae83bd9b71d1c6d18ba8fae9cc7174d5d856360bff authentik-2024.8.2.tar.gz
|
||||||
4defb4fe3a4230f4aa517fbecd5e5b8bcef2a64e1b40615660ae9eec33597310a09df5e126f4d39ce7764bd1716c0a7040637699135c103cbc1879593c6c06f1 authentik.openrc
|
4defb4fe3a4230f4aa517fbecd5e5b8bcef2a64e1b40615660ae9eec33597310a09df5e126f4d39ce7764bd1716c0a7040637699135c103cbc1879593c6c06f1 authentik.openrc
|
||||||
|
|
Loading…
Add table
Reference in a new issue