curl.spec 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. ##
  2. ## curl.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package information
  25. Name: curl
  26. Summary: Batch Client for HTTP, HTTPS, FTP, LDAP and DICT protocol
  27. URL: http://curl.haxx.se/
  28. Vendor: Daniel Stenberg
  29. Packager: OpenPKG Foundation e.V.
  30. Distribution: OpenPKG Community
  31. Class: BASE
  32. Group: Web
  33. License: MIT-style
  34. Version: 7.17.1
  35. Release: 20071030
  36. # package options
  37. %option with_ssl yes
  38. %option with_zlib yes
  39. %option with_ssh no
  40. %option with_idn no
  41. %option with_ares no
  42. %option with_kerberos no
  43. %option with_ldap no
  44. # package option dependencies
  45. %if "%{with_ldap}" == "yes" && "%{with_ssl}" == "no"
  46. %undefine with_ssl
  47. %define with_ssl yes
  48. %endif
  49. # list of sources
  50. Source0: http://curl.haxx.se/download/curl-%{version}.tar.bz2
  51. Patch0: curl.patch
  52. # build information
  53. Prefix: %{l_prefix}
  54. BuildRoot: %{l_buildroot}
  55. BuildPreReq: OpenPKG, openpkg >= 20040130, make, gcc
  56. PreReq: OpenPKG, openpkg >= 20040130
  57. %if "%{with_ssl}" == "yes"
  58. BuildPreReq: openssl >= 0.9.7
  59. PreReq: openssl >= 0.9.7
  60. %endif
  61. %if "%{with_zlib}" == "yes"
  62. BuildPreReq: zlib
  63. PreReq: zlib
  64. %endif
  65. %if "%{with_idn}" == "yes"
  66. BuildPreReq: libidn, pkgconfig
  67. PreReq: libidn
  68. %endif
  69. %if "%{with_ares}" == "yes"
  70. BuildPreReq: ares
  71. PreReq: ares
  72. %endif
  73. %if "%{with_kerberos}" == "yes"
  74. BuildPreReq: KERBEROS
  75. PreReq: KERBEROS
  76. %endif
  77. %if "%{with_ssh}" == "yes"
  78. BuildPreReq: libssh2
  79. PreReq: libssh2
  80. %endif
  81. %if "%{with_ldap}" == "yes"
  82. BuildPreReq: openldap, openssl
  83. PreReq: openldap, openssl
  84. %endif
  85. AutoReq: no
  86. AutoReqProv: no
  87. %description
  88. Curl is the tool for transferring files with URL syntax, supporting FTP,
  89. HTTP, HTTPS, GOPHER, TELNET, DICT, FILE and LDAP. Curl supports HTTPS
  90. certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload,
  91. proxies, cookies, user+password authentication, file transfer resume and a
  92. busload of other useful tricks.
  93. %track
  94. prog curl = {
  95. version = %{version}
  96. url = http://curl.haxx.se/download/
  97. regex = curl-(__VER__)\.tar\.gz
  98. }
  99. %prep
  100. %setup -q
  101. %patch -p0
  102. %build
  103. %{l_shtool} subst \
  104. -e '/LINENO: error: C[+]* preprocessor/{N;N;N;N;s/.*/:/;}' \
  105. configure
  106. ( echo 'ac_cv_header_openssl_engine_h=no'
  107. echo 'lt_cv_prog_compiler_c_o_F77=no'
  108. echo 'lt_cv_sys_max_cmd_len=100'
  109. ) >config.cache
  110. export CC="%{l_cc}"
  111. export CXX="%{l_cxx}"
  112. export CFLAGS="%{l_cflags -O} %{l_cppflags}"
  113. export CPPFLAGS="%{l_cppflags}"
  114. export LDFLAGS="%{l_ldflags}"
  115. export LIBS=""
  116. %if "%{with_idn}" == "yes"
  117. CFLAGS="$CFLAGS `pkg-config --cflags libidn`"
  118. LIBS="$LIBS `pkg-config --libs libidn`"
  119. %endif
  120. %if "%{with_ldap}" == "yes"
  121. LIBS="-lldap -llber -lssl -lcrypto"
  122. %endif
  123. export GREP="grep"
  124. ./configure \
  125. --cache-file=./config.cache \
  126. --prefix=%{l_prefix} \
  127. --datarootdir=%{l_prefix} \
  128. %if "%{with_ssl}" == "yes"
  129. --with-ssl=%{l_prefix} \
  130. --with-ca-bundle=%{l_prefix}/etc/curl/ca-bundle.crt \
  131. %else
  132. --without-ssl \
  133. %endif
  134. %if "%{with_zlib}" == "yes"
  135. --with-zlib=%{l_prefix} \
  136. %else
  137. --without-zlib \
  138. %endif
  139. %if "%{with_idn}" == "yes"
  140. --with-libidn=%{l_prefix} \
  141. %else
  142. --without-libidn \
  143. %endif
  144. %if "%{with_ares}" == "yes"
  145. --enable-ares=%{l_prefix} \
  146. %else
  147. --disable-ares \
  148. %endif
  149. %if "%{with_kerberos}" == "yes"
  150. --with-gssapi=%{l_prefix} \
  151. %else
  152. --without-gssapi \
  153. %endif
  154. %if "%{with_ssh}" == "yes"
  155. --with-libssh2=%{l_prefix} \
  156. %else
  157. --without-libssh2 \
  158. %endif
  159. %if "%{with_ldap}" == "yes"
  160. --enable-ldap \
  161. --enable-ldaps \
  162. --with-ldap-lib=ldap \
  163. --with-lber-lib=lber \
  164. %else
  165. --disable-ldap \
  166. --disable-ldaps \
  167. %endif
  168. --disable-shared
  169. %{l_make} %{l_mflags -O}
  170. %install
  171. rm -rf $RPM_BUILD_ROOT
  172. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  173. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  174. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  175. %if "%{with_ssl}" == "yes"
  176. %{l_files_std} \
  177. '%config %{l_prefix}/etc/curl/*'
  178. %else
  179. %{l_files_std}
  180. %endif
  181. %files -f files
  182. %clean
  183. rm -rf $RPM_BUILD_ROOT