aboutsummaryrefslogtreecommitdiffstats
path: root/main/freeradius3/APKBUILD
blob: b2fe30ddcbea36bc853d741cb7412fd407dd62ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=freeradius3
_realname=freeradius
pkgver=3.0.7
pkgrel=0
pkgdesc="RADIUS (Remote Authentication Dial-In User Service) server"
url="http://freeradius.org/"
arch="all"
license="GPL"
depends="freeradius3-lib"
makedepends="openssl-dev mariadb-dev postgresql-dev gdbm-dev readline-dev
	bash libtool autoconf automake perl-dev python-dev openldap-dev
	unixodbc-dev linux-pam-dev sqlite-dev talloc-dev libpcap-dev
	linux-headers"
pkggroups="radius"
pkgusers="radius"
install="$pkgname.pre-install"
subpackages="$pkgname-doc $pkgname-dev $pkgname-dbg $pkgname-ldap $pkgname-lib
	$pkgname-mssql $pkgname-mysql $pkgname-sql $pkgname-perl
	$pkgname-postgresql $pkgname-python $pkgname-radclient $pkgname-sqlite
	$pkgname-unixodbc $pkgname-pam $pkgname-eap $pkgname-dbg"
source="ftp://ftp.freeradius.org/pub/freeradius/$_realname-server-$pkgver.tar.gz
	$pkgname.confd
	$pkgname.initd
	musl-fix-headers.patch
	disable-cert-generation.patch
	freeradius3-305-default-config.patch
	"
conflict="freeradius freeradius-lib freeradius-radclient"

_builddir="$srcdir"/$_realname-server-$pkgver

radconfdir="/etc/raddb"
radmodsdir="$radconfdir/mods-available"
radlibdir="/usr/lib/freeradius"
radmodsconfdir="$radconfdir/mods-config"

prepare() {
	cd "$_builddir"
        for i in $source; do
                case $i in
                *.patch)
                        msg "Applying $i"
                        patch -p1 -i "$srcdir"/$i || return 1
                        ;;
                esac
        done
	update_config_sub || return 1
	# remove certs generation
	# rm -rf raddb/certs || return 1
}

build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--datarootdir=/usr/share \
		--libdir="$radlibdir" \
		--with-logdir=/var/log/radius \
		--with-radacctdir=/var/log/radius/radacct \
		--with-system-libtool \
		--with-system-libltdl \
		--with-shared-libs \
		--with-udpfromto \
                --with-rlm_sql_sqlite \
                --with-rlm_sql_postgresql \
                --with-rlm_sql_mysql \
		--without-rlm_krb5 \
		--without-rlm_eap_tnc \
		--without-rlm_eap_ikev2 \
		--without-rlm_sql_iodbc \
		--without-rlm_sql_oracle \
		--without-rlm_yubikey \
		--without-rlm_ykclient \
		|| return 1

	make -j1 LDFLAGS="$LDFLAGS -lssl" || return 1
}

