radius.spec 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. ##
  2. ## radius.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2003 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package information
  26. Name: radius
  27. Summary: GNU RADIUS Server
  28. URL: http://www.gnu.org/software/radius/
  29. Vendor: Free Software Foundation
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [PLUS]
  32. Group: Network
  33. License: GPL
  34. Version: 1.1
  35. Release: 20030918
  36. # list of sources
  37. Source0: ftp://ftp.gnu.org/gnu/radius/radius-%{version}.tar.gz
  38. Source1: rc.radius
  39. # build information
  40. Prefix: %{l_prefix}
  41. BuildRoot: %{l_buildroot}
  42. BuildPreReq: OpenPKG, openpkg >= 20030909, make, flex, bison, m4, gcc
  43. PreReq: OpenPKG, openpkg >= 20030909
  44. AutoReq: no
  45. AutoReqProv: no
  46. %description
  47. Radius is a server for remote user authentication and accounting.
  48. Its primary use is for Internet Service Providers, though it may as
  49. well be used on any network that needs a centralized authentication
  50. and/or accounting service for its workstations. The package includes
  51. an authentication and accounting server and administrator tools.
  52. %prep
  53. %setup -q
  54. case "%{l_platform -t}" in
  55. *-sunos5.6 )
  56. %{l_shtool} subst \
  57. -e 's;socklen_t;int;g' \
  58. radiusd/radiusd.c
  59. ;;
  60. esac
  61. %build
  62. CC="%{l_cc}" \
  63. CFLAGS="%{l_cflags}" \
  64. ./configure \
  65. --prefix=%{l_prefix} \
  66. --sysconfdir=%{l_prefix}/etc/radius \
  67. --localstatedir=%{l_prefix}/var/radius \
  68. --enable-add-includes="%{l_cppflags}" \
  69. --enable-add-libs="%{l_ldflags}" \
  70. --disable-maintainer-mode \
  71. --without-guile \
  72. --without-server-guile \
  73. --enable-snmp \
  74. --disable-pam \
  75. --disable-nls
  76. %{l_shtool} subst \
  77. -e "s;/var/log;%{l_prefix}/var/radius/log;g" \
  78. -e "s;/var/run;%{l_prefix}/var/radius/run;g" \
  79. config.status config.cache
  80. ./config.status
  81. %{l_make} %{l_mflags -O}
  82. %install
  83. rm -rf $RPM_BUILD_ROOT
  84. %{l_shtool} mkdir -f -p \
  85. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  86. $RPM_BUILD_ROOT%{l_prefix}/etc/radius/raddb \
  87. $RPM_BUILD_ROOT%{l_prefix}/var/radius/log \
  88. $RPM_BUILD_ROOT%{l_prefix}/var/radius/run
  89. %{l_shtool} subst \
  90. -e "s;%{l_prefix}/etc;$RPM_BUILD_ROOT%{l_prefix}/etc;g" \
  91. -e "s;%{l_prefix}/var;$RPM_BUILD_ROOT%{l_prefix}/var;g" \
  92. `find . -name Makefile -print`
  93. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT raddbdir=%{l_prefix}/etc/radius/raddb/"
  94. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  95. %{SOURCE rc.radius} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  96. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  97. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/security
  98. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/xemacs
  99. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  100. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  101. %files -f files
  102. %clean
  103. rm -rf $RPM_BUILD_ROOT
  104. %pre
  105. # before upgrade, save status and stop service
  106. [ $1 -eq 2 ] || exit 0
  107. eval `%{l_rc} radius status 2>/dev/null | tee %{l_tmpfile}`
  108. %{l_rc} radius stop 2>/dev/null
  109. exit 0
  110. %post
  111. if [ $1 -eq 2 ]; then
  112. # after upgrade, restore status
  113. eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}
  114. [ ".$radius_active" = .yes ] && %{l_rc} radius start
  115. fi
  116. exit 0
  117. %preun
  118. # before erase, stop service and remove log files
  119. [ $1 -eq 0 ] || exit 0
  120. %{l_rc} radius stop 2>/dev/null
  121. rm -f $RPM_INSTALL_PREFIX/var/radius/log/radius.* >/dev/null 2>&1 || true
  122. exit 0