diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/freeradius/0001-Fix-detection-of-TLS-for-uClibc.patch | 33 | ||||
-rw-r--r-- | main/freeradius/APKBUILD | 146 | ||||
-rw-r--r-- | main/freeradius/freeradius-2.1.6-nothreads.patch | 13 | ||||
-rw-r--r-- | main/freeradius/freeradius-2.1.7-pkglibdir.patch | 63 | ||||
-rw-r--r-- | main/freeradius/freeradius.confd | 5 | ||||
-rw-r--r-- | main/freeradius/freeradius.initd | 70 | ||||
-rw-r--r-- | main/freeradius/freeradius.pre-install | 6 |
7 files changed, 336 insertions, 0 deletions
diff --git a/main/freeradius/0001-Fix-detection-of-TLS-for-uClibc.patch b/main/freeradius/0001-Fix-detection-of-TLS-for-uClibc.patch new file mode 100644 index 0000000000..e76571a21c --- /dev/null +++ b/main/freeradius/0001-Fix-detection-of-TLS-for-uClibc.patch @@ -0,0 +1,33 @@ +From 51cb058c6a9472585622582d16e01c5540627c25 Mon Sep 17 00:00:00 2001 +From: Natanael Copa <ncopa@alpinelinux.org> +Date: Tue, 13 Oct 2009 12:53:38 +0000 +Subject: [PATCH] Fix detection of TLS for uClibc + +On uClibc the configure script will wrongly detect that TLS is +available. This happends becuase the variable val in the test program +is optimized away and missing during link time. + +This patch make sure that the variable val is not optimized away so +configure correctly will detect that TLS is missing on uClibc. + +Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> +--- + acinclude.m4 | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/acinclude.m4 b/acinclude.m4 +index 6025474..100e5b0 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -382,7 +382,7 @@ m4_pushdef([AC_OUTPUT], + AC_DEFUN([FR_TLS], + [ + AC_MSG_CHECKING(for TLS) +- AC_RUN_IFELSE([AC_LANG_SOURCE([[ static __thread int val; int main() { return 0; } ]])],[have_tls=yes],[have_tls=no],[have_tls=no ]) ++ AC_RUN_IFELSE([AC_LANG_SOURCE([[ static __thread int val; int main(int argc, char *argv[]) { return val = argc; } ]])],[have_tls=yes],[have_tls=no],[have_tls=no ]) + AC_MSG_RESULT($have_tls) + if test "$have_tls" = "yes"; then + AC_DEFINE([HAVE_THREAD_TLS],[1],[Define if the compiler supports __thread]) +-- +1.6.4.4 + diff --git a/main/freeradius/APKBUILD b/main/freeradius/APKBUILD new file mode 100644 index 0000000000..272b0219be --- /dev/null +++ b/main/freeradius/APKBUILD @@ -0,0 +1,146 @@ +# Contributor: +# Maintainer: Leonardo Arena <rnalrd@gmail.com> +pkgname=freeradius +pkgver=2.1.10 +pkgrel=13 +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 openldap-dev unixodbc-dev" +pkggroups="radiusd" +pkgusers="radiusd" +install="freeradius.pre-install" +subpackages="$pkgname-doc $pkgname-dev $pkgname-ldap $pkgname-mssql \ + $pkgname-mysql $pkgname-oracle $pkgname-perl $pkgname-postgresql \ + $pkgname-python $pkgname-unixodbc" +source="ftp://ftp.freeradius.org/pub/freeradius/$pkgname-server-$pkgver.tar.gz + freeradius.confd + freeradius.initd + " + +_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 's/-lnsl //g' configure || return 1 + sed -i 's/nsl, //g' configure.in || return 1 + + # Fix compilation with heimdal >= 1.3.1 + sed -i 's/ -DKRB5_DEPRECATED//' src/modules/rlm_krb5/Makefile.in || return 1 + + # Fix default config + sed -i 's%run_dir = .*%run_dir = \$\{localstatedir\}/run/radius%' \ + raddb/radiusd.conf.in || return 1 + + aclocal && ./autogen.sh || return 1 +} + +build() { + cd "$_builddir" + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --localstatedir=/var \ + --libdir=/usr/lib/freeradius \ + --disable-static \ + --enable-shared \ + --disable-ltdl-install \ + --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 -m0770 -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/radiusd + install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/radiusd + install -m644 -D scripts/logrotate.freeradius "$pkgdir"/etc/lorotate.d/$pkgname +} + +ldap() { + depends="freeradius" + mkdir -p $subpkgdir/etc/raddb + mv $pkgdir/etc/raddb/ldap.attrmap $subpkgdir/etc/raddb + mkdir -p $subpkgdir/etc/raddb/modules + mv $pkgdir/etc/raddb/modules/ldap $subpkgdir/etc/raddb/modules + mkdir -p $subpkgdir/usr/lib/freeradius + mv $pkgdir/usr/lib/freeradius/rlm_ldap* $subpkgdir/usr/lib/freeradius +} + +mysql() { + depends="freeradius" + mkdir -p $subpkgdir/etc/raddb/sql + mv $pkgdir/etc/raddb/sql/mysql $subpkgdir/etc/raddb/sql + mv $pkgdir/etc/raddb/sql/ndb $subpkgdir/etc/raddb/sql + mkdir -p $subpkgdir/usr/lib/freeradius + mv $pkgdir/usr/lib/freeradius/rlm_sql_mysql* $subpkgdir/usr/lib/freeradius +} + +mssql() { + depends="freeradius" + mkdir -p $subpkgdir/etc/raddb/sql + mv $pkgdir/etc/raddb/sql/mssql $subpkgdir/etc/raddb/sql +} + +oracle() { + depends="freeradius" + mkdir -p $subpkgdir/etc/raddb/sql + mv $pkgdir/etc/raddb/sql/oracle $subpkgdir/etc/raddb/sql +} + +perl() { + depends="freeradius perl" + mkdir -p $subpkgdir/usr/lib/freeradius + mv $pkgdir/usr/lib/freeradius/rlm_perl* $subpkgdir/usr/lib/freeradius + mkdir -p $subpkgdir/usr/bin + mv $pkgdir/usr/sbin/checkrad $subpkgdir/usr/bin/checkrad + mkdir -p $subpkgdir/etc/raddb/modules + mv $pkgdir/etc/raddb/modules/perl $subpkgdir/etc/raddb/modules/perl +} + +postgresql() { + depends="freeradius" + mkdir -p $subpkgdir/etc/raddb/sql + mv $pkgdir/etc/raddb/sql/postgresql $subpkgdir/etc/raddb/sql + mkdir -p $subpkgdir/usr/lib/freeradius + mv $pkgdir/usr/lib/freeradius/rlm_sql_postgresql* $subpkgdir/usr/lib/freeradius +} + +python() { + depends="freeradius python" + mkdir -p $subpkgdir/usr/lib/freeradius + mv $pkgdir/usr/lib/freeradius/rlm_python* $subpkgdir/usr/lib/freeradius +} + +unixodbc() { + depends="freeradius" + mkdir -p $subpkgdir/usr/lib/freeradius + mv $pkgdir/usr/lib/freeradius/rlm_sql_unixodbc* $subpkgdir/usr/lib/freeradius +} + +md5sums="e552704fc1b46d51176e575afa96dcc6 freeradius-server-2.1.10.tar.gz +fc6693f3df5a0694610110287a28568a freeradius.confd +6cd5d02575f514a51d741dba3f7c70d2 freeradius.initd" diff --git a/main/freeradius/freeradius-2.1.6-nothreads.patch b/main/freeradius/freeradius-2.1.6-nothreads.patch new file mode 100644 index 0000000000..41a41c8d6e --- /dev/null +++ b/main/freeradius/freeradius-2.1.6-nothreads.patch @@ -0,0 +1,13 @@ +diff -Nru freeradius-server-2.1.6.orig/src/main/event.c freeradius-server-2.1.6/src/main/event.c +--- freeradius-server-2.1.6.orig/src/main/event.c 2009-05-18 13:13:55.000000000 +0200 ++++ freeradius-server-2.1.6/src/main/event.c 2009-09-05 07:52:42.000000000 +0200 +@@ -1667,7 +1667,9 @@ + */ + request->num_proxied_requests = 1; + request->num_proxied_responses = 0; ++#ifdef HAVE_PTHREAD_H + request->child_pid = NO_SUCH_CHILD_PID; ++#endif + + update_event_timestamp(request->proxy, request->proxy_when.tv_sec); + diff --git a/main/freeradius/freeradius-2.1.7-pkglibdir.patch b/main/freeradius/freeradius-2.1.7-pkglibdir.patch new file mode 100644 index 0000000000..d5767fbd02 --- /dev/null +++ b/main/freeradius/freeradius-2.1.7-pkglibdir.patch @@ -0,0 +1,63 @@ +diff -ru freeradius-server-2.1.7.orig/Make.inc.in freeradius-server-2.1.7/Make.inc.in +--- freeradius-server-2.1.7.orig/Make.inc.in 2009-10-09 08:38:58.000000000 +0000 ++++ freeradius-server-2.1.7/Make.inc.in 2009-10-09 08:39:15.000000000 +0000 +@@ -10,6 +10,7 @@ + sysconfdir = @sysconfdir@ + localstatedir = @localstatedir@ + libdir = @libdir@ ++pkglibdir = @libdir@/freeradius + bindir = @bindir@ + sbindir = @sbindir@ + docdir = @docdir@ +diff -ru freeradius-server-2.1.7.orig/raddb/radiusd.conf.in freeradius-server-2.1.7/raddb/radiusd.conf.in +--- freeradius-server-2.1.7.orig/raddb/radiusd.conf.in 2009-10-09 08:38:58.000000000 +0000 ++++ freeradius-server-2.1.7/raddb/radiusd.conf.in 2009-10-09 08:39:15.000000000 +0000 +@@ -103,7 +103,7 @@ + # make + # make install + # +-libdir = @libdir@ ++libdir = @libdir@/freeradius + + # pidfile: Where to place the PID of the RADIUS server. + # +diff -ru freeradius-server-2.1.7.orig/src/modules/Makefile freeradius-server-2.1.7/src/modules/Makefile +--- freeradius-server-2.1.7.orig/src/modules/Makefile 2009-10-09 08:38:58.000000000 +0000 ++++ freeradius-server-2.1.7/src/modules/Makefile 2009-10-09 08:39:15.000000000 +0000 +@@ -12,7 +12,7 @@ + @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common + + install: +- $(INSTALL) -d -m 755 $(R)$(libdir) ++ $(INSTALL) -d -m 755 $(R)$(pkglibdir) + @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common + + clean: +diff -ru freeradius-server-2.1.7.orig/src/modules/rules.mak freeradius-server-2.1.7/src/modules/rules.mak +--- freeradius-server-2.1.7.orig/src/modules/rules.mak 2009-10-09 08:38:58.000000000 +0000 ++++ freeradius-server-2.1.7/src/modules/rules.mak 2009-10-09 08:40:56.000000000 +0000 +@@ -123,7 +123,7 @@ + $(TARGET).la: $(LT_OBJS) + $(LIBTOOL) --mode=link $(CC) -release $(RADIUSD_VERSION) \ + -module $(LINK_MODE) $(LDFLAGS) $(RLM_LDFLAGS) -o $@ \ +- -rpath $(libdir) $^ $(LIBRADIUS) $(RLM_LIBS) $(LIBS) ++ -rpath $(pkglibdir) $^ $(LIBRADIUS) $(RLM_LIBS) $(LIBS) + + ####################################################################### + # +@@ -164,13 +164,13 @@ + # Do any module-specific installation. + # + # If there isn't a TARGET defined, then don't do anything. +-# Otherwise, install the libraries into $(libdir) ++# Otherwise, install the libraries into $(pkglibdir) + # + install: + @[ "x$(RLM_INSTALL)" = "x" ] || $(MAKE) $(MFLAGS) $(RLM_INSTALL) + if [ "x$(TARGET)" != "x" ]; then \ + $(LIBTOOL) --mode=install $(INSTALL) -c \ +- $(TARGET).la $(R)$(libdir)/$(TARGET).la || exit $$?; \ ++ $(TARGET).la $(R)$(pkglibdir)/$(TARGET).la || exit $$?; \ + rm -f $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION).la; \ + ln -s $(TARGET).la $(R)$(libdir)/$(TARGET)-$(RADIUSD_VERSION).la || exit $$?; \ + fi diff --git a/main/freeradius/freeradius.confd b/main/freeradius/freeradius.confd new file mode 100644 index 0000000000..9811289ba4 --- /dev/null +++ b/main/freeradius/freeradius.confd @@ -0,0 +1,5 @@ +# Config file for /etc/init.d/radiusd + +# see man pages for radiusd run `radiusd -h` +# for valid cmdline options +#RADIUSD_OPTS="" diff --git a/main/freeradius/freeradius.initd b/main/freeradius/freeradius.initd new file mode 100644 index 0000000000..2386a9fcc4 --- /dev/null +++ b/main/freeradius/freeradius.initd @@ -0,0 +1,70 @@ +#!/sbin/runscript + +opts="${opts} reload" + +depend() { + need net + after firewall + use dns +} + +checkconfig() { + #set the location of log files, including startup.log created by check-radiusd-config + if ! cd /var/log/radius ; then + eerror "Failed to change current directory to /var/log/radius" + return 1 + fi + + if [ ! -d /var/run/radiusd ] && ! mkdir /var/run/radiusd ; then + eerror "Failed to create /var/run/radiusd" + return 1 + fi + + if [ ! -f /etc/raddb/radiusd.conf ] ; then + eerror "No /etc/raddb/radiusd.conf file exists!" + return 1 + fi + + if [ "`/usr/sbin/radiusd -C >/dev/null 2>&1; echo $?`" != "0" ] ; then + eerror "Config not ok! (try /usr/sbin/radiusd -C )" + return 1 + fi + + RADIUSD_USER=`grep '^ *user *=' /etc/raddb/radiusd.conf | cut -d ' ' -f 3` + RADIUSD_GROUP=`grep '^ *group *=' /etc/raddb/radiusd.conf | cut -d ' ' -f 3` + if [ -n "${RADIUSD_USER}" ] && ! getent passwd ${RADIUSD_USER} > /dev/null ; then + eerror "${RADIUSD_USER} user missing!" + return 1 + fi + if [ -n "${RADIUSD_GROUP}" ] && ! getent group ${RADIUSD_GROUP} > /dev/null ; then + eerror "${RADIUSD_GROUP} group missing!" + return 1 + fi + + #radius.log is created before privileges drop; we need to set proper permissions on it + [ -f radius.log ] || touch radius.log || return 1 + + chown -R "${RADIUSD_USER:-root}:${RADIUSD_GROUP:-root}" . /var/run/radiusd && \ + chmod -R u+rwX,g+rX . /var/run/radiusd || return 1 +} + +start() { + checkconfig || return 1 + + ebegin "Starting radiusd" + start-stop-daemon --start --quiet --exec /usr/sbin/radiusd -- ${RADIUSD_OPTS} >/dev/null + eend $? +} + +stop () { + ebegin "Stopping radiusd" + start-stop-daemon --stop --quiet --pidfile=/var/run/radiusd/radiusd.pid + eend $? +} + +reload () { + ebegin "Reloading radiusd" + kill -HUP `</var/run/radiusd/radiusd.pid` + eend $? +} + diff --git a/main/freeradius/freeradius.pre-install b/main/freeradius/freeradius.pre-install new file mode 100644 index 0000000000..04c48bb3fe --- /dev/null +++ b/main/freeradius/freeradius.pre-install @@ -0,0 +1,6 @@ +#!/bin/sh + +addgroup radiusd 2>/dev/null +adduser -S -G radiusd -h /var/log/radius -s /bin/false -D radiusd 2>/dev/null +exit 0 + |