aboutsummaryrefslogtreecommitdiffstats
path: root/testing/freeradius/APKBUILD
blob: 03ba965242dead960a70832b466f56f986d2a3d3 (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
# Contributor: 
# Maintainer: Leonardo Arena <rnalrd@gmail.com>
pkgname=freeradius
pkgver=2.1.10
pkgrel=2
pkgdesc="RADIUS (Remote Authentication Dial-In User Service) server"
url="http://freeradius.org/"
license="GPL"
depends=
makedepends="openssl-dev pth-dev mysql-dev postgresql-dev gdbm-dev readline-dev
	bash libtool autoconf automake perl-dev python-dev
	"
pkggroups="radiusd"
pkgusers="radiusd"
install="freeradius.pre-install"
subpackages="$pkgname-doc $pkgname-dev"
source="ftp://ftp.freeradius.org/pub/freeradius/$pkgname-server-$pkgver.tar.gz
	freeradius.confd
	freeradius.initd
	freeradius-2.1.7-pkglibdir.patch
	"

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

prepare() {
	cd "$_builddir"
	for i in ../*.patch; do
		msg "Applying $i"
		patch -p1 -i $i || return 1
	done
	
	# we dont have libnsl
	sed -i -e 's/-lnsl //g' configure
	sed -i -e 's/nsl, //g' configure.in

	aclocal && ./autogen.sh || return 1
}

build() {
	cd "$_builddir"
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
                --localstatedir=/var \
		--disable-static \
		--enable-shared \
		--disable-ltdl-install \
		--disable-nsl \
		--with-system-libltdl \
		--with-system-libtool \
		--with-udpfromto \
		|| return 1

	# workaround parallel build issue
	make -j1 || return 1
}

package() {
	cd "$_builddir"
	install -d -m0750 -o root -g radiusd "$pkgdir"/etc/raddb
	install -d -m0750 -o root -g radiusd "$pkgdir"/var/run/radius
	install -d -m0750 -o root -g radiusd "$pkgdir"/var/log/radius
	install -d -m0750 -o root -g radiusd "$pkgdir"/var/log/radius/radacct

	make -j1 R="$pkgdir" install
	sed -i -e 's:^#user *= *nobody:user = radiusd:;s:^#group *= *nobody:group = radiusd:' \
		"$pkgdir"/etc/raddb/radiusd.conf
	chown -R root:radiusd "$pkgdir"/etc/raddb/*
	rm -f "$pkgdir/usr/sbin/rc.radiusd"
	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname

}

md5sums="e552704fc1b46d51176e575afa96dcc6  freeradius-server-2.1.10.tar.gz
fc6693f3df5a0694610110287a28568a  freeradius.confd
b22092fcdcb61d7f0b8e13a007c444c5  freeradius.initd
4c8af50e174d392c0210cbf494cd15cd  freeradius-2.1.7-pkglibdir.patch"