summaryrefslogtreecommitdiff
path: root/community-staging/freeradius
diff options
context:
space:
mode:
authorroot <root@rshg047.dnsready.net>2011-04-30 22:33:37 +0000
committerroot <root@rshg047.dnsready.net>2011-04-30 22:33:37 +0000
commitc173ac862828a54925737fc1d90ede1dd09a312c (patch)
tree63d6b46455a4abdaf96aef59bbaa4406c6fe04f8 /community-staging/freeradius
parent693b5793b8c615601135bc04216a2ca0966087c5 (diff)
Sat Apr 30 22:33:37 UTC 2011
Diffstat (limited to 'community-staging/freeradius')
-rw-r--r--community-staging/freeradius/PKGBUILD44
-rw-r--r--community-staging/freeradius/freeradius.install22
-rw-r--r--community-staging/freeradius/krb5-build-fix.patch21
-rwxr-xr-xcommunity-staging/freeradius/radiusd43
4 files changed, 130 insertions, 0 deletions
diff --git a/community-staging/freeradius/PKGBUILD b/community-staging/freeradius/PKGBUILD
new file mode 100644
index 000000000..3727a8cb3
--- /dev/null
+++ b/community-staging/freeradius/PKGBUILD
@@ -0,0 +1,44 @@
+# $Id: PKGBUILD 45793 2011-04-29 10:36:54Z spupykin $
+# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
+# Contributor: Jason R Begley (jayray@digitalgoat.com>
+
+pkgname=freeradius
+pkgver=2.1.10
+pkgrel=6
+pkgdesc="The premier open source RADIUS server"
+arch=('i686' 'x86_64')
+url="http://www.freeradius.org/"
+license=("GPL")
+depends=('openssl' 'krb5' 'pth' 'libldap>=2.4.18' 'net-snmp' 'pam' \
+ 'postgresql-libs>=9.0.3' 'libtool' 'libmysqlclient' 'gdbm' 'shadow')
+optdepends=('libpcap' 'unixodbc' 'python2')
+options=('!libtool' 'emptydirs' '!makeflags')
+install=$pkgname.install
+source=(ftp://ftp.freeradius.org/pub/radius/freeradius-server-$pkgver.tar.bz2 \
+ radiusd
+ krb5-build-fix.patch)
+md5sums=('8ea2bd39460a06212decf2c14fdf3fb8'
+ 'f1a6530b1b69d2fa793aa45b2de379bb'
+ 'c6a61de7576933f59154a53bfc12a2d2')
+
+build() {
+ cd $srcdir/freeradius-server-$pkgver
+ export CFLAGS="$CFLAGS -fno-strict-aliasing"
+ sed -i 's/ -DKRB5_DEPRECATED//' src/modules/rlm_krb5/Makefile.in
+ patch -p1 <$srcdir/krb5-build-fix.patch
+ ./configure --with-system-libtool --with-system-libltdl \
+ --prefix=/usr --enable-heimdal-krb5 \
+ --localstatedir=/var \
+ --sysconfdir=/etc \
+ --libdir=/usr/lib/freeradius
+ make
+}
+
+package() {
+ cd $srcdir/freeradius-server-$pkgver
+ make install R=$pkgdir
+ install -D -m755 ../radiusd $pkgdir/etc/rc.d/radiusd
+ chmod o+r $pkgdir/etc/raddb/*
+ mv $pkgdir/etc/raddb $pkgdir/etc/raddb.default
+ rm -rf $pkgdir/var/run
+}
diff --git a/community-staging/freeradius/freeradius.install b/community-staging/freeradius/freeradius.install
new file mode 100644
index 000000000..e50aa403d
--- /dev/null
+++ b/community-staging/freeradius/freeradius.install
@@ -0,0 +1,22 @@
+post_install() {
+ groupadd radiusd
+ useradd -m -d /var/lib/radiusd -g radiusd -s /bin/false radiusd
+
+ touch /var/log/radius/radius.log
+ chown -R radiusd.radiusd /var/log/radius/radius.log
+
+ [ -d /etc/raddb ] || cp -a /etc/raddb.default /etc/raddb
+
+ /bin/true
+}
+
+pre_remove() {
+ /etc/rc.d/radiusd stop
+ /bin/true
+}
+
+post_remove() {
+ userdel radiusd
+ groupdel radiusd
+ /bin/true
+}
diff --git a/community-staging/freeradius/krb5-build-fix.patch b/community-staging/freeradius/krb5-build-fix.patch
new file mode 100644
index 000000000..11dae7090
--- /dev/null
+++ b/community-staging/freeradius/krb5-build-fix.patch
@@ -0,0 +1,21 @@
+diff -wbBur freeradius-server-2.1.10/src/modules/rlm_krb5/rlm_krb5.c freeradius-server-2.1.10.my/src/modules/rlm_krb5/rlm_krb5.c
+--- freeradius-server-2.1.10/src/modules/rlm_krb5/rlm_krb5.c 2010-09-28 11:03:56.000000000 +0000
++++ freeradius-server-2.1.10.my/src/modules/rlm_krb5/rlm_krb5.c 2011-04-29 09:26:10.000000000 +0000
+@@ -375,7 +375,7 @@
+ * Heimdal krb5 verification
+ */
+ radlog(L_AUTH, "rlm_krb5: Parsed name is: %s@%s\n",
+- *userP->name.name_string.val,
++ "-" /* *userP->name.name_string.val*/,
+ userP->realm);
+
+ krb5_cc_default(context, &id);
+@@ -390,7 +390,7 @@
+
+ radlog(L_AUTH, "rlm_krb5: failed verify_user: %s (%s@%s )",
+ error_message(ret),
+- *userP->name.name_string.val,
++ "-" /* *userP->name.name_string.val */,
+ userP->realm);
+
+ return RLM_MODULE_REJECT;
diff --git a/community-staging/freeradius/radiusd b/community-staging/freeradius/radiusd
new file mode 100755
index 000000000..bf872b6f2
--- /dev/null
+++ b/community-staging/freeradius/radiusd
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=`pidof -o %PPID /usr/sbin/radiusd`
+case "$1" in
+ start)
+ stat_busy "Starting radiusd Server"
+
+ [ -d /var/run/radiusd ] || mkdir -p /var/run/radiusd
+ [ -f /var/run/radiusd/radiusd.pid ] || touch /var/run/radiusd/radiusd.pid
+ chown -R radiusd.radiusd /var/run/radiusd
+
+ [ -z "$PID" ] && /usr/sbin/radiusd
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ echo $PID > /var/run/radiusd.pid
+ add_daemon radiusd
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping radiusd Server"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm /var/run/radiusd.pid
+ rm_daemon radiusd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0