diff -urN radiusd-cistron-1.6-dist/redhat/radiusd-cistron-1.6.6.spec radiusd-cistron-1.6/redhat/radiusd-cistron-1.6.6.spec
--- radiusd-cistron-1.6-dist/redhat/radiusd-cistron-1.6.6.spec	2002-02-06 09:23:16.000000000 -0600
+++ radiusd-cistron-1.6/redhat/radiusd-cistron-1.6.6.spec	1969-12-31 18:00:00.000000000 -0600
@@ -1,135 +0,0 @@
-Summary: Cistron RADIUS daemon (with PAM) 
-Summary(pt_BR): Servidor RADIUS com muitas funcoes.
-Name: radiusd-cistron
-Version: 1.6.6
-Release: 1
-Source: radiusd-cistron-1.6.6.tar.gz
-URL: http://www.radius.cistron.nl/
-Copyright: GPL
-Group: Networking/Daemons
-BuildRoot: /var/tmp/%{name}-buildroot
-
-%description
-RADIUS server with a lot of functions. Short overview: 
-
-- PAM support compiled in
-- Supports access based on huntgroups
-- Multiple DEFAULT entries in users file
-- All users file entries can optionally "fall through"
-- Caches all config files in-memory
-- Keeps a list of logged in users (radutmp file)
-- "radwho" program can be installed as "fingerd"
-- Logs both UNIX "wtmp" file format and RADIUS detail logfiles
-- Supports Simultaneous-Use = X parameter. Yes, this means
-  that you can now prevent double logins!
-
-%description -l pt_BR
-Servidor RADIUS com muitas funções. Visão geral:
-
-- Suporta acesso baseado em huntgroups
-- Multiplas entradas DEFAULT no arquivo de usuarios
-- Faz cache de todos os arquivos de configuracão em memoria
-- Mantem uma lista dos usuarios conectados (arquivo radutmp)
-- O programa radwho pode ser instalado como fingerd
-- Registra tanto no formato UNIX wtmp quanto no RADIUS detail
-- Suporta o parametro Simultaneous-Use = X. Sim, isto significa
-  que você pode evitar logins duplos!, inclusive com o Cyclades PathRas
-
-%prep 
-%setup
-cd raddb
-for f in clients users naslist huntgroups ; do cp $f $f-dist ; done
-cd ..
-
-%build
-cd src
-make PAM=-DPAM PAMLIB="-lpam -ldl" CFLAGS="-Wall ${RPM_OPT_FLAGS}"
-cd ..
-
-%install
-# prepare $RPM_BUILD_ROOT
-rm -rf $RPM_BUILD_ROOT
-mkdir $RPM_BUILD_ROOT/{,etc/{,raddb,logrotate.d,pam.d,rc.d/{,init.d,rc{0,1,2,3,4,5,6}.d}},usr/{,bin,sbin,man/{,man{1,5,8}}},var/{,log/{,radacct}}}
-
-# make install
-cd src
-make install BINDIR=${RPM_BUILD_ROOT}/usr/bin SBINDIR=${RPM_BUILD_ROOT}/usr/sbin RADIUS_DIR=${RPM_BUILD_ROOT}/etc/raddb PAM_DIR=${RPM_BUILD_ROOT}/etc/pam.d MANDIR=${RPM_BUILD_ROOT}/usr/man
-cd ..
-
-# radwatch
-install -m 755 scripts/radwatch ${RPM_BUILD_ROOT}/usr/sbin/
-perl -pi -e 's#/usr/local/sbin#/usr/sbin#' ${RPM_BUILD_ROOT}/usr/sbin/radwatch
-
-# other files
-cd redhat
-install -m 555 rc.radiusd-redhat ${RPM_BUILD_ROOT}/etc/rc.d/init.d/radiusd
-install -m 644 radiusd-logrotate ${RPM_BUILD_ROOT}/etc/logrotate.d/radiusd
-install -m 644 radiusd-pam ${RPM_BUILD_ROOT}/etc/pam.d/radiusd
-cd ..
-
-# rc.d files
-for i in 3 4 5;  do
-	ln -sf ../init.d/radiusd ${RPM_BUILD_ROOT}/etc/rc.d/rc$i.d/S88radiusd
-done
-for i in 0 1 2 6; do
-	ln -sf ../init.d/radiusd ${RPM_BUILD_ROOT}/etc/rc.d/rc$i.d/K12radiusd
-done
-
-for i in radutmp radwtmp radius.log; do
-	touch ${RPM_BUILD_ROOT}/var/log/$i
-	mkdir -p ${RPM_BUILD_ROOT}/var/log/radacct
-done
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%files
-%defattr(-,root,root)
-
-%doc doc/ChangeLog doc/README doc/README.pam doc/README.proxy 
-%doc doc/README.usersfile doc/README.simul doc/INSTALL.OLD 
-%doc doc/Makefile.README doc/README.cisco doc/README.radrelay
-%doc COPYRIGHT.Cistron COPYRIGHT.Livingston
-
-/usr/bin/*
-/usr/sbin/*
-/usr/man/man1/*
-/usr/man/man5/*
-/usr/man/man8/*
-/var/log/radutmp
-/var/log/radwtmp
-/var/log/radius.log
-%dir /var/log/radacct/
-
-%dir /etc/raddb/
-%config /etc/raddb/*
-%config /etc/pam.d/radiusd
-%config /etc/logrotate.d/radiusd
-%config /etc/rc.d/init.d/radiusd
-%config(missingok) /etc/rc.d/rc0.d/K12radiusd
-%config(missingok) /etc/rc.d/rc1.d/K12radiusd
-%config(missingok) /etc/rc.d/rc2.d/K12radiusd
-%config(missingok) /etc/rc.d/rc3.d/S88radiusd
-%config(missingok) /etc/rc.d/rc4.d/S88radiusd
-%config(missingok) /etc/rc.d/rc5.d/S88radiusd
-%config(missingok) /etc/rc.d/rc6.d/K12radiusd
-
-%changelog
-* Fri Dec 29 2000 Carl Soderstrom <chrome@real-time.com>
-- updated to version 1.6.4
-- can be built as non-root user, which doesn't risk overwriting system files when building
-
-* Sat Nov 21 1998 Tim Hockin <thockin@ais.net>
-- Based on work by Christopher McCrory <chrismcc@netus.com>
-- Build with PAM
-- Included pam.d/radius
-- Fixed some small errors in this spec
-- Changed to build to BuildRoot
-- Changed Release to "beta11" from "1"
-- Included users, naslist, huntgroups, clients files, not just -dist
-
-* Tue Oct 27 1998 Mauricio Mello de Andrade <mandrade@mma.com.br>
-- Corrected the script to Start/Stop the Radius under RH5.x
-- Included the script to Rotate Radius Logs under RedHat
-- Checkrad Utility now works fine with Cyclades PathRas
-
diff -urN radiusd-cistron-1.6-dist/redhat/radiusd-cistron.spec radiusd-cistron-1.6/redhat/radiusd-cistron.spec
--- radiusd-cistron-1.6-dist/redhat/radiusd-cistron.spec	1969-12-31 18:00:00.000000000 -0600
+++ radiusd-cistron-1.6/redhat/radiusd-cistron.spec	2003-06-04 12:36:07.000000000 -0500
@@ -0,0 +1,175 @@
+Summary: Cistron RADIUS daemon (with PAM) 
+Summary(pt_BR): Servidor RADIUS com muitas funcoes.
+Name: radiusd-cistron
+Version: 1.6.6cvs
+Release: 2003.04.10.1
+Source: radiusd-cistron-1.6-cvs-2003-04-10.tar.gz
+URL: http://www.radius.cistron.nl/
+Copyright: GPL
+Group: Networking/Daemons
+BuildRoot: /var/tmp/%{name}-buildroot
+BuildRequires: pam-devel
+PreReq: /sbin/chkconfig, /sbin/service
+
+%description
+RADIUS server with a lot of functions. Short overview: 
+
+- PAM support compiled in
+- Supports access based on huntgroups
+- Multiple DEFAULT entries in users file
+- All users file entries can optionally "fall through"
+- Caches all config files in-memory
+- Keeps a list of logged in users (radutmp file)
+- "radwho" program can be installed as "fingerd"
+- Logs both UNIX "wtmp" file format and RADIUS detail logfiles
+- Supports Simultaneous-Use = X parameter. Yes, this means
+  that you can now prevent double logins!
+
+%description -l pt_BR
+Servidor RADIUS com muitas funções. Visão geral:
+
+- Suporta acesso baseado em huntgroups
+- Multiplas entradas DEFAULT no arquivo de usuarios
+- Faz cache de todos os arquivos de configuracão em memoria
+- Mantem uma lista dos usuarios conectados (arquivo radutmp)
+- O programa radwho pode ser instalado como fingerd
+- Registra tanto no formato UNIX wtmp quanto no RADIUS detail
+- Suporta o parametro Simultaneous-Use = X. Sim, isto significa
+  que você pode evitar logins duplos!, inclusive com o Cyclades PathRas
+
+%prep 
+%setup -q -n radiusd-cistron-1.6
+
+cd raddb
+for f in clients users naslist huntgroups ; do cp $f $f-dist ; done
+cd ..
+
+%build
+cd src
+make PAM=-DPAM PAMLIB="-lpam -ldl" CFLAGS="-Wall ${RPM_OPT_FLAGS}" \
+    RADIUS_DIR=%{_sysconfdir}/raddb \
+    RADLOG_DIR=/var/log \
+    PID_DIR=/var/run \
+    BINDIR=%{_bindir} \
+    SBINDIR=%{_sbindir} \
+    MANDIR=%{_mandir} \
+    SHAREDIR=%{_datadir}/radius
+cd ..
+
+%install
+# prepare $RPM_BUILD_ROOT
+rm -rf $RPM_BUILD_ROOT
+for dir in %{_bindir} %{_sbindir} %{_datadir}/radius %{_mandir}/man{1,5,8} \
+    %{_sysconfdir}/raddb /var/log/radacct \
+    /etc/{logrotate.d,pam.d,rc.d/init.d,sysconfig}; do
+	mkdir -p $RPM_BUILD_ROOT$dir
+done
+
+# make install
+cd src
+make install INSTROOT=$RPM_BUILD_ROOT \
+    RADIUS_DIR=%{_sysconfdir}/raddb \
+    RADLOG_DIR=/var/log \
+    PID_DIR=/var/run \
+    BINDIR=%{_bindir} \
+    SBINDIR=%{_sbindir} \
+    MANDIR=%{_mandir} \
+    SHAREDIR=%{_datadir}/radius
+cd ..
+perl -pi -e "s#$RPM_BUILD_ROOT##" $RPM_BUILD_ROOT%{_sysconfdir}/raddb/dictionary
+chmod o-rwx $RPM_BUILD_ROOT%{_sysconfdir}/raddb
+
+# radwatch
+install -m 755 scripts/radwatch ${RPM_BUILD_ROOT}%{_sbindir}/
+perl -pi -e 's#/usr/local/sbin#%{_sbindir}#' ${RPM_BUILD_ROOT}%{_sbindir}/radwatch
+
+# other files
+cd redhat
+install -m 555 rc.radiusd-redhat ${RPM_BUILD_ROOT}/etc/rc.d/init.d/radiusd
+perl -pi -e '
+    s#SBINDIR#%{_sbindir}#;
+    s#RADIUS_DIR#%{_sysconfdir}/raddb#;
+    ' ${RPM_BUILD_ROOT}/etc/rc.d/init.d/radiusd
+install -m 644 radiusd-logrotate ${RPM_BUILD_ROOT}/etc/logrotate.d/radiusd
+install -m 644 radiusd-pam ${RPM_BUILD_ROOT}/etc/pam.d/radius
+install -m 644 radiusd-sysconfig ${RPM_BUILD_ROOT}/etc/sysconfig/radiusd
+cd ..
+
+for i in radutmp radwtmp radius.log; do
+	touch ${RPM_BUILD_ROOT}/var/log/$i
+	chmod o-rwx $RPM_BUILD_ROOT/var/log/$i
+done
+mkdir -p ${RPM_BUILD_ROOT}/var/log/radacct
+chmod o-rwx ${RPM_BUILD_ROOT}/var/log/radacct
+
+%post
+/sbin/chkconfig --add radiusd
+
+%preun
+if [ $1 = 0 ]; then
+	/sbin/service radiusd stop > /dev/null 2>&1
+	/sbin/chkconfig --del radiusd
+fi
+
+%postun
+if [ "$1" -ge "1" ]; then
+	/sbin/service radiusd condrestart > /dev/null 2>&1
+fi
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+
+%doc COPYRIGHT doc/ChangeLog doc/README* doc/FAQ.txt
+
+%{_bindir}/*
+%{_sbindir}/*
+%{_mandir}/man*/*
+%dir %{_datadir}/radius
+%{_datadir}/radius/*
+/var/log/radutmp
+/var/log/radwtmp
+/var/log/radius.log
+%dir /var/log/radacct
+
+%dir %{_sysconfdir}/raddb
+%{_sysconfdir}/raddb/*-dist
+%config(noreplace) %{_sysconfdir}/raddb/clients
+%config(noreplace) %{_sysconfdir}/raddb/dictionary
+%config(noreplace) %{_sysconfdir}/raddb/hints
+%config(noreplace) %{_sysconfdir}/raddb/huntgroups
+%config(noreplace) %{_sysconfdir}/raddb/naslist
+%config(noreplace) %{_sysconfdir}/raddb/naspasswd
+%config(noreplace) %{_sysconfdir}/raddb/realms
+%config(noreplace) %{_sysconfdir}/raddb/users
+%config /etc/pam.d/radius
+%config /etc/logrotate.d/radiusd
+%config /etc/sysconfig/radiusd
+/etc/rc.d/init.d/radiusd
+
+%changelog
+* Thu May 29 2003 Chris Adams <cmadams@hiwaay.net>
+- update to version 1.6.7 from CVS
+- generalize paths so they can be changed for other platforms
+- update to more current "Red Hat way" of doing things
+
+* Fri Dec 29 2000 Carl Soderstrom <chrome@real-time.com>
+- updated to version 1.6.4
+- can be built as non-root user, which doesn't risk overwriting system files when building
+
+* Sat Nov 21 1998 Tim Hockin <thockin@ais.net>
+- Based on work by Christopher McCrory <chrismcc@netus.com>
+- Build with PAM
+- Included pam.d/radius
+- Fixed some small errors in this spec
+- Changed to build to BuildRoot
+- Changed Release to "beta11" from "1"
+- Included users, naslist, huntgroups, clients files, not just -dist
+
+* Tue Oct 27 1998 Mauricio Mello de Andrade <mandrade@mma.com.br>
+- Corrected the script to Start/Stop the Radius under RH5.x
+- Included the script to Rotate Radius Logs under RedHat
+- Checkrad Utility now works fine with Cyclades PathRas
+
diff -urN radiusd-cistron-1.6-dist/redhat/radiusd-logrotate radiusd-cistron-1.6/redhat/radiusd-logrotate
--- radiusd-cistron-1.6-dist/redhat/radiusd-logrotate	1999-09-18 17:10:43.000000000 -0500
+++ radiusd-cistron-1.6/redhat/radiusd-logrotate	2003-06-04 12:35:44.000000000 -0500
@@ -1,45 +1,33 @@
-# You can use this to rotate the /var/log/radwtmp, simply copy it to
-# /etc/logrotate.d/radiusd
-
 # if you use defail files, You can uncomment the next block and
-# edit it accordling your /etc/raddb/naslist file. If you comment
-# the /var/log/radwtmp block you'll need to include the
-# postrotate/endscript parts to the *last* NAS-NAME/detail of this file
+# edit it accordling your /etc/raddb/naslist file.
 
 #/var/log/radacct/NAS-NAME/detail {
-#	monthly
-#	rotate 4
-#	create
-#	compress
+#	postrotate
+#		/sbin/service radiusd reload
+#	endscript
+#	notifempty
+#	missingok
 #}
 
 /var/log/checkrad.log {
-        monthly
-        rotate 4
-        create
-        compress
+	notifempty
+	missingok
 }
 
 /var/log/radius.log {
-        monthly
-        rotate 4
-        create
-        compress
+	notifempty
+	missingok
 }
 
 /var/log/radwatch.log {
-        monthly
-        rotate 4
-        create
-        compress
+	notifempty
+	missingok
 }
 
 /var/log/radwtmp {
-	monthly
-	rotate 4
-	create
-	compress
 	postrotate
-		/etc/rc.d/init.d/radiusd reload
+		/sbin/service radiusd reload
 	endscript
+	notifempty
+	missingok
 }
diff -urN radiusd-cistron-1.6-dist/redhat/radiusd-pam radiusd-cistron-1.6/redhat/radiusd-pam
--- radiusd-cistron-1.6-dist/redhat/radiusd-pam	1999-09-18 17:10:43.000000000 -0500
+++ radiusd-cistron-1.6/redhat/radiusd-pam	2003-06-04 12:35:44.000000000 -0500
@@ -1,7 +1,6 @@
 #%PAM-1.0
-auth       required	/lib/security/pam_pwdb.so shadow nullok
+auth       required	/lib/security/pam_stack.so service=system-auth
 auth       required	/lib/security/pam_nologin.so
-account    required	/lib/security/pam_pwdb.so
-password   required	/lib/security/pam_cracklib.so
-password   required	/lib/security/pam_pwdb.so shadow nullok use_authtok
-session    required	/lib/security/pam_pwdb.so
+account    required	/lib/security/pam_stack.so service=system-auth
+password   required	/lib/security/pam_stack.so service=system-auth
+session    required	/lib/security/pam_stack.so service=system-auth
diff -urN radiusd-cistron-1.6-dist/redhat/radiusd-sysconfig radiusd-cistron-1.6/redhat/radiusd-sysconfig
--- radiusd-cistron-1.6-dist/redhat/radiusd-sysconfig	1969-12-31 18:00:00.000000000 -0600
+++ radiusd-cistron-1.6/redhat/radiusd-sysconfig	2003-06-04 12:35:44.000000000 -0500
@@ -0,0 +1,4 @@
+# This is useful if you want to replicate accounting packets
+# to another radius server - see README.radrelay
+#RADIUS_ARGS="-y -w -F %N/detail -F detail.rep"
+#RADRELAY_ARGS="-a /var/log/radacct XX.SERVER.HERE.XX detail.rep"
diff -urN radiusd-cistron-1.6-dist/redhat/rc.radiusd-redhat radiusd-cistron-1.6/redhat/rc.radiusd-redhat
--- radiusd-cistron-1.6-dist/redhat/rc.radiusd-redhat	2001-03-22 08:05:15.000000000 -0600
+++ radiusd-cistron-1.6/redhat/rc.radiusd-redhat	2003-06-04 12:35:44.000000000 -0500
@@ -10,61 +10,89 @@
 # chkconfig: 345 98 10
 # description: Ativa/Desativa servidor Radius
 
-RADIUSD=/usr/sbin/radiusd
-RADRELAY=/usr/sbin/radrelay
+RADIUSD=SBINDIR/radiusd
+RADRELAY=SBINDIR/radrelay
 DESC="Cistron radius server"
 LOCKF=/var/lock/subsys/radiusd
 
+# Source function library.
+. /etc/rc.d/init.d/functions
+
 # These are the defaults.
 RADIUS_ARGS="-y"
+RADRELAY_ARGS=""
+
+[ -f /etc/sysconfig/radiusd ] && . /etc/sysconfig/radiusd
 
 # This is useful if you want to replicate accounting packets
 # to another radius server - see README.radrelay
 #RADIUS_ARGS="-y -w -F %N/detail -F detail.rep"
 #RADRELAY_ARGS="-a /var/log/radacct XX.SERVER.HERE.XX detail.rep"
 
-# Source function library.
-. /etc/rc.d/init.d/functions
-
 test -f $RADIUSD || exit 0
-test -f /etc/raddb/clients || exit 0
+test -f RADIUS_DIR/clients || exit 0
 
-case "$1" in
-  start)
-	[ -f /var/log/radutmp ] || touch /var/log/radutmp
+RETVAL=0
+
+start() {
 	echo -n "Starting $DESC: "
 	if [ -x "$RADRELAY" ] && [ -n "$RADRELAY_ARGS" ]
 	then
-		echo -n "radrelay "
 		daemon $RADRELAY $RADRELAY_ARGS
+		RETVAL=$?
+		[ $RETVAL -ne 0 ] && return $RETVAL
 	fi
 	daemon $RADIUSD $RADIUS_ARGS
-	echo "radiusd."
-	touch $LOCKF
-	;;
-  stop)
-	[ -z "$2" ] && echo -n "Stopping $DESC: "
+	RETVAL=$?
+	echo
+	[ $RETVAL -eq 0 ] && touch $LOCKF
+	return $RETVAL
+}
+
+stop() {
+	echo -n "Stopping $DESC: "
 	if [ -x "$RADRELAY" ] && [ -n "$RADRELAY_ARGS" ]
 	then
-		[ -z "$2" ] && echo -n "radrelay "
-		killproc $RADRELAY 2>/dev/null
+		echo -n "radrelay "
+		killproc $RADRELAY
 	fi
-	killproc $RADIUSD 2> /dev/null
-	[ -z "$2" ] && echo "radiusd."
-	rm -f $LOCKF
+	killproc $RADIUSD
+	RETVAL=$?
+	echo
+	[ $RETVAL -eq 0 ] && rm -f $LOCKF
+	return $RETVAL
+}
+
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+	stop
+	;;
+  status)
+	status radiusd
 	;;
   reload)
 	echo "Reloading $DESC configuration files."
 	killproc -1 $RADIUSD
 	;;
   restart)
-	$0 stop quiet
-	sleep 3
-	$0 start
+	stop
+	sleep 2
+	start
+	;;
+  condrestart)
+	if [ -f $LOCKF ]
+	then
+		stop
+		sleep 2
+		start
+	fi
 	;;
   *)
-	echo "Usage: $0 {start|stop|reload|restart}"
+	echo "Usage: $0 {start|stop|status|reload|restart|condrestart}"
 	exit 1
 esac
 
-exit 0
+exit $RETVAL