package() {
	cd "$_builddir"
	install -d -m0750 -o root -g radius \
		"${pkgdir}"${radconfdir} || return 1
	install -d -m0750 -o radius -g radius \
		"$pkgdir"/var/run/radius || return 1
	install -d -m0750 -o radius -g radius \
		"$pkgdir"/var/log/radius || return 1
	install -d -m0750 -o radius -g radius \
		"$pkgdir"/var/log/radius/radacct || return 1

	make -j1 R="$pkgdir" install || return 1
	chown -R root:radius "$pkgdir"/etc/raddb/*
	rm -f "$pkgdir"/usr/sbin/rc.radiusd
	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/radiusd || return 1
	install -m644 -D "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/radiusd || return 1
	#Install misses to create this
	mkdir -p "${pkgdir}"${radmodsconfdir}/sql/ippool-dhcp/postgresql
	find "$pkgdir" -iname *.la -delete
}

_mvdb() {
	for dir in ippool-dhcp ippool counter main cui; do
		mkdir -p "${subpkgdir}"${radmodsconfdir}/sql/$dir
		mv "${pkgdir}"${radmodsconfdir}/sql/$dir/$1 \
		 "${subpkgdir}"${radmodsconfdir}/sql/$dir || return 1
	done
	mkdir -p "${subpkgdir}"${radlibdir}
	mv "${pkgdir}"${radlibdir}/rlm_sql_${1}.so "${subpkgdir}"${radlibdir} \
		|| return 1
}

eap() {
	depends="freeradius3"
	mkdir -p "${subpkgdir}"${radlibdir}
	mv "${pkgdir}"${radlibdir}/rlm_eap*.so "${subpkgdir}"${radlibdir} \
		|| return 1
	mkdir -p "${subpkgdir}"${radmodsdir}
	mv "${pkgdir}"${radmodsdir}/eap "${subpkgdir}"${radmodsdir} || return 1
	mkdir -p "${subpkgdir}"${radconfdir}
	mv "${pkgdir}"${radconfdir}/certs "${subpkgdir}"${radconfdir} || return 1
}

ldap() {
	depends="freeradius3"
	mkdir -p "${subpkgdir}"${radlibdir}
	mv "${pkgdir}"${radlibdir}/rlm_ldap* "${subpkgdir}"${radlibdir} \
		|| return 1
}

lib() {
	depends=""
	pkgdesc="Freeradius shared libraries"
	mkdir -p "${subpkgdir}"${radlibdir} "${subpkgdir}"${radconfdir} \
	 "$subpkgdir"/usr/share/freeradius || return 1
	mv "${pkgdir}"${radlibdir}/libfreeradius-*.so \
	 "${subpkgdir}"${radlibdir} || return 1
	mv "${pkgdir}"/usr/share/freeradius/* \
	 "${subpkgdir}"/usr/share/freeradius || return 1
}

sql() {
	depends="freeradius3"
	mkdir -p "${subpkgdir}"${radlibdir}
	for lib in sql sqlippool sql_null sqlcounter; do
		mv "${pkgdir}"${radlibdir}/rlm_${lib}.so \
			"${subpkgdir}"${radlibdir} || return 1
	done
	mkdir -p "${subpkgdir}"${radconfdir}/sites-available
	mv "${pkgdir}"${radconfdir}/sites-available/buffered-sql \
	 "${subpkgdir}"${radconfdir}/sites-available || return 1
	mkdir -p "${subpkgdir}"${radmodsdir}
	mv "${pkgdir}"${radmodsdir}/*sql* "${subpkgdir}"${radmodsdir} \
		|| return 1
}

mysql() {
	depends="freeradius3-sql"
	_mvdb mysql || return 1
}

mssql() {
	depends="freeradius3-sql"
	arch="noarch"
	mkdir -p "${subpkgdir}"${radmodsconfdir}/sql/main
	mv "${pkgdir}"${radmodsconfdir}/sql/main/mssql \
	 "${subpkgdir}"${radmodsconfdir}/sql/main || return 1
}

perl() {
	depends="freeradius3 perl"
	mkdir -p "${subpkgdir}"${radlibdir}
	mv "${pkgdir}"${radlibdir}/rlm_perl* "${subpkgdir}"${radlibdir} \
		|| return 1
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/sbin/checkrad "$subpkgdir"/usr/bin/checkrad \
		|| return 1
	mkdir -p "${subpkgdir}"${radconfdir}/mods-available
	mv "${pkgdir}"${radconfdir}/mods-available/perl \
		"${subpkgdir}"${radconfdir}/mods-available/perl || return 1
}

postgresql() {
	depends="freeradius3-sql"
	_mvdb postgresql || return 1
}

python() {
	depends="freeradius3 python"
	mkdir -p "${subpkgdir}"${radlibdir}
	mv "${pkgdir}"${radlibdir}/rlm_python* "${subpkgdir}"${radlibdir} \
		|| return 1
	for dir in $radmodsdir $radmodsconfdir; do
		mkdir -p "${subpkgdir}"$dir
		mv "${pkgdir}"$dir/python "${subpkgdir}"$dir || return 1
	done
}

radclient() {
	depends=""
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/radclient "$subpkgdir"/usr/bin/radclient \
		|| return 1
}

sqlite() {
	depends="freeradius3-sql"
	_mvdb sqlite || return 1
}

unixodbc() {
	depends="freeradius3"
	mkdir -p "${subpkgdir}"${radlibdir}
	mv "${pkgdir}"${radlibdir}/rlm_sql_unixodbc.so \
		"${subpkgdir}"${radlibdir} || return 1
}

pam() {
	depends="freeradius3"
	mkdir -p "${subpkgdir}"${radlibdir}
	mv "${pkgdir}"${radlibdir}/rlm_pam* "${subpkgdir}"${radlibdir} \
		|| return 1
}

md5sums="e72a378fd8668e9b76b243e70bad0798  freeradius-server-3.0.7.tar.gz
fc6693f3df5a0694610110287a28568a  freeradius3.confd
3a50b7f233e74daf3f87da63b3e9579d  freeradius3.initd
d86558365a1deea4914ed139797805b0  musl-fix-headers.patch
ecd9ecfba4cf86a203de6faf8398c44a  disable-cert-generation.patch
13bc93b64d4d6517539a3ffc13a40872  freeradius3-305-default-config.patch"
sha256sums="6d4d2f5cd9e8ca49da66f8a1e706eaad791be342d7f89fbfa167a6b648028ded  freeradius-server-3.0.7.tar.gz
2d5b3e1af1299373182f2c8021bdf45c29db5d82b0a077b965a16ded32cb6292  freeradius3.confd
e173cce3b8a4c2ed4d1fdd58fff8ec21e9166f011ec052f5f4c01712493e72b3  freeradius3.initd
872aaebf86a663f819460d98924a9dc1f3e428facac6930dc98d1e442df1633f  musl-fix-headers.patch
008fa3a4da7b3c01df238bf492a8ccda4077289c02c553a60ad8f4439ec136a2  disable-cert-generation.patch
72235e434642950ebc3e6f31398a16dd7d4f17813f849d6b1114064b91bd0cab  freeradius3-305-default-config.patch"
sha512sums="9eeb10bc7aa80eea04aca139ae8d23f1d87324a78794a52a7f3d8f8b986af9d68ea463457690a4de39e8744ccf910a43e3a5074bbcfd3a9cc0df19c0e7464acd  freeradius-server-3.0.7.tar.gz
e248159c0a44f722e405c51c8015d9ad672e42ad0d38ca28f8a051ff911aa4d3e630b9bd4543e9d610940bc4ae50c022594e219ce341b36abe85c572acad418b  freeradius3.confd
b29bf9090a2be7af77a3e104346a23024baf78a343e7f2fd6f6ddb02c223ac66d9b77c80d02b2cb26cbef2e64cb59c46462bb54b063b862e5a3a61c72653a63d  freeradius3.initd
c49e5eec7497fccde5fd09dba1ea9b846e57bc88015bd81640aa531fb5c9b449f37136f42c85fe1d7940c5963aed664b85da28442b388c9fb8cc27873df03b2d  musl-fix-headers.patch
09b78c6baa992f82ab81c43aad6792536a4708d460170f0a373e242a5fafe8db10662dc7fcef99a966b828ed91fa7fe38567c961c938de9a447f1ee03aebb142  disable-cert-generation.patch
b2236d3484f31e5b21232c38b10e141e2cb243e82c7e89d5221c8db8c68f268038db0d1d2dfaf8456ea40a079d486d7685ccac98982359480566ede8277ffc16  freeradius3-305-default-config.patch"