[csw-devel] SF.net SVN: gar:[17929] csw/mgar/pkg/freeradius/trunk
dmichelsen at users.sourceforge.net
dmichelsen at users.sourceforge.net
Wed May 2 15:51:14 CEST 2012
Revision: 17929
http://gar.svn.sourceforge.net/gar/?rev=17929&view=rev
Author: dmichelsen
Date: 2012-05-02 13:51:14 +0000 (Wed, 02 May 2012)
Log Message:
-----------
freeradius/trunk: Use dynamic expansion and other enhancements as suggested in #4940
Modified Paths:
--------------
csw/mgar/pkg/freeradius/trunk/Makefile
csw/mgar/pkg/freeradius/trunk/files/cswfreeradius
Modified: csw/mgar/pkg/freeradius/trunk/Makefile
===================================================================
--- csw/mgar/pkg/freeradius/trunk/Makefile 2012-05-02 13:49:34 UTC (rev 17928)
+++ csw/mgar/pkg/freeradius/trunk/Makefile 2012-05-02 13:51:14 UTC (rev 17929)
@@ -9,6 +9,7 @@
DISTFILES += $(NAME)-server-$(VERSION).tar.gz
DISTFILES += $(DISTNAME).tar.gz
DISTFILES += cswfreeradius
+EXPANDVARS += cswfreeradius
DISTFILES += server.pem
DISTFILES += ca.pem
DISTNAME = $(NAME)-server-$(VERSION)
@@ -106,9 +107,10 @@
EXTRA_MERGE_EXCLUDE_FILES += $(raddbdir)/sql/mysql/.*
## End mysql exclusion lines
-# GARCOMPILER = GCC4
+radius_user = radius
+radius_group = radius
-CSWfreeradius_usergroup = radius:radius:FreeRADIUS:/var/opt/csw/freeradius:/bin/false::
+CSWfreeradius_usergroup = $(radius_user):$(radius_group):FreeRADIUS:/var/opt/csw/freeradius:/bin/false::
# Some of the RLM Submodules don't seem to pick up the include paths from CPPFLAGS
EXTRA_CFLAGS = $(CPPFLAGS)
@@ -118,9 +120,12 @@
raddbdir = $(sysconfdir)/freeradius
-# This should match the variable run_dir in radiusd.conf
-radius_run_dir = $(localstatedir)/run/radius
+radius_rundir = $(localstatedir)/run/radiusd
+radius_rundir_perms = 0755
+radius_logdir = $(localstatedir)/log/radius
+radius_logdir_perms = 2770
+
# Configuration directory
PRESERVECONF += $(raddbdir)/.*\.conf
PRESERVECONF += $(raddbdir)/acct_users
@@ -144,10 +149,11 @@
PRESERVECONF += $(raddbdir)/sites-available/dhcp
PRESERVECONF += $(raddbdir)/sites-available/dynamic-clients
PRESERVECONF += $(raddbdir)/sites-available/example
-PRESERVECONF += $(raddbdir)/sites-available/inter-tunnel
+PRESERVECONF += $(raddbdir)/sites-available/inner-tunnel
PRESERVECONF += $(raddbdir)/sites-available/originate-coa
PRESERVECONF += $(raddbdir)/sites-available/proxy-inner-tunnel
PRESERVECONF += $(raddbdir)/sites-available/robust-proxy-accounting
+PRESERVECONF += $(raddbdir)/sites-available/soh
PRESERVECONF += $(raddbdir)/sites-available/status
PRESERVECONF += $(raddbdir)/sites-available/virtual.example.com
PRESERVECONF += $(raddbdir)/sites-available/vmps
@@ -192,15 +198,30 @@
INSTALL_ARGS += R=$(DESTDIR)
+# We add the radius user and radius group, enable them in the configuration also
+REINPLACEMENTS += radiususer
+REINPLACE_MATCH_radiususer = ^\#(user|group)
+REINPLACE_WITH_radiususer = \$$1
+REINPLACE_FILES_radiususer = $(sysconfdir)/freeradius/radiusd.conf
+REINPLACE_WHEN_radiususer = postinstall
+
INITSMF = /etc/opt/csw/init.d/cswfreeradius
# Fix permissions on the radiusd rundir (disabled for now)
PROTOTYPE_MODIFIERS += rundir
-PROTOTYPE_FILES_rundir = $(radius_run_dir)
-PROTOTYPE_USER_rundir = radius
-PROTOTYPE_GROUP_rundir = radius
+PROTOTYPE_FILES_rundir = $(radius_rundir)
+PROTOTYPE_USER_rundir = $(radius_user)
+PROTOTYPE_GROUP_rundir = $(radius_group)
+PROTOTYPE_PERMS_rundir = $(radius_rundir_perms)
PROTOTYPE_CLASS_rundir = ugfiles
+PROTOTYPE_MODIFIERS += logdir
+PROTOTYPE_FILES_logdir = $(radius_logdir)
+PROTOTYPE_USER_logdir = $(radius_user)
+PROTOTYPE_GROUP_logdir = $(radius_user)
+PROTOTYPE_PERMS_logdir = $(radius_logdir_perms)
+PROTOTYPE_CLASS_logdir = ugfiles
+
# Fix permissions on the configuration directory
PROTOTYPE_MODIFIERS += raddb
PROTOTYPE_FILES_raddb = $(raddbdir)
@@ -221,7 +242,9 @@
ginstall -m 640 $(FILEDIR)/ca.pem $(DESTDIR)/$(raddbdir)/certs/
ginstall -m 640 $(FILEDIR)/server.pem $(DESTDIR)/$(raddbdir)/certs/
@echo "Creating PID file directory"
- ginstall -d $(DESTDIR)$(radius_run_dir)
+ ginstall -d $(DESTDIR)$(radius_rundir)
@echo "Relaxing permissions on dictionary file"
chmod 644 $(DESTDIR)$(raddbdir)/dictionary
+ @echo "Commenting out experimental modules"
+ perl -npi -e 'print "#" if( !/^\s*(#.*)?$$/ )' $(DESTDIR)$(raddbdir)/experimental.conf
@$(MAKECOOKIE)
Modified: csw/mgar/pkg/freeradius/trunk/files/cswfreeradius
===================================================================
--- csw/mgar/pkg/freeradius/trunk/files/cswfreeradius 2012-05-02 13:49:34 UTC (rev 17928)
+++ csw/mgar/pkg/freeradius/trunk/files/cswfreeradius 2012-05-02 13:51:14 UTC (rev 17929)
@@ -21,13 +21,13 @@
# Additional modifications by OpenCSW
#FMRI network
-prefix=/opt/csw
-exec_prefix=/opt/csw
-sbindir=/opt/csw/sbin
-localstatedir=/var/opt/csw
-logdir=${localstatedir}/log/radius
-rundir=${localstatedir}/run/radiusd
-sysconfdir=/etc/opt/csw
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+sbindir=@sbindir@
+localstatedir=@localstatedir@
+logdir=@radius_logdir@
+rundir=@radius_rundir@
+sysconfdir=@sysconfdir@
#
# If you have issues with OpenSSL, uncomment these next lines.
@@ -41,7 +41,7 @@
#export LD_LIBRARY_PATH LD_RUN_PATH LD_PRELOAD
RADIUSD=$sbindir/radiusd
-RADDBDIR=/etc/opt/csw/raddb
+RADDBDIR=@raddbdir@
DESC="FreeRADIUS"
#
@@ -52,26 +52,25 @@
test -f $RADIUSD || exit 0
test -f $RADDBDIR/radiusd.conf || exit 0
-#if [ ! -d $rundir ] ; then
-# mkdir $rundir
-# chown radmin:radius $rundir
-# chmod 775 $rundir
-#fi
-#
-#if [ ! -d $logdir ] ; then
-# mkdir $logdir
-# chown radmin:radius $logdir
-# chmod 770 $logdir
-# chmod g+s $logdir
-#fi
-#
-#if [ ! -f $logdir/radius.log ]; then
-# touch $logdir/radius.log
-#fi
-#
-#chown radmin:radius $logdir/radius.log
-#chmod 660 $logdir/radius.log
+if [ ! -d $rundir ] ; then
+ mkdir $rundir
+ chown @radius_user@:@radius_group@ $rundir
+ chmod @radius_rundir_perms@ $rundir
+fi
+if [ ! -d $logdir ] ; then
+ mkdir $logdir
+ chown @radius_user@:@radius_group@ $logdir
+ chmod @radius_logdir_perms@ $logdir
+fi
+
+if [ ! -f $logdir/radius.log ]; then
+ touch $logdir/radius.log
+fi
+
+chown @radius_user@:@radius_group@ $logdir/radius.log
+chmod 660 $logdir/radius.log
+
case "$1" in
start)
echo -n "Starting $DESC:"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list