sasl.spec 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. ##
  2. ## sasl.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.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: sasl
  27. Summary: Simple Authentication and Security Layer
  28. URL: http://asg.web.cmu.edu/sasl/
  29. Vendor: Cyrus Project, CMU
  30. Packager: The OpenPKG Project
  31. Distribution: OpenPKG [PLUS]
  32. Group: Cryptography
  33. License: BSD
  34. Version: 2.1.12
  35. Release: 20030312
  36. # package options
  37. %option with_fsl no
  38. %option with_pam no
  39. %option with_login no
  40. %option with_ldap no
  41. %option with_mysql no
  42. # list of sources
  43. Source0: ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-%{version}.tar.gz
  44. Source1: rc.sasl
  45. Source2: fsl.sasl
  46. Patch0: sasl.patch
  47. # build information
  48. Prefix: %{l_prefix}
  49. BuildRoot: %{l_buildroot}
  50. BuildPreReq: OpenPKG, openpkg >= 20030103, db >= 4.1.24, openssl, gcc
  51. PreReq: OpenPKG, openpkg >= 20030103, db >= 4.1.24
  52. %if "%{with_fsl}" == "yes"
  53. BuildPreReq: fsl
  54. PreReq: fsl
  55. %endif
  56. %if "%{with_pam}" == "yes"
  57. BuildPreReq: PAM
  58. PreReq: PAM
  59. %endif
  60. %if "%{with_ldap}" == "yes"
  61. BuildPreReq: openldap
  62. %endif
  63. %if "%{with_mysql}" == "yes"
  64. BuildPreReq: MYSQL, zlib
  65. %endif
  66. AutoReq: no
  67. AutoReqProv: no
  68. %description
  69. SASL is the Simple Authentication and Security Layer, a method
  70. for adding authentication support to connection-based protocols.
  71. To use SASL, a protocol includes a command for identifying and
  72. authenticating a user to a server and for optionally negotiating
  73. protection of subsequent protocol interactions. If its use is
  74. negotiated, a security layer is inserted between the protocol and
  75. the connection.
  76. %prep
  77. %setup -q -n cyrus-sasl-%{version}
  78. %{l_shtool} subst \
  79. -e 's;^ *for dbname in ;for dbname in db ;' \
  80. configure
  81. %patch -p0
  82. %build
  83. %{l_shtool} subst \
  84. -e "s;javac;javac-xxx;g" \
  85. -e "s;javah;javah-xxx;g" \
  86. -e "s;javadoc;javadoc-xxx;g" \
  87. configure
  88. cflags="%{l_cflags -O} %{l_cppflags}"
  89. ldflags="%{l_ldflags}"
  90. libs="-ldb"
  91. %if "%{with_fsl}" == "yes"
  92. ldflags="$ldflags `%{l_prefix}/bin/fsl-config --all --ldflags`"
  93. libs="$libs `%{l_prefix}/bin/fsl-config --all --libs`"
  94. %endif
  95. %if "%{with_ldap}" == "yes"
  96. ldflags="$ldflags `%{l_prefix}/bin/fsl-config --all --ldflags`"
  97. libs="$libs `%{l_prefix}/bin/fsl-config --all --libs`"
  98. %endif
  99. %if "%{with_mysql}" == "yes"
  100. libs="$libs -lz -lm"
  101. %endif
  102. CC="%{l_cc}" \
  103. CFLAGS="$cflags" \
  104. CPPFLAGS="%{l_cppflags}" \
  105. LDFLAGS="$ldflags" \
  106. LIBS="$libs" \
  107. ./configure \
  108. --prefix=%{l_prefix} \
  109. --with-plugindir=%{l_prefix}/lib/sasl \
  110. --with-saslauthd=%{l_prefix}/var/sasl/saslauthd \
  111. --with-dbpath=%{l_prefix}/var/sasl/sasldb \
  112. --with-dblib=berkeley \
  113. --with-bdb-incdir=%{l_prefix}/include \
  114. --with-bdb-libdir=%{l_prefix}/lib \
  115. %if "%{with_pam}" == "yes"
  116. --with-pam \
  117. %else
  118. --without-pam \
  119. %endif
  120. %if "%{with_login}" == "yes"
  121. --enable-login \
  122. %else
  123. --disable-login \
  124. %endif
  125. %if "%{with_ldap}" == "yes"
  126. --with-ldap=%{l_prefix} \
  127. %else
  128. --without-ldap \
  129. %endif
  130. %if "%{with_mysql}" == "yes"
  131. --with-mysql=%{l_prefix} \
  132. %else
  133. --without-mysql \
  134. %endif
  135. --enable-shared \
  136. --enable-static \
  137. --enable-staticdlopen \
  138. --disable-java \
  139. --disable-sample \
  140. --disable-krb4 \
  141. --disable-gssapi \
  142. --disable-otp \
  143. --without-des \
  144. --without-opie
  145. # trust me, libtool, I know what I am doing
  146. %{l_shtool} subst \
  147. -e 's;^\(deplibs_check_method=\).*;\1"pass_all";' \
  148. libtool
  149. # do not reference static plugins
  150. %{l_shtool} subst \
  151. -e '58s;.*;#define PIC;' \
  152. lib/dlopen.c
  153. # do not pull static plugins into static library
  154. %{l_shtool} subst \
  155. -e '/^SASL_STATIC_OBJS/s;\.\./plugins/[^ ]* *;;g' \
  156. lib/Makefile
  157. # build utils against static library
  158. %{l_shtool} subst \
  159. -e 's;\(\$(CCLD)\);\1 -static;' \
  160. utils/Makefile
  161. %{l_make} %{l_mflags}
  162. cd saslauthd
  163. %{l_make} %{l_mflags} testsaslauthd
  164. %install
  165. rm -rf $RPM_BUILD_ROOT
  166. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  167. # remove libtool cruft
  168. rm -f \
  169. $RPM_BUILD_ROOT%{l_prefix}/lib/*.la \
  170. $RPM_BUILD_ROOT%{l_prefix}/lib/*.so \
  171. $RPM_BUILD_ROOT%{l_prefix}/lib/*.so.* \
  172. $RPM_BUILD_ROOT%{l_prefix}/lib/sasl2/*.la \
  173. $RPM_BUILD_ROOT%{l_prefix}/lib/sasl2/*.a
  174. %{l_shtool} mkdir -f -p -m 755 \
  175. $RPM_BUILD_ROOT%{l_prefix}/man/man8
  176. %{l_shtool} install -c -m 644 \
  177. utils/saslpasswd2.8 \
  178. utils/sasldblistusers2.8 \
  179. $RPM_BUILD_ROOT%{l_prefix}/man/man8/
  180. %{l_shtool} mkdir -f -p -m 755 \
  181. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  182. %{l_shtool} install -c -m 755 \
  183. saslauthd/testsaslauthd \
  184. $RPM_BUILD_ROOT%{l_prefix}/sbin/
  185. %{l_shtool} install -c -m 755 \
  186. -e 's;@l_prefix@;%{l_prefix};g' \
  187. -e 's;@l_susr@;%{l_susr};g' \
  188. %{SOURCE rc.sasl} \
  189. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  190. %if "%{with_pam}" == "yes"
  191. %{l_shtool} subst -e 's;@authmech@;pam;g' \
  192. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/rc.sasl
  193. %else
  194. case "%{l_target}" in
  195. ix86-linux* )
  196. %{l_shtool} subst -e 's;@authmech@;shadow;g' \
  197. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/rc.sasl
  198. ;;
  199. *-solaris* )
  200. %{l_shtool} subst -e 's;@authmech@;shadow;g' \
  201. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/rc.sasl
  202. ;;
  203. * )
  204. %{l_shtool} subst -e 's;@authmech@;getpwent;g' \
  205. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/rc.sasl
  206. ;;
  207. esac
  208. %endif
  209. %if "%{with_fsl}" == "yes"
  210. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  211. %{l_shtool} install -c -m 644 \
  212. -e 's;@l_prefix@;%{l_prefix};g' \
  213. %{SOURCE fsl.sasl} \
  214. $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
  215. %endif
  216. %{l_shtool} mkdir -f -p -m 700 \
  217. $RPM_BUILD_ROOT%{l_prefix}/var/sasl/log/
  218. %{l_shtool} mkdir -f -p -m 755 \
  219. $RPM_BUILD_ROOT%{l_prefix}/var/sasl/saslauthd/
  220. mv $RPM_BUILD_ROOT%{l_prefix}/lib/sasl2 \
  221. $RPM_BUILD_ROOT%{l_prefix}/lib/sasl/
  222. strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
  223. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
  224. %if "%{with_fsl}" == "yes"
  225. '%config %{l_prefix}/etc/fsl/fsl.sasl' \
  226. '%not %dir %{l_prefix}/etc/fsl' \
  227. %endif
  228. '%dir %attr(0750,%{l_musr},%{l_rgrp}) %{l_prefix}/var/sasl' \
  229. '%dir %attr(-,%{l_susr},%{l_sgrp}) %{l_prefix}/var/sasl/log'
  230. %files -f files
  231. %clean
  232. rm -rf $RPM_BUILD_ROOT