aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/freeradius/APKBUILD27
-rw-r--r--main/freeradius/freeradius.post-install4
-rw-r--r--main/freeradius/freeradius.post-upgrade2
-rw-r--r--main/freeradius/print-var.mk2
-rw-r--r--main/freeradius/remove-eap-from-default-mods.patch12
-rw-r--r--main/freeradius/setup-freeradius.in23
6 files changed, 65 insertions, 5 deletions
diff --git a/main/freeradius/APKBUILD b/main/freeradius/APKBUILD
index a729ba096f..b6e6adc718 100644
--- a/main/freeradius/APKBUILD
+++ b/main/freeradius/APKBUILD
@@ -5,7 +5,7 @@
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=freeradius
pkgver=3.0.20
-pkgrel=4
+pkgrel=5
pkgdesc="RADIUS (Remote Authentication Dial-In User Service) server"
url="https://freeradius.org/"
arch="all"
@@ -37,7 +37,7 @@ makedepends="
"
pkggroups="radius"
pkgusers="radius"
-install="$pkgname.pre-install $pkgname.post-upgrade"
+install="$pkgname.pre-install $pkgname.post-install $pkgname.post-upgrade"
subpackages="
$pkgname-dbg
$pkgname-doc
@@ -67,10 +67,13 @@ provides="freeradius3=$pkgver-r$pkgrel"
source="ftp://ftp.freeradius.org/pub/freeradius/$pkgname-server-$pkgver.tar.gz
$pkgname.confd
$pkgname.initd
+ setup-freeradius.in
+ print-var.mk
musl-fix-headers.patch
fix-scopeid.patch
default-config.patch
+ remove-eap-from-default-mods.patch
Fix-permissions-of-certs-in-bootstrap-fallback.patch
fix-request_running-segfault.patch
"
@@ -92,8 +95,12 @@ ldpath="$_radlibdir"
prepare() {
default_prepare
update_config_sub
- # remove certs generation
- # rm -rf raddb/certs
+
+ local default_mods
+ default_mods=$(make -f "$srcdir"/print-var.mk -f raddb/all.mk \
+ print-DEFAULT_MODULES 2>/dev/null)
+ sed "s|@@DEFAULT_MODULES@@|$default_mods|" \
+ "$srcdir"/setup-freeradius.in > setup-freeradius
}
build() {
@@ -151,10 +158,18 @@ package() {
install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/radiusd
install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/radiusd
+ install -m755 -D setup-freeradius "$pkgdir"/usr/sbin/setup-freeradius
# Install misses to create this
mkdir -p "$pkgdir"$_radmodsconfdir/sql/ippool-dhcp/postgresql
+ # Default modules are enabled by post-install script.
+ # The reason for this is that when we include these symlinks
+ # in the package, the user basically cannot permanently disable any
+ # default module by removing the symlink because apk will install them
+ # back on every upgrade of the package.
+ rm -f "$pkgdir"$_radconfdir/mods-enabled/*
+
# Remove unneeded and unused stuff (e.g. for disabled modules).
rm -f "$pkgdir"/usr/sbin/rc.radiusd
@@ -189,7 +204,6 @@ eap() {
amove usr/bin/radeapclient
amove $_radmodsdir/eap $_radmodsdir/inner-eap
- amove $_radconfdir/mods-enabled/eap
amove $_radconfdir/sites-available/check-eap-tls
}
@@ -355,8 +369,11 @@ _mvdb() {
sha512sums="513ed0a5d9e6b9a8d89a9b02c86ff528a9ff14d928f4c1040ca44702465abd711588fe6afa35554cb2c8e8bd7f19dd5be3dbc78445c62c7b00bf5cbc4c621312 freeradius-server-3.0.20.tar.gz
e248159c0a44f722e405c51c8015d9ad672e42ad0d38ca28f8a051ff911aa4d3e630b9bd4543e9d610940bc4ae50c022594e219ce341b36abe85c572acad418b freeradius.confd
ba3c424d4eabb147c7aa3e31575a87ddb26b6a792d2a8714e73d8763e07854326a03a83991a7420246ca06bf0b93d0a6f23ec198f5e48647f9d25b40067e852a freeradius.initd
+51f47db8dce93c4c4984093e8256bd0fb4d9c511fbbce610ef72478d8b216fb828fee3f70ae124d44c2a60b35d7792d05602480826845bb5bd4847ef6f745d84 setup-freeradius.in
+5f940e200aa39b2fbbfaf5b24f2ad99869fa75bb7e2008876940ea96cb9dbc7f2b27dd1672aa56cdb5243faabdcbc38875594dd8792af965987183c0aa2aefd1 print-var.mk
c49e5eec7497fccde5fd09dba1ea9b846e57bc88015bd81640aa531fb5c9b449f37136f42c85fe1d7940c5963aed664b85da28442b388c9fb8cc27873df03b2d musl-fix-headers.patch
41d478c0e40ff82fc36232964037c1ab8ffca9fdbb7dca02ed49319906e751c133b5d7bc7773c645cec6d9d39d1de69cba25e8d59afa8d6662563dd17f35f234 fix-scopeid.patch
14fdb7176a6e76bb078f71ae494da4f675bcdd4a90cac7ac17cc34fab5107b1faef7b37c5551917e9fb81ab26fb4e2186e23766ac2bba06db911d4b3cd7fad0b default-config.patch
+096b7a89bf55da02055a5e41517b4240f74bed85b9487b5a3109b2a9e0974c5d741cd2d5ee704c1b4f2f897667e5a4543da259e407e4c6ea029164d1d8995b2e remove-eap-from-default-mods.patch
f88cb4ae335d67211c8563b6df88e20ee3729e57aa56423f99b518f83b190479b38bb189a0ab53c70ef9709a6229ccaa506ea6b79844cbfd4f2a7f0c7c292045 Fix-permissions-of-certs-in-bootstrap-fallback.patch
7ddf75901f635216b0d972c14631334a8138e0dbb021685bb6b3a996f38d232b84146c621dae541b00f6149fa401e835d1579bbacd27fad72a80bacd4391b404 fix-request_running-segfault.patch"
diff --git a/main/freeradius/freeradius.post-install b/main/freeradius/freeradius.post-install
new file mode 100644
index 0000000000..df0ae164d1
--- /dev/null
+++ b/main/freeradius/freeradius.post-install
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+setup-freeradius enable-default-mods >/dev/null 2>&1
+exit 0
diff --git a/main/freeradius/freeradius.post-upgrade b/main/freeradius/freeradius.post-upgrade
index 1a462af4a2..d047ad7a43 100644
--- a/main/freeradius/freeradius.post-upgrade
+++ b/main/freeradius/freeradius.post-upgrade
@@ -10,6 +10,8 @@ if [ "$(apk version -t "$ver_old" "3.0.20-r4")" = "<" ]; then
* freeradius-utils. DHCP module was moved into package freeradius-dhcp.
*
EOF
+
+ setup-freeradius enable-default-mods >/dev/null 2>&1
fi
exit 0
diff --git a/main/freeradius/print-var.mk b/main/freeradius/print-var.mk
new file mode 100644
index 0000000000..9a629d375b
--- /dev/null
+++ b/main/freeradius/print-var.mk
@@ -0,0 +1,2 @@
+print-%:
+ @echo '$($*)'
diff --git a/main/freeradius/remove-eap-from-default-mods.patch b/main/freeradius/remove-eap-from-default-mods.patch
new file mode 100644
index 0000000000..6b7a228288
--- /dev/null
+++ b/main/freeradius/remove-eap-from-default-mods.patch
@@ -0,0 +1,12 @@
+Because we move eap into a subpackage.
+--- a/raddb/all.mk
++++ b/raddb/all.mk
+@@ -8,7 +8,7 @@
+ LOCAL_SITES := $(addprefix raddb/sites-enabled/,$(DEFAULT_SITES))
+
+ DEFAULT_MODULES := always attr_filter cache_eap chap date \
+- detail detail.log digest dynamic_clients eap \
++ detail detail.log digest dynamic_clients \
+ echo exec expiration expr files linelog logintime \
+ mschap ntlm_auth pap passwd preprocess radutmp realm \
+ replicate soh sradutmp unix unpack utf8
diff --git a/main/freeradius/setup-freeradius.in b/main/freeradius/setup-freeradius.in
new file mode 100644
index 0000000000..b6cad29f24
--- /dev/null
+++ b/main/freeradius/setup-freeradius.in
@@ -0,0 +1,23 @@
+#!/bin/sh
+set -eu
+
+DEFAULT_MODULES='@@DEFAULT_MODULES@@'
+
+case "${1:-}" in
+ '' | -h | --help)
+ cat >&2 <<-EOF
+ Usage: $0 [-h | <action>]
+
+ Actions:
+ enable-default-mods Enable all default modules (i.e. create
+ symlinks in /etc/raddb/mods-enabled).
+
+ EOF
+ exit 2
+ ;;
+ enable-default-mods)
+ for mod in $DEFAULT_MODULES; do
+ ln -sv ../mods-available/$mod /etc/raddb/mods-enabled/$mod || true
+ done
+ ;;
+esac