You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

135 lines
4.7 KiB

##
## radius.spec -- OpenPKG RPM Specification
## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
##
## 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: radius
Summary: GNU RADIUS Server
URL: http://www.gnu.org/software/radius/
Vendor: Free Software Foundation
Packager: The OpenPKG Project
Distribution: OpenPKG [PLUS]
Group: Network
License: GPL
Version: 1.2
Release: 20031208
# list of sources
Source0: ftp://ftp.gnu.org/gnu/radius/radius-%{version}.tar.gz
Source1: rc.radius
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 20030909, make, flex, bison, m4, gcc
PreReq: OpenPKG, openpkg >= 20030909
AutoReq: no
AutoReqProv: no
%description
Radius is a server for remote user authentication and accounting.
Its primary use is for Internet Service Providers, though it may as
well be used on any network that needs a centralized authentication
and/or accounting service for its workstations. The package includes
an authentication and accounting server and administrator tools.
%prep
%setup -q
case "%{l_platform -t}" in
*-sunos5.6 )
%{l_shtool} subst \
-e 's;socklen_t;int;g' \
radiusd/radiusd.c
;;
esac
%build
CC="%{l_cc}" \
CFLAGS="%{l_cflags}" \
./configure \
--prefix=%{l_prefix} \
--sysconfdir=%{l_prefix}/etc/radius \
--localstatedir=%{l_prefix}/var/radius \
--enable-add-includes="%{l_cppflags}" \
--enable-add-libs="%{l_ldflags}" \
--disable-maintainer-mode \
--without-guile \
--without-server-guile \
--enable-snmp \
--disable-pam \
--disable-nls
%{l_shtool} subst \
-e "s;/var/log;%{l_prefix}/var/radius/log;g" \
-e "s;/var/run;%{l_prefix}/var/radius/run;g" \
config.status
./config.status
%{l_make} %{l_mflags -O}
%install
rm -rf $RPM_BUILD_ROOT
%{l_shtool} mkdir -f -p \
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
$RPM_BUILD_ROOT%{l_prefix}/etc/radius/raddb \
$RPM_BUILD_ROOT%{l_prefix}/var/radius/log \
$RPM_BUILD_ROOT%{l_prefix}/var/radius/run
%{l_shtool} subst \
-e "s;%{l_prefix}/etc;$RPM_BUILD_ROOT%{l_prefix}/etc;g" \
-e "s;%{l_prefix}/var;$RPM_BUILD_ROOT%{l_prefix}/var;g" \
`find . -name Makefile -print`
%{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT raddbdir=%{l_prefix}/etc/radius/raddb/"
%{l_shtool} install -c -m 755 %{l_value -s -a} \
%{SOURCE rc.radius} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/security
rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/xemacs
strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
%files -f files
%clean
rm -rf $RPM_BUILD_ROOT
%pre
# before upgrade, save status and stop service
[ $1 -eq 2 ] || exit 0
eval `%{l_rc} radius status 2>/dev/null | tee %{l_tmpfile}`
%{l_rc} radius stop 2>/dev/null
exit 0
%post
if [ $1 -eq 2 ]; then
# after upgrade, restore status
eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}
[ ".$radius_active" = .yes ] && %{l_rc} radius start
fi
exit 0
%preun
# before erase, stop service and remove log files
[ $1 -eq 0 ] || exit 0
%{l_rc} radius stop 2>/dev/null
rm -f $RPM_INSTALL_PREFIX/var/radius/log/radius.* >/dev/null 2>&1 || true
exit 0