curl.spec 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. ##
  2. ## curl.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. # package information
  24. Name: curl
  25. Summary: Batch Client for HTTP, HTTPS, FTP, LDAP and DICT protocol
  26. URL: http://curl.haxx.se/
  27. Vendor: Daniel Stenberg
  28. Packager: OpenPKG Foundation e.V.
  29. Distribution: OpenPKG Community
  30. Class: BASE
  31. Group: Web
  32. License: MIT-style
  33. Version: 7.18.0
  34. Release: 20080129
  35. # package options
  36. %option with_ssl yes
  37. %option with_zlib yes
  38. %option with_ssh no
  39. %option with_idn no
  40. %option with_ares no
  41. %option with_kerberos no
  42. %option with_ldap no
  43. # package option dependencies
  44. %if "%{with_ldap}" == "yes" && "%{with_ssl}" == "no"
  45. %undefine with_ssl
  46. %define with_ssl yes
  47. %endif
  48. # list of sources
  49. Source0: http://curl.haxx.se/download/curl-%{version}.tar.bz2
  50. Patch0: curl.patch
  51. # build information
  52. Prefix: %{l_prefix}
  53. BuildRoot: %{l_buildroot}
  54. BuildPreReq: OpenPKG, openpkg >= 20040130, make, gcc
  55. PreReq: OpenPKG, openpkg >= 20040130
  56. %if "%{with_ssl}" == "yes"
  57. BuildPreReq: openssl >= 0.9.7
  58. PreReq: openssl >= 0.9.7
  59. %endif
  60. %if "%{with_zlib}" == "yes"
  61. BuildPreReq: zlib
  62. PreReq: zlib
  63. %endif
  64. %if "%{with_idn}" == "yes"
  65. BuildPreReq: libidn, pkgconfig
  66. PreReq: libidn
  67. %endif
  68. %if "%{with_ares}" == "yes"
  69. BuildPreReq: ares
  70. PreReq: ares
  71. %endif
  72. %if "%{with_kerberos}" == "yes"
  73. BuildPreReq: KERBEROS
  74. PreReq: KERBEROS
  75. %endif
  76. %if "%{with_ssh}" == "yes"
  77. BuildPreReq: libssh2
  78. PreReq: libssh2
  79. %endif
  80. %if "%{with_ldap}" == "yes"
  81. BuildPreReq: openldap, openssl
  82. PreReq: openldap, openssl
  83. %endif
  84. AutoReq: no
  85. AutoReqProv: no
  86. %description
  87. Curl is the tool for transferring files with URL syntax, supporting FTP,
  88. HTTP, HTTPS, GOPHER, TELNET, DICT, FILE and LDAP. Curl supports HTTPS
  89. certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload,
  90. proxies, cookies, user+password authentication, file transfer resume and a
  91. busload of other useful tricks.
  92. %track
  93. prog curl = {
  94. version = %{version}
  95. url = http://curl.haxx.se/download/
  96. regex = curl-(__VER__)\.tar\.gz
  97. }
  98. %prep
  99. %setup -q
  100. %patch -p0
  101. %build
  102. %{l_shtool} subst \
  103. -e '/LINENO: error: C[+]* preprocessor/{N;N;N;N;s/.*/:/;}' \
  104. configure
  105. ( echo 'ac_cv_header_openssl_engine_h=no'
  106. echo 'lt_cv_prog_compiler_c_o_F77=no'
  107. echo 'lt_cv_sys_max_cmd_len=100'
  108. ) >config.cache
  109. export CC="%{l_cc}"
  110. export CXX="%{l_cxx}"
  111. export CFLAGS="%{l_cflags -O} %{l_cppflags}"
  112. export CPPFLAGS="%{l_cppflags}"
  113. export LDFLAGS="%{l_ldflags}"
  114. export LIBS=""
  115. %if "%{with_idn}" == "yes"
  116. CFLAGS="$CFLAGS `pkg-config --cflags libidn`"
  117. LIBS="$LIBS `pkg-config --libs libidn`"
  118. %endif
  119. %if "%{with_ldap}" == "yes"
  120. LIBS="-lldap -llber -lssl -lcrypto"
  121. %endif
  122. export GREP="grep"
  123. ./configure \
  124. --cache-file=./config.cache \
  125. --prefix=%{l_prefix} \
  126. --datarootdir=%{l_prefix} \
  127. %if "%{with_ssl}" == "yes"
  128. --with-ssl=%{l_prefix} \
  129. --with-ca-bundle=%{l_prefix}/etc/curl/ca-bundle.crt \
  130. %else
  131. --without-ssl \
  132. %endif
  133. %if "%{with_zlib}" == "yes"
  134. --with-zlib=%{l_prefix} \
  135. %else
  136. --without-zlib \
  137. %endif
  138. %if "%{with_idn}" == "yes"
  139. --with-libidn=%{l_prefix} \
  140. %else
  141. --without-libidn \
  142. %endif
  143. %if "%{with_ares}" == "yes"
  144. --enable-ares=%{l_prefix} \
  145. %else
  146. --disable-ares \
  147. %endif
  148. %if "%{with_kerberos}" == "yes"
  149. --with-gssapi=%{l_prefix} \
  150. %else
  151. --without-gssapi \
  152. %endif
  153. %if "%{with_ssh}" == "yes"
  154. --with-libssh2=%{l_prefix} \
  155. %else
  156. --without-libssh2 \
  157. %endif
  158. %if "%{with_ldap}" == "yes"
  159. --enable-ldap \
  160. --enable-ldaps \
  161. --with-ldap-lib=ldap \
  162. --with-lber-lib=lber \
  163. %else
  164. --disable-ldap \
  165. --disable-ldaps \
  166. %endif
  167. --disable-shared
  168. %{l_make} %{l_mflags -O}
  169. %install
  170. rm -rf $RPM_BUILD_ROOT
  171. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  172. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  173. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  174. %if "%{with_ssl}" == "yes"
  175. %{l_files_std} \
  176. '%config %{l_prefix}/etc/curl/*'
  177. %else
  178. %{l_files_std}
  179. %endif
  180. %files -f files
  181. %clean
  182. rm -rf $RPM_BUILD_ROOT