## ## radius.spec -- OpenPKG RPM Package Specification ## Copyright (c) 2000-2021 OpenPKG Project ## ## 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: OpenPKG Project Distribution: OpenPKG Community Class: EVAL Group: RADIUS License: GPL Version: 1.6.1 Release: 20081217 # package options %option with_mysql no %option with_pgsql no %option with_odbc no # list of sources Source0: http://ftp.gnu.org/gnu/radius/radius-%{version}.tar.gz Source1: rc.radius Patch0: radius.patch # build information BuildPreReq: OpenPKG, openpkg >= 20160101, make, flex, bison, m4, gcc, libtool PreReq: OpenPKG, openpkg >= 20160101 BuildPreReq: readline PreReq: readline %if "%{with_mysql}" == "yes" BuildPreReq: mysql PreReq: mysql %endif %if "%{with_pgsql}" == "yes" BuildPreReq: postgresql PreReq: postgresql %endif %if "%{with_odbc}" == "yes" BuildPreReq: ODBC PreReq: ODBC %endif %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. %track prog radius = { version = %{version} url = http://ftp.gnu.org/gnu/radius/ regex = radius-(__VER__)\.tar\.gz } %prep %setup -q %patch -p0 %build # configure program export CC="%{l_cc}" export CPPFLAGS="%{l_cppflags}" export CFLAGS="%{l_cflags}" export LDFLAGS="%{l_ldflags}" export LIBS="" %if "%{with_mysql}" == "yes" CFLAGS="$CFLAGS `mysql_config --cflags`" LIBS="$LIBS `mysql_config --libs`" %endif %if "%{with_mysql}" == "yes" CPPFLAGS="$CPPFLAGS %{l_cppflags postgresql}" %endif ./configure \ --prefix=%{l_prefix} \ --infodir=%{l_prefix}/info \ --mandir=%{l_prefix}/man \ --sysconfdir=%{l_prefix}/etc/radius \ --localstatedir=%{l_prefix}/var/radius \ --enable-add-includes="%{l_cppflags}" \ --enable-add-libs="%{l_ldflags}" \ --with-include-path=%{l_prefix}/include \ --with-lib-path=%{l_prefix}/lib \ --disable-maintainer-mode \ --without-guile \ --without-server-guile \ --enable-snmp \ --enable-client \ %if "%{with_mysql}" == "yes" --with-mysql \ %endif %if "%{with_pgsql}" == "yes" --with-postgres \ %endif %if "%{with_odbc}" == "yes" --with-odbc \ %endif --disable-pam \ --disable-nls \ --disable-shared %{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 # build program %{l_make} %{l_mflags -O} %install # create installation hierarchy %{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 # install program %{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/" # install run-command script %{l_shtool} install -c -m 755 %{l_value -s -a} \ %{SOURCE rc.radius} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ # strip down installation 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 # determine installation files %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ %{l_files_std} \ '%config %{l_prefix}/etc/radius/raddb/*' %files -f files %clean %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