radiusclient/radiusclient.spec

changeset 18
9115bae56135
parent 13
cb59d6afeb61
child 85
e6a1cd7ed6ba
     1.1 --- a/radiusclient/radiusclient.spec	Tue Jan 06 23:46:19 2009 +0100
     1.2 +++ b/radiusclient/radiusclient.spec	Tue Jan 06 23:48:04 2009 +0100
     1.3 @@ -32,17 +32,28 @@
     1.4  Group:        RADIUS
     1.5  License:      BSD-style
     1.6  Version:      0.5.6
     1.7 -Release:      20080317
     1.8 +Release:      20080620
     1.9 +
    1.10 +#   package options
    1.11 +%option       with_fsl         yes
    1.12 +%option       with_brokenlibc  no
    1.13 +
    1.14  
    1.15  #   list of sources
    1.16 -Source0:      http://download.berlios.de/radiusclient-ng/radiusclient-ng-%{version}.tar.gz
    1.17 +Source0:      ftp://ftp.iptel.org/pub/radiusclient-ng/radiusclient-ng-%{version}.tar.gz
    1.18 +Source2:      fsl.radiusclient
    1.19  Patch0:       radiusclient.patch
    1.20 +Patch1:       radiusclient.patch.libc
    1.21  
    1.22  #   build information
    1.23  Prefix:       %{l_prefix}
    1.24  BuildRoot:    %{l_buildroot}
    1.25  BuildPreReq:  OpenPKG, openpkg >= 20060823
    1.26  PreReq:       OpenPKG, openpkg >= 20060823
    1.27 +%if "%{with_fsl}" == "yes"
    1.28 +BuildPreReq:  fsl
    1.29 +PreReq:       fsl
    1.30 +%endif
    1.31  AutoReq:      no
    1.32  AutoReqProv:  no
    1.33  
    1.34 @@ -52,19 +63,24 @@
    1.35  %track
    1.36      prog radiusclient = {
    1.37          version   = %{version}
    1.38 -        url       = http://prdownload.berlios.de/radiusclient-ng/
    1.39 +        url       = ftp://ftp.iptel.org/pub/radiusclient-ng/
    1.40          regex     = radiusclient-ng-(__VER__)\.tar\.gz
    1.41      }
    1.42  
    1.43  %prep
    1.44      %setup -q -n radiusclient-ng-%{version}
    1.45      %patch -p0
    1.46 +%if "%{with_brokenlibc}" == "yes"
    1.47 +    %patch -p0 -P 1
    1.48 +%endif
    1.49  
    1.50  %build
    1.51      CC="%{l_cc}" \
    1.52      CFLAGS="%{l_cflags -O}" \
    1.53      CPPFLAGS="%{l_cppflags}" \
    1.54 -    LDFLAGS="%{l_ldflags}" \
    1.55 +    LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" \
    1.56 +    LIBS="%{l_fsl_libs}" \
    1.57 +    GREP="grep" \
    1.58      ./configure \
    1.59          --prefix=%{l_prefix} \
    1.60          --sysconfdir=%{l_prefix}/etc/radiusclient \
    1.61 @@ -74,16 +90,32 @@
    1.62  %install
    1.63      rm -rf $RPM_BUILD_ROOT
    1.64      %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
    1.65 +    %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/var/radiusclient
    1.66 +    touch $RPM_BUILD_ROOT%{l_prefix}/var/radiusclient/radius.seq
    1.67 +    mv \
    1.68 +        $RPM_BUILD_ROOT%{l_prefix}/include/radiusclient-ng.h \
    1.69 +        $RPM_BUILD_ROOT%{l_prefix}/include/radiusclient.h
    1.70      rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/login.radius
    1.71      strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
    1.72 -    mv  $RPM_BUILD_ROOT%{l_prefix}/include/radiusclient-ng.h \
    1.73 -        $RPM_BUILD_ROOT%{l_prefix}/include/radiusclient.h
    1.74 +    %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
    1.75 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
    1.76 +        %{SOURCE fsl.radiusclient} \
    1.77 +        $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
    1.78 +
    1.79      %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
    1.80          %{l_files_std} \
    1.81 -        '%config %{l_prefix}/etc/radiusclient/*'
    1.82 +        '%not %dir %{l_prefix}/etc/fsl' \
    1.83 +        '%config %{l_prefix}/etc/radiusclient/*' \
    1.84 +        '%attr(640,%{l_mgrp},%{l_rgrp}) %{l_prefix}/etc/radiusclient/servers' \
    1.85 +        '%attr(644,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/radiusclient/radius.seq'
    1.86  
    1.87  %files -f files
    1.88  
    1.89  %clean
    1.90      rm -rf $RPM_BUILD_ROOT
    1.91  
    1.92 +%preun
    1.93 +    [ $1 -eq 0 ] || exit 0
    1.94 +    rm -f $RPM_INSTALL_PREFIX/var/radiusclient/*.log >/dev/null 2>&1 || true
    1.95 +    exit 0
    1.96 +

mercurial