freeradius.spec 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. ##
  2. ## freeradius.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # FIXME: rse: default configuration is a little bit fat
  24. # FIXME: rse: still not run-time tested
  25. # package information
  26. Name: freeradius
  27. Summary: FreeRADIUS Server
  28. URL: http://www.freeradius.org/
  29. Vendor: The FreeRADIUS Server Project
  30. Packager: OpenPKG Foundation e.V.
  31. Distribution: OpenPKG Community
  32. Class: EVAL
  33. Group: RADIUS
  34. License: GPL
  35. Version: 2.0.5
  36. Release: 20080801
  37. # package options
  38. %option with_mysql no
  39. %option with_openldap no
  40. %option with_pgsql no
  41. %option with_snmp no
  42. # list of sources
  43. Source0: ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-%{version}.tar.gz
  44. Source1: rc.freeradius
  45. Patch0: freeradius.patch
  46. # build information
  47. Prefix: %{l_prefix}
  48. BuildRoot: %{l_buildroot}
  49. BuildPreReq: OpenPKG, openpkg >= 20060823, make, gcc, libtool
  50. PreReq: OpenPKG, openpkg >= 20060823
  51. BuildPreReq: perl, openssl, gdbm
  52. PreReq: perl, openssl, gdbm
  53. %if "%{with_mysql}" == "yes"
  54. BuildPreReq: mysql, zlib
  55. PreReq: mysql, zlib
  56. %endif
  57. %if "%{with_openldap}" == "yes"
  58. BuildPreReq: openldap
  59. PreReq: openldap
  60. %endif
  61. %if "%{with_pgsql}" == "yes"
  62. BuildPreReq: postgresql
  63. PreReq: postgresql
  64. %endif
  65. %if "%{with_snmp}" == "yes"
  66. BuildPreReq: snmp
  67. PreReq: snmp
  68. %endif
  69. AutoReq: no
  70. AutoReqProv: no
  71. %description
  72. FreeRADIUS is one of the most modular and featureful RADIUS servers
  73. available today. It has been written by a team of developers who
  74. have more than a decade of collective experience in implementing
  75. and deploying RADIUS software, in software engineering, and in Unix
  76. package management.
  77. %track
  78. prog freeradius = {
  79. version = %{version}
  80. url = ftp://ftp.freeradius.org/pub/freeradius/
  81. regex = freeradius-server-(\d+\.\d+(\.\d+)*)\.tar\.gz
  82. }
  83. %prep
  84. %setup -q -n freeradius-server-%{version}
  85. %patch -p0
  86. %if "%{with_openldap}" == "yes"
  87. %{l_shtool} subst \
  88. -e 's;\(LIBS *=.* *-lldap\);\1 -llber -lssl -lcrypto;' \
  89. src/modules/rlm_ldap/configure
  90. %endif
  91. %build
  92. # configure package
  93. CC="%{l_cc}" \
  94. CFLAGS="-I`pwd`/src/include %{l_cflags -O} %{l_cppflags}" \
  95. CPPFLAGS="%{l_cppflags}" \
  96. LDFLAGS="%{l_ldflags}" \
  97. %if "%{with_openldap}" == "yes"
  98. LIBS="-llber -lssl -lcrypto" \
  99. %endif
  100. ./configure \
  101. --prefix=%{l_prefix} \
  102. --libdir=%{l_prefix}/lib/freeradius \
  103. --mandir=%{l_prefix}/man \
  104. --localstatedir=%{l_prefix}/var/freeradius \
  105. --datadir=%{l_prefix}/share/freeradius \
  106. --sysconfdir=%{l_prefix}/etc \
  107. --with-system-libtool \
  108. --disable-shared \
  109. --enable-static \
  110. --with-logdir=%{l_prefix}/var/freeradius \
  111. --with-radacctdir=%{l_prefix}/var/freeradius \
  112. --with-raddbdir=%{l_prefix}/etc/freeradius \
  113. --without-threads \
  114. --with-openssl-includes=%{l_prefix}/include/openssl \
  115. --with-openssl-libraries=%{l_prefix}/lib/ \
  116. --with-rlm_perl \
  117. %if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes"
  118. --with-rlm_sql \
  119. --with-rlm_sqlippool \
  120. %else
  121. --without-rlm_sql \
  122. --without-rlm_sqlippool \
  123. %endif
  124. %if "%{with_mysql}" == "yes"
  125. --with-rlm_sql_mysql \
  126. %else
  127. --without-rlm_sql_mysql \
  128. %endif
  129. %if "%{with_pgsql}" == "yes"
  130. --with-rlm_sql_postgresql \
  131. %else
  132. --without-rlm_sql_postgresql \
  133. %endif
  134. --without-rlm_sql_db2 \
  135. --without-rlm_sql_firebird \
  136. --without-rlm_sql_freetds \
  137. --without-rlm_sql_iodbc \
  138. --without-rlm_sql_oracle \
  139. --without-rlm_sql_sybase \
  140. --without-rlm_sql_unixodbc \
  141. %if "%{with_openldap}" == "yes"
  142. --with-rlm-ldap-include-dir=%{l_prefix}/include/ \
  143. --with-rlm-ldap-lib-dir=%{l_prefix}/lib/ \
  144. %else
  145. --without-rlm-ldap \
  146. %endif
  147. --without-rlm_eap_ikev2 \
  148. --without-rlm_eap_sim \
  149. --without-rlm_eap_tls \
  150. --without-rlm_eap_peap \
  151. --without-rlm_eap_ttls \
  152. --without-rlm_eap_tnc \
  153. --without-rlm_krb5 \
  154. --without-rlm_dbm \
  155. --without-rlm_otp \
  156. --without-rlm_pam \
  157. --without-rlm_python \
  158. %if "%{with_snmp}" == "yes"
  159. --with-snmp \
  160. %else
  161. --without-snmp \
  162. %endif
  163. --enable-strict-dependencies \
  164. --with-ltdl-lib=%{l_prefix}/lib \
  165. --with-ltdl-include=%{l_prefix}/include \
  166. --disable-ltdl-install
  167. # build package
  168. %{l_make} %{l_mflags}
  169. %install
  170. # install package
  171. rm -rf $RPM_BUILD_ROOT
  172. %{l_shtool} mkdir -f -p -m 755 \
  173. $RPM_BUILD_ROOT%{l_prefix}/lib/freeradius
  174. %{l_make} %{l_mflags} install \
  175. R=$RPM_BUILD_ROOT
  176. # strip down installation
  177. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  178. rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/freeradius/certs
  179. rm -f $RPM_BUILD_ROOT%{l_prefix}/etc/freeradius/*.sample
  180. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/freeradius/doc
  181. rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/rc.radiusd
  182. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/freeradius/*%{version}*
  183. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/freeradius/rlm_*
  184. # adjust default configuration
  185. %{l_shtool} subst \
  186. -e 's;^#user = nobody;user = %{l_rusr};' \
  187. -e 's;^#group = nobody;group = %{l_rgrp};' \
  188. $RPM_BUILD_ROOT%{l_prefix}/etc/freeradius/radiusd.conf
  189. # install run-command script
  190. %{l_shtool} mkdir -f -p -m 755 \
  191. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
  192. %{l_shtool} install -c -m 755 %{l_value -s -a} \
  193. %{SOURCE rc.freeradius} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  194. # determine installation files
  195. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  196. %{l_files_std} \
  197. '%config %{l_prefix}/etc/freeradius/*' \
  198. '%attr(755,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/freeradius'
  199. %files -f files
  200. %clean
  201. rm -rf $RPM_BUILD_ROOT