curl.spec 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. ##
  2. ## curl.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2022 OpenPKG Project <http://openpkg.org/>
  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 Project
  29. Distribution: OpenPKG Community
  30. Class: BASE
  31. Group: Web
  32. License: MIT-style
  33. Version: 7.83.0
  34. Release: 20220427
  35. # package options
  36. %option with_ssl yes
  37. %option with_zlib yes
  38. %option with_http2 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. %option with_rtmp no
  45. %option with_psl no
  46. # package option dependencies
  47. %if "%{with_ldap}" == "yes" && "%{with_ssl}" == "no"
  48. %undefine with_ssl
  49. %define with_ssl yes
  50. %endif
  51. # list of sources
  52. Source0: http://curl.haxx.se/download/curl-%{version}.tar.xz
  53. Patch0: curl.patch
  54. # build information
  55. BuildPreReq: OpenPKG, openpkg >= 20160101, make, gcc
  56. PreReq: OpenPKG, openpkg >= 20160101, x509
  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. %if "%{with_http2}" == "yes"
  86. BuildPreReq: nghttp2
  87. PreReq: nghttp2
  88. %endif
  89. %if "%{with_rtmp}" == "yes"
  90. BuildPreReq: librtmp, pkgconfig
  91. PreReq: librtmp
  92. %endif
  93. %if "%{with_psl}" == "yes"
  94. BuildPreReq: libpsl, pkgconfig
  95. PreReq: libpsl
  96. %endif
  97. %description
  98. Curl is the tool for transferring files with URL syntax, supporting FTP,
  99. HTTP, HTTPS, GOPHER, TELNET, DICT, FILE and LDAP. Curl supports HTTPS
  100. certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload,
  101. proxies, cookies, user+password authentication, file transfer resume and a
  102. busload of other useful tricks.
  103. %track
  104. prog curl = {
  105. version = %{version}
  106. url = http://curl.haxx.se/download/
  107. regex = curl-(__VER__)\.tar\.xz
  108. }
  109. %prep
  110. %setup -q
  111. %patch -p0
  112. %build
  113. ( echo 'ac_cv_header_openssl_engine_h=no'
  114. echo 'lt_cv_prog_compiler_c_o_F77=no'
  115. echo 'lt_cv_sys_max_cmd_len=100'
  116. ) >config.cache
  117. export CC="%{l_cc}"
  118. export CXX="%{l_cxx}"
  119. export CFLAGS="%{l_cflags -O}"
  120. export CPPFLAGS="%{l_cppflags}"
  121. export LDFLAGS="%{l_ldflags}"
  122. export LIBS=""
  123. %if "%{with_idn}" == "yes"
  124. CFLAGS="$CFLAGS `pkg-config --cflags libidn`"
  125. LIBS="$LIBS `pkg-config --libs libidn`"
  126. %endif
  127. %if "%{with_ldap}" == "yes"
  128. LIBS="-lldap -llber -lssl -lcrypto"
  129. %endif
  130. %if "%{with_psl}" == "yes"
  131. CFLAGS="$CFLAGS `pkg-config --cflags libpsl`"
  132. LIBS="$LIBS `pkg-config --libs libpsl`"
  133. %endif
  134. export GREP="grep"
  135. ./configure \
  136. --cache-file=./config.cache \
  137. --prefix=%{l_prefix} \
  138. --datarootdir=%{l_prefix} \
  139. --datadir=%{l_prefix}/share \
  140. %if "%{with_ssl}" == "yes"
  141. --with-ssl=%{l_prefix} \
  142. --with-ca-bundle=%{l_prefix}/etc/x509/public-ca.crt.pem \
  143. %else
  144. --without-ssl \
  145. %endif
  146. %if "%{with_zlib}" == "yes"
  147. --with-zlib=%{l_prefix} \
  148. %else
  149. --without-zlib \
  150. %endif
  151. %if "%{with_idn}" == "yes"
  152. --with-libidn=%{l_prefix} \
  153. %else
  154. --without-libidn \
  155. %endif
  156. %if "%{with_ares}" == "yes"
  157. --enable-ares=%{l_prefix} \
  158. %else
  159. --disable-ares \
  160. %endif
  161. %if "%{with_kerberos}" == "yes"
  162. --with-gssapi=%{l_prefix} \
  163. %else
  164. --without-gssapi \
  165. %endif
  166. %if "%{with_ssh}" == "yes"
  167. --with-libssh2=%{l_prefix} \
  168. %else
  169. --without-libssh2 \
  170. %endif
  171. %if "%{with_ldap}" == "yes"
  172. --enable-ldap \
  173. --enable-ldaps \
  174. --with-ldap-lib=ldap \
  175. --with-lber-lib=lber \
  176. %else
  177. --disable-ldap \
  178. --disable-ldaps \
  179. %endif
  180. %if "%{with_http2}" == "yes"
  181. --with-nghttp2 \
  182. %else
  183. --without-nghttp2 \
  184. %endif
  185. %if "%{with_rtmp}" == "yes"
  186. --with-librtmp \
  187. %else
  188. --without-librtmp \
  189. %endif
  190. %if "%{with_psl}" == "yes"
  191. --with-libpsl \
  192. %else
  193. --without-libpsl \
  194. %endif
  195. --disable-ipv6 \
  196. --disable-threaded-resolver \
  197. --disable-pthreads \
  198. --disable-shared
  199. %{l_make} %{l_mflags -O}
  200. %install
  201. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  202. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  203. rm -rf $RPM_BUILD_ROOT%{l_prefix}/zsh
  204. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  205. %if "%{with_ssl}" == "yes"
  206. %{l_files_std} \
  207. '%config %{l_prefix}/etc/curl/*'
  208. %else
  209. %{l_files_std}
  210. %endif
  211. %files -f files
  212. %clean