diff --git a/radiator/radiator.spec b/radiator/radiator.spec new file mode 100644 index 0000000000..87ef2f9a6f --- /dev/null +++ b/radiator/radiator.spec @@ -0,0 +1,140 @@ +## +## radiator.spec -- OpenPKG RPM Specification +## Copyright (c) 2000-2003 The OpenPKG Project +## Copyright (c) 2000-2003 Ralf S. Engelschall +## Copyright (c) 2000-2003 Cable & Wireless +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +# package information +Name: radiator +Summary: RADIUS Server +URL: http://www.open.com.au/radiator/ +Vendor: Open System Consultants Pty Ltd +Packager: The OpenPKG Project +Distribution: OpenPKG [EVAL] +Group: Network +License: Commercial +Version: 3.7.1 +Release: 20031216 + +# list of sources +Source0: http://www.open.com.au/radiator/downloads/dl.cgi/Radiator-%{version}.tgz +Source1: http://www.open.com.au/radiator/downloads/dl.cgi/patches-%{version}/patches-%{version}.tar.gz +Source2: radius.cfg +Source3: radius.users +Source4: rc.radiator +%NoSource 0 +%NoSource 1 + +# build information +Prefix: %{l_prefix} +BuildRoot: %{l_buildroot} +BuildPreReq: OpenPKG, openpkg >= 20030103 +PreReq: OpenPKG, openpkg >= 20030103, perl, perl-crypto, perl-ssl +AutoReq: no +AutoReqProv: no + +%description + Radiator is a highly configurable and flexible Radius server that + supports authentication by a huge range of authentication methods + such as Flat files, DBM files, Unix password files, SQL databases, + remote Radius servers (proxying), external programs, NT User + Manager, Active Directory, LDAP, PAM, iPASS, GRIC, NIS+, Tacacs+, + a wide range of ISP billing packages such as Emerald, Platypus, + Rodopi, Hawk-i, Interbiller98, Freeside etc, your legacy user + database etc, etc + +%prep + %setup -q -n Radiator-%{version} + %setup -q -n Radiator-%{version} -D -T -a 1 + +%build + # build package + %{l_prefix}/bin/perl Makefile.PL \ + PERL=%{l_prefix}/bin/perl \ + FULLPERL=%{l_prefix}/bin/perl \ + PREFIX=$RPM_BUILD_ROOT%{l_prefix} \ + INSTALLDIRS=site \ + INSTALLSITELIB=$RPM_BUILD_ROOT%{l_prefix}/libexec/radiator + %{l_make} %{l_mflags} + +%install + # install package + rm -rf $RPM_BUILD_ROOT + %{l_make} %{l_mflags} install + + # post-adjust package + %{l_shtool} subst \ + -e "s;@INC, \\(.\\)\\.\\(.\\);@INC, \\1%{l_prefix}/libexec/radiator\\2;g" \ + $RPM_BUILD_ROOT%{l_prefix}/bin/* + %{l_shtool} subst \ + -e 's;\./dictionary;%{l_prefix}/etc/radiator/radius.dict;' \ + -e 's;mysecret;foo;' -e 's;mikem;bar;' -e 's;fred;baz;' \ + $RPM_BUILD_ROOT%{l_prefix}/bin/radpwtst + + # strip down package + rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/perl + rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/radiator/auto + + # install configuration files + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/etc/radiator + %{l_shtool} install -c -m 600 %{l_value -s -a} \ + %{SOURCE radius.cfg} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/radiator/ + %{l_shtool} install -c -m 600 %{l_value -s -a} \ + %{SOURCE radius.users} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/radiator/ + %{l_shtool} install -c -m 644 \ + dictionary \ + $RPM_BUILD_ROOT%{l_prefix}/etc/radiator/radius.dict + + # install run-command script + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d + %{l_shtool} install -c -m 755 %{l_value -s -a} \ + %{SOURCE rc.radiator} \ + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ + + # install documentation + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/share/radiator + %{l_shtool} install -c -m 644 \ + doc/* $RPM_BUILD_ROOT%{l_prefix}/share/radiator/ + rm -f $RPM_BUILD_ROOT%{l_prefix}/share/radiator/*.ps + rm -f $RPM_BUILD_ROOT%{l_prefix}/share/radiator/install* + rm -f $RPM_BUILD_ROOT%{l_prefix}/share/radiator/history.html + + # create additional directories + %{l_shtool} mkdir -f -p -m 755 \ + $RPM_BUILD_ROOT%{l_prefix}/var/radiator + + # determine installation files + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ + %{l_files_std} \ + '%config %attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/etc/radiator/*' \ + '%dir %attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/radiator' + +%files -f files + +%clean + rm -rf $RPM_BUILD_ROOT + diff --git a/radiator/radius.cfg b/radiator/radius.cfg new file mode 100644 index 0000000000..4f72ea6ab7 --- /dev/null +++ b/radiator/radius.cfg @@ -0,0 +1,47 @@ +## +## radius.cfg -- Radiator Daemon Configuration +## + +User @l_rusr@ +Group @l_rgrp@ + +BindAddress 127.0.0.1 +AuthPort 1645,1812 +AcctPort 1646,1813 + +DbDir @l_prefix@/etc/radiator +LogDir @l_prefix@/var/radiator + +DictionaryFile %D/radius.dict +PidFile %L/radius.pid +LogFile %L/radius.log + +Trace 4 + + + Secret foo + DupInterval 0 + + + + Identifier authlogger + Filename %L/radius.authlog + LogSuccess 1 + LogFailure 1 + + + + RewriteUsername s/^([^@]+).*/$1/ + RewriteUsername tr/[A-Z]/[a-z]/ + UsernameCharset a-zA-Z0-9\.-_@ + + Filename %D/radius.users + + RejectHasReason + RejectEmptyPassword + AuthLog authlogger + AcctLogFileFormat %{Timestamp} %{Acct-Session-Id} %{User-Name} + AcctLogFileName %L/radius.details + WtmpFileName %L/radius.wtmp + + diff --git a/radiator/radius.users b/radiator/radius.users new file mode 100644 index 0000000000..0cf0f34c1a --- /dev/null +++ b/radiator/radius.users @@ -0,0 +1,12 @@ +## +## radius.users -- Radiator User Configuration +## + +bar User-Password = "baz" + Service-Type = Framed-User, + Framed-Protocol = PPP, + Framed-IP-Netmask = 255.255.255.255, + Framed-Routing = None, + Framed-MTU = 1500, + Framed-Compression = Van-Jacobson-TCP-IP + diff --git a/radiator/rc.radiator b/radiator/rc.radiator new file mode 100644 index 0000000000..47b21be35d --- /dev/null +++ b/radiator/rc.radiator @@ -0,0 +1,62 @@ +#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc +## +## rc.radiator -- Run-Commands +## + +%config + radiator_enable="$openpkg_rc_def" + radiator_args="" + radiator_log_prolog="true" + radiator_log_epilog="true" + radiator_log_numfiles="10" + radiator_log_minsize="1M" + radiator_log_complevel="9" + +%common + radiator_cfgfile="@l_prefix@/etc/radiator/radius.cfg" + radiator_pidfile="@l_prefix@/var/radiator/radius.pid" + radiator_logfile="@l_prefix@/var/radiator/radius.log" + radiator_signal () { + [ -f $radiator_pidfile ] && kill -$1 `cat $radiator_pidfile` + } + +%status -u @l_susr@ -o + radiator_usable="no" + radiator_active="no" + rcService radiator enable yes && \ + radiator_signal 0 && radiator_active="yes" + echo "radiator_enable=\"$radiator_enable\"" + echo "radiator_usable=\"$radiator_usable\"" + echo "radiator_active=\"$radiator_active\"" + +%start -p 100 -u @l_susr@ + rcService radiator enable yes || exit 0 + rcService radiator active yes && exit 0 + touch ${radiator_logfile} + chmod 644 ${radiator_logfile} + chown @l_rusr@:@l_rgrp@ ${radiator_logfile} + @l_prefix@/bin/radiusd \ + -config_file ${radiator_cfgfile} \ + ${radiator_args} + +%stop -p 100 -u @l_susr@ + rcService radiator enable yes || exit 0 + rcService radiator active no && exit 0 + radiator_signal TERM + sleep 2 + rm -f $radiator_pidfile >/dev/null 2>&1 || true + +%restart -p 100 -u @l_susr@ + rcService radiator enable yes || exit 0 + rcService radiator active no && exit 0 + rc radiator stop start + +%daily -u @l_susr@ + rcService radiator enable yes || exit 0 + shtool rotate -f \ + -n ${radiator_log_numfiles} -s ${radiator_log_minsize} -d \ + -z ${radiator_log_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \ + -P "${radiator_log_prolog}" \ + -E "${radiator_log_epilog} && rc radiator reload" \ + ${radiator_logfile} +