From c173ac862828a54925737fc1d90ede1dd09a312c Mon Sep 17 00:00:00 2001 From: root Date: Sat, 30 Apr 2011 22:33:37 +0000 Subject: Sat Apr 30 22:33:37 UTC 2011 --- community-staging/freeradius/PKGBUILD | 44 +++++++++++++++++++++++ community-staging/freeradius/freeradius.install | 22 ++++++++++++ community-staging/freeradius/krb5-build-fix.patch | 21 +++++++++++ community-staging/freeradius/radiusd | 43 ++++++++++++++++++++++ 4 files changed, 130 insertions(+) create mode 100644 community-staging/freeradius/PKGBUILD create mode 100644 community-staging/freeradius/freeradius.install create mode 100644 community-staging/freeradius/krb5-build-fix.patch create mode 100755 community-staging/freeradius/radiusd (limited to 'community-staging/freeradius') 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 +# 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 -- cgit v1.2.3-54-g00ecf