+# TODO: ngtpc2/nghttp3 or quiche or msh3 for HTTP3?
#
# Conditional build:
+%bcond_without static_libs # static library
%bcond_without ssh # SSH support
%bcond_without ssl # SSL support
%bcond_with gnutls # GnuTLS instead of OpenSSL
+%bcond_without gsasl # SCRAM support with gsasl
%bcond_without kerberos5 # Heimdal Kerberos 5 support
%bcond_without ldap # LDAP support
-%bcond_with http2 # HTTP/2.0 support (nghttp2 based)
-%bcond_without metalink # metalink support
+%bcond_without http2 # HTTP/2.0 support (nghttp2 based)
+%bcond_with http3 # HTTP/3.0 support (nghttp3/ngtcp2 based)
%if "%{pld_release}" != "ac"
%bcond_without ares # c-ares (asynchronous DNS operations) library support
%bcond_without rtmp # Real Time Media Protocol support
Summary(ru.UTF-8): Утилита для получения файлов с серверов FTP, HTTP и других
Summary(uk.UTF-8): Утиліта для отримання файлів з серверів FTP, HTTP та інших
Name: curl
-Version: 7.40.0
+Version: 8.8.0
Release: 2
License: MIT-like
Group: Applications/Networking
-Source0: http://curl.haxx.se/download/%{name}-%{version}.tar.lzma
-# Source0-md5: d18fb866d97b536e8948833b84a58a73
+Source0: https://curl.se/download/%{name}-%{version}.tar.xz
+# Source0-md5: e1062de8a9b252a75fc42e2252746bd8
Patch0: %{name}-ac.patch
Patch1: %{name}-krb5flags.patch
-Patch2: %{name}-gssapi.patch
-URL: http://curl.haxx.se/
+URL: https://curl.se/
BuildRequires: autoconf >= 2.57
BuildRequires: automake
-%{?with_ares:BuildRequires: c-ares-devel >= 1.7.0}
+%{?with_ares:BuildRequires: c-ares-devel >= 1.17.0}
+%{?with_gsasl:BuildRequires: gsasl-devel}
%{?with_kerberos5:BuildRequires: heimdal-devel}
-BuildRequires: libidn-devel >= 0.4.1
-%{?with_metalink:BuildRequires: libmetalink-devel}
+BuildRequires: libbrotli-devel >= 1.0.0
+BuildRequires: libidn2-devel
+BuildRequires: libpsl-devel
%{?with_rtmp:BuildRequires: librtmp-devel}
-%{?with_ssh:BuildRequires: libssh2-devel >= 1.2.8}
+%{?with_ssh:BuildRequires: libssh2-devel >= 1.11.0}
BuildRequires: libtool
BuildRequires: nettle-devel
-%{?with_http2:BuildRequires: nghttp2-devel >= 0.6}
+%{?with_http2:BuildRequires: nghttp2-devel >= 1.15.0}
+%{?with_http3:BuildRequires: nghttp3-devel}
+# with gnutls or openssl crypto, conforming to chosen curl crypto library
+%{?with_http3:BuildRequires: ngtcp2-devel}
%{?with_ldap:BuildRequires: openldap-devel}
BuildRequires: pkgconfig
BuildRequires: rpm >= 4.4.9-56
-BuildRequires: rpmbuild(macros) >= 1.453
+BuildRequires: rpm-build >= 4.6
+BuildRequires: rpmbuild(macros) >= 1.527
%if %{with ssl}
%if %{with gnutls}
-BuildRequires: gnutls-devel
+BuildRequires: gnutls-devel >= 3.1.10
%else
BuildRequires: openssl-devel >= 1.0.1
%endif
%endif
BuildRequires: tar >= 1:1.22
+BuildRequires: xz
BuildRequires: zlib-devel
+BuildRequires: zstd-devel
Requires: %{name}-libs = %{version}-%{release}
-Requires: libidn >= 0.4.1
-Obsoletes: libcurl2
+Obsoletes: libcurl2 < 7.12
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
Summary: curl library
Summary(pl.UTF-8): Biblioteka curl
Group: Libraries
-%{?with_ares:Requires: c-ares >= 1.7.0}
-%{?with_ssh:Requires: libssh2 >= 1.2.8}
-%{?with_http2:Requires: nghttp2 >= 0.6}
+%{?with_ares:Requires: c-ares >= 1.17.0}
+%{?with_gnutls:Requires: gnutls-libs >= 3.1.10}
+%{?with_ssh:Requires: libssh2%{?_isa} >= 1.11.0}
+%{?with_http2:Requires: nghttp2-libs >= 1.15.0}
%if %{with ssl} && %{without gnutls}
+Requires: libbrotli >= 1.0.0
Requires: openssl >= 1.0.1
%endif
Suggests: ca-certificates
Summary(ru.UTF-8): Файлы для разработки с использованием библиотеки curl
Summary(uk.UTF-8): Файли для розробки з використанням бібліотеки curl
Group: Development/Libraries
-Requires: %{name}-libs = %{version}-%{release}
+Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%{?with_ares:Requires: c-ares-devel}
+%{?with_gsasl:Requires: gsasl-devel}
%{?with_kerberos5:Requires: heimdal-devel}
-Requires: libidn-devel >= 0.4.1
+Requires: libbrotli-devel >= 1.0.0
+Requires: libidn2-devel
+Requires: libpsl-devel
%{?with_rtmp:Requires: librtmp-devel}
-%{?with_ssh:Requires: libssh2-devel >= 1.2.8}
-%{?with_http2:Requires: nghttp2-devel >= 0.6}
+%{?with_ssh:Requires: libssh2-devel%{?_isa} >= 1.11.0}
+%{?with_http2:Requires: nghttp2-devel >= 1.15.0}
%{?with_ldap:Requires: openldap-devel}
%if %{with ssl}
%if %{with gnutls}
-Requires: gnutls-devel
+Requires: gnutls-devel >= 3.1.10
%else
Requires: openssl-devel >= 0.9.7c
%endif
%endif
Requires: zlib-devel
-Obsoletes: libcurl2-devel
+Requires: zstd-devel
+Obsoletes: libcurl2-devel < 7.12
%description devel
Header files and development documentation for curl library.
Цей пакет містить статичну бібліотеку для розробки програм з
використанням бібліотеки curl.
+%package -n fish-completion-%{name}
+Summary: Fish completion for curl command
+Summary(pl.UTF-8): Dopełnianie parametrów w fish dla polecenia curl
+Group: Applications/Shells
+Requires: %{name} = %{version}-%{release}
+Requires: fish
+BuildArch: noarch
+
+%description -n fish-completion-%{name}
+Fish completion for curl command.
+
+%description -n fish-completion-%{name} -l pl.UTF-8
+Dopełnianie parametrów w fish dla polecenia curl.
+
+%package -n zsh-completion-curl
+Summary: ZSH completion for curl command
+Summary(pl.UTF-8): Dopełnianianie parametrów w ZSH dla polecenia curl
+Group: Applications/Shells
+Requires: %{name} = %{version}-%{release}
+Requires: zsh
+BuildArch: noarch
+
+%description -n zsh-completion-curl
+ZSH completion for curl command.
+
+%description -n zsh-completion-curl -l pl.UTF-8
+Dopełnianianie parametrów w ZSH dla polecenia curl.
+
%prep
%setup -q
%patch0 -p1
%patch1 -p1
-%patch2 -p1
%{__rm} m4/lt*.m4 m4/libtool.m4
%{__automake}
%configure \
ac_cv_header_gss_h=no \
+ %{__enable_disable static_libs static} \
+ %{__enable_disable ares} \
+ %{__with_without gsasl libgsasl} \
+ --enable-headers-api \
+ --enable-ipv6 \
+ %{__enable_disable ldap} \
+ %{__enable_disable ldap ldaps} \
+ --disable-silent-rules \
+ --enable-websockets \
%if %{with ssl}
--with-ca-bundle=/etc/certs/ca-certificates.crt \
%if %{with gnutls}
- --with-gnutls --without-ssl \
+ --with-gnutls --without-openssl \
%else
- --with-ssl=%{_prefix} \
+ --with-openssl=%{_prefix} \
%endif
+%else
+ --without-ssl \
%endif
- %{?with_kerberos5:--with-gssapi=%{_prefix}} \
- %{?with_metalink:--with-libmetalink} \
- %{?with_rtmp:--with-librtmp} \
- %{?with_http2:--with-nghttp2} \
- %{?with_ares:--enable-ares} \
- --enable-ipv6 \
- %{!?with_ldap:--disable-ldap}%{?with_ldap:--enable-ldaps}
+ --with-fish-functions-dir=%{fish_compdir} \
+ --with-zsh-functions-dir=%{zsh_compdir} \
+ %{__with_without kerberos5 gssapi %{_prefix}} \
+ %{__with_without rtmp librtmp} \
+ %{__with_without http2 nghttp2} \
+ %{__with_without http3 nghttp3} \
+ %{__with_without http3 ngtcp2} \
+ %{__with_without ssh libssh2}
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
+
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
+%{__make} -C scripts install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+# obsoleted by pkg-config
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libcurl.la
+
# no longer in upstream but a lot of apps tries to include it so we create fake one
[ -e $RPM_BUILD_ROOT%{_includedir}/curl/types.h ] && exit 1
echo '#warning curl/types.h IS OBSOLETE FROM 2004. STOP USING IT' > $RPM_BUILD_ROOT%{_includedir}/curl/types.h
%files
%defattr(644,root,root,755)
-%doc CHANGES COPYING README docs/{BUGS,FAQ,FEATURES,HISTORY,KNOWN_BUGS,MANUAL,SSLCERTS,THANKS,TODO,TheArtOfHttpScripting}
+%doc CHANGES COPYING README docs/{BUGS.md,FAQ,FEATURES.md,HISTORY.md,KNOWN_BUGS,SSLCERTS.md,THANKS,TODO,TheArtOfHttpScripting.md}
%attr(755,root,root) %{_bindir}/curl
%{_mandir}/man1/curl.1*
%files devel
%defattr(644,root,root,755)
-%doc docs/{CONTRIBUTE,INTERNALS,LICENSE-MIXING,RESOURCES}
+%doc docs/{CONTRIBUTE.md,INTERNALS.md}
%attr(755,root,root) %{_bindir}/curl-config
%attr(755,root,root) %{_libdir}/libcurl.so
-%{_libdir}/libcurl.la
%{_includedir}/curl
%{_pkgconfigdir}/libcurl.pc
%{_aclocaldir}/libcurl.m4
-%{_mandir}/man1/curl-config.1*
%{_mandir}/man3/curl_*.3*
%{_mandir}/man3/libcurl*.3*
+%{_mandir}/man3/CURLINFO_*.3*
%{_mandir}/man3/CURLOPT_*.3*
%{_mandir}/man3/CURLMOPT_*.3*
+%{_mandir}/man3/CURLSHOPT_*.3*
+%if %{with static_libs}
%files static
%defattr(644,root,root,755)
%{_libdir}/libcurl.a
+%endif
+
+%files -n fish-completion-%{name}
+%defattr(644,root,root,755)
+%{fish_compdir}/curl.fish
+
+%files -n zsh-completion-curl
+%defattr(644,root,root,755)
+%{zsh_compdir}/_curl