curl/curl.spec

761 lines
23 KiB
RPMSpec
Raw Permalink Normal View History

2018-05-08 17:20:01 +03:00
%define major 4
%define libname %mklibname %{name} %{major}
2019-12-26 10:48:37 +03:00
%define libname_libressl %mklibname %{name}-libressl %{major}
2021-03-09 20:12:34 +03:00
%define libname_gnutls %mklibname %{name}-gnutls %{major}
2024-06-27 23:01:12 +00:00
%define libname_mbedtls %mklibname %{name}-mbedtls %{major}
%define libname_wolfssl %mklibname %{name}-wolfssl %{major}
2018-05-08 17:20:01 +03:00
%define devname %mklibname %{name} -d
2019-12-26 10:48:37 +03:00
%define devname_libressl %mklibname %{name}-libressl -d
2021-03-09 20:12:34 +03:00
%define devname_gnutls %mklibname %{name}-gnutls -d
2024-06-27 23:01:12 +00:00
%define devname_mbedtls %mklibname %{name}-mbedtls -d
%define devname_wolfssl %mklibname %{name}-wolfssl -d
2018-05-08 17:20:01 +03:00
%define ssh2 0
2012-02-01 15:13:20 +04:00
2024-06-27 23:01:12 +00:00
# HTTP/3 / QUIC
%bcond_without quic
2024-07-01 14:07:04 +00:00
%bcond_without openssl
2024-06-27 23:01:12 +00:00
# Using libressl allows to support GOST TLS without pain
# test: curl https://www.cryptopro.ru:4444/test/tls-cli.asp
# Building a separate curl with libressl
2024-06-29 12:53:48 +00:00
%bcond_without libressl
2021-03-09 20:12:34 +03:00
# Quite a lot of third-party software is compiled on Debian/Ubuntu
# and is linked with libcurl dynamically, Debian's invention libcurl-gnutls.so
# becomes a runtime dependency. Build the same crap to satisfy runtime dependencies.
# Examples of such software:
# - OnlyOffice DesktopEditors (and probably R7 Office)
# - SberPro https://www.sberbank.ru/ru/legal/new/sbrfbusiness
# GnuTLS, btw, is also capable of GOST.
2024-07-01 14:07:04 +00:00
%bcond_without gnutls
2021-03-09 20:12:34 +03:00
2024-06-27 23:01:12 +00:00
# alternaatives SSL
# v5.7.0-stable https://github.com/wolfSSL/wolfssl
2024-07-01 14:07:04 +00:00
%bcond_without wolfssl
2024-06-27 23:01:12 +00:00
# Embedded TLS
2024-07-01 14:07:04 +00:00
%bcond_without mbedtls
2024-06-27 23:01:12 +00:00
# RusTLS
%bcond_with rustls
2020-01-30 03:06:43 +03:00
# Important! We perform autoreconf, then change resulting 'configure'
# script, this prevents if from regenerating after we have changed it.
%define _disable_rebuild_configure 1
2025-02-05 21:03:02 +00:00
#define _docs %{expand:
#doc _docs/CHANGES.md \
#doc _docs/COPYING \
#doc _docs/README \
#doc _docs/README.md \
#doc _docs/RELEASE-NOTES \
#doc _docs/SECURITY.md \
#doc _docs/docs/*.md
#}
2024-06-27 23:01:12 +00:00
%define ssl_list %{?with_openssl:openssl} %{?with_mbedtls:mbedtls} %{?with_libressl:libressl} %{?with_gnutls:gnutls} %{?with_wolfssl:wolfssl} %{?with_rustls:rustls}
2021-03-09 20:12:34 +03:00
%define shell_begin %{expand:for SSL in %%{ssl_list} ; \
do \
mkdir -p "$SSL" ;\
pushd "$SSL"}
%define shell_end popd; done
2012-02-01 15:13:20 +04:00
Summary: Gets a file from a FTP, GOPHER or HTTP server
Name: curl
2025-02-13 20:35:26 +00:00
Version: 8.12.1
2024-07-24 08:30:52 +00:00
Release: 1
2018-05-08 17:20:01 +03:00
Epoch: 1
2012-02-01 15:13:20 +04:00
License: BSD-like
Group: Networking/Other
2023-10-12 21:23:06 +00:00
URL: https://curl.se
# Release tarball does not have some useful docs
#Source0: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
Source0: https://github.com/curl/curl/archive/curl-%(echo %{version} | sed -e 's,\.,_,g').tar.gz?/%{name}-%{version}.tar.gz
2023-10-12 21:23:06 +00:00
Source1000: %{name}.rpmlintrc
Patch0: %{name}-7.59.0-multilib.patch
Patch3: %{name}-libressl.patch
2024-06-27 23:01:12 +00:00
# mbedtls, check version for cipher id #13749 (https://github.com/curl/curl/pull/13749)
Patch4: https://github.com/curl/curl/commit/2afeacd27e5877000c205c255816aa62e5eeaa32.diff
2015-02-03 01:06:31 +10:00
BuildRequires: groff
BuildRequires: rsync
2013-09-05 15:44:01 +04:00
BuildRequires: stunnel
BuildRequires: openldap-devel
BuildRequires: pkgconfig(krb5)
2015-02-03 01:06:31 +10:00
BuildRequires: pkgconfig(libcares)
2020-03-09 18:28:05 +00:00
BuildRequires: pkgconfig(com_err)
#BuildRequires: pkgconfig(libidn)
BuildRequires: pkgconfig(libidn2)
2018-05-08 17:20:01 +03:00
%if 0%{?ssh2}
2013-01-16 20:45:59 +04:00
BuildRequires: pkgconfig(libssh2)
2018-05-08 17:20:01 +03:00
%else
BuildRequires: pkgconfig(libssh)
%endif
%if %{with libressl}
BuildRequires: pkgconfig(libressl)
%endif
2021-03-09 20:12:34 +03:00
%if %{with gnutls}
2024-06-27 23:01:12 +00:00
BuildRequires: pkgconfig(gnutls) >= 3.7.5
%endif
%if %{with wolfssl}
BuildRequires: pkgconfig(wolfssl) >= 5.7.0
%endif
%if %{with mbedtls}
BuildRequires: pkgconfig(mbedtls)
%endif
%if %{with rustls}
BuildRequires: pkgconfig(rustls)
2021-03-09 20:12:34 +03:00
%endif
2024-06-27 23:01:12 +00:00
2022-05-20 16:17:32 +03:00
#BuildRequires: pkgconfig(openssl)
2024-06-27 23:01:12 +00:00
#BuildRequires: openssl-devel
#BuildRequires: openssl
BuildRequires: pkgconfig(openssl3.3)
2015-02-03 01:06:31 +10:00
BuildRequires: pkgconfig(zlib)
2020-01-30 01:55:46 +03:00
BuildRequires: pkgconfig(krb5-gssapi)
2023-10-12 21:23:06 +00:00
BuildRequires: pkgconfig(libbrotlidec)
BuildRequires: pkgconfig(librtmp)
2024-06-27 23:01:12 +00:00
BuildRequires: pkgconfig(libnghttp2)
BuildRequires: pkgconfig(libgsasl)
BuildRequires: pkgconfig(libzstd)
BuildRequires: pkgconfig(libngtcp2)
# TODO: Package and enable libpsl support
2017-01-26 16:35:43 +03:00
Requires: %{libname} = %{EVRD}
Provides: webfetch = %{EVRD}
2012-02-01 15:13:20 +04:00
%description
curl is a client to get documents/files from servers, using any of the
supported protocols. The command is designed to work without user interaction
or any kind of interactivity.
It offers a busload of useful tricks like proxy support, user authentication,
ftp upload, HTTP post, file transfer resume and more.
2012-02-01 15:13:20 +04:00
This version is compiled with SSL (https) support.
2015-02-03 01:06:31 +10:00
%files
2025-02-05 21:03:02 +00:00
#_docs
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1*
2015-02-03 01:06:31 +10:00
#----------------------------------------------------------------------------
%if %{with libressl}
%package -n curl-libressl
Summary: Gets a file from a FTP, GOPHER or HTTP server
Group: Networking/Other
Provides: curl-gost = %{EVRD}
%description -n curl-libressl
curl is a client to get documents/files from servers, using any of the
supported protocols. The command is designed to work without user interaction
or any kind of interactivity.
It offers a busload of useful tricks like proxy support, user authentication,
ftp upload, HTTP post, file transfer resume and more.
This version is compiled with LibreSSL and is capable of GOST TLS.
%files -n curl-libressl
2025-02-05 21:03:02 +00:00
#_docs
%{_bindir}/curl-libressl
%{_bindir}/curl-gost
%endif
2015-02-03 01:06:31 +10:00
#----------------------------------------------------------------------------
2021-03-09 20:12:34 +03:00
%if %{with gnutls}
%package -n curl-gnutls
Summary: Gets a file from a FTP, GOPHER or HTTP server
Group: Networking/Other
%description -n curl-gnutls
curl is a client to get documents/files from servers, using any of the
supported protocols. The command is designed to work without user interaction
or any kind of interactivity.
It offers a busload of useful tricks like proxy support, user authentication,
ftp upload, HTTP post, file transfer resume and more.
This version is compiled with GnuTLS library.
%files -n curl-gnutls
2025-02-05 21:03:02 +00:00
#_docs
2021-03-09 20:12:34 +03:00
%{_bindir}/curl-gnutls
%endif
2024-06-27 23:01:12 +00:00
#----------------------------------------------------------------------------
%if %{with mbedtls}
%package -n curl-mbedtls
Summary: Gets a file from a FTP, GOPHER or HTTP server
Group: Networking/Other
%description -n curl-mbedtls
curl is a client to get documents/files from servers, using any of the
supported protocols. The command is designed to work without user interaction
or any kind of interactivity.
It offers a busload of useful tricks like proxy support, user authentication,
ftp upload, HTTP post, file transfer resume and more.
This version is compiled with MbedTLS library.
%files -n curl-mbedtls
2025-02-05 21:03:02 +00:00
#_docs
2024-06-27 23:01:12 +00:00
%{_bindir}/curl-mbedtls
%endif
#----------------------------------------------------------------------------
%if %{with wolfssl}
%package -n curl-wolfssl
Summary: Gets a file from a FTP, GOPHER or HTTP server
Group: Networking/Other
%description -n curl-wolfssl
curl is a client to get documents/files from servers, using any of the
supported protocols. The command is designed to work without user interaction
or any kind of interactivity.
It offers a busload of useful tricks like proxy support, user authentication,
ftp upload, HTTP post, file transfer resume and more.
This version is compiled with WolfSSL library.
%files -n curl-wolfssl
2025-02-05 21:03:02 +00:00
#_docs
2024-06-27 23:01:12 +00:00
%{_bindir}/curl-wolfssl
%endif
2021-03-09 20:12:34 +03:00
#----------------------------------------------------------------------------
2012-02-01 15:13:20 +04:00
%package -n %{libname}
Summary: A library of functions for file transfer
Group: Networking/Other
Requires: rootcerts
2012-02-01 15:13:20 +04:00
%description -n %{libname}
libcurl is a library of functions for sending and receiving files through
various protocols, including http and ftp.
You should install this package if you plan to use any applications that
use libcurl.
2015-02-03 01:06:31 +10:00
%files -n %{libname}
2025-02-05 21:03:02 +00:00
#_docs
2015-02-03 01:06:31 +10:00
%{_libdir}/libcurl.so.%{major}*
#----------------------------------------------------------------------------
%if %{with libressl}
%package -n %{libname_libressl}
Summary: A library of functions for file transfer
Group: Networking/Other
Requires: rootcerts
%description -n %{libname_libressl}
libcurl is a library of functions for sending and receiving files through
various protocols, including http and ftp.
You should install this package if you plan to use any applications that
use libcurl.
libcurl-libressl is linked with LibreSSL and is capable of GOST TLS.
%files -n %{libname_libressl}
2025-02-05 21:03:02 +00:00
#_docs
%{_libdir}/libcurl-libressl.so.%{major}*
%endif
2015-02-03 01:06:31 +10:00
#----------------------------------------------------------------------------
2021-03-09 20:12:34 +03:00
%if %{with gnutls}
%package -n %{libname_gnutls}
Summary: A library of functions for file transfer
Group: Networking/Other
Requires: rootcerts
%description -n %{libname_gnutls}
libcurl is a library of functions for sending and receiving files through
various protocols, including http and ftp.
You should install this package if you plan to use any applications that
use libcurl.
libcurl-gnutls is linked with GnuTLS library.
%files -n %{libname_gnutls}
2025-02-05 21:03:02 +00:00
#_docs
2021-03-09 20:12:34 +03:00
%{_libdir}/libcurl-gnutls.so.%{major}*
%endif
2024-06-27 23:01:12 +00:00
#----------------------------------------------------------------------------
%if %{with mbedtls}
%package -n %{libname_mbedtls}
Summary: A library of functions for file transfer
Group: Networking/Other
Requires: rootcerts
%description -n %{libname_mbedtls}
libcurl is a library of functions for sending and receiving files through
various protocols, including http and ftp.
You should install this package if you plan to use any applications that
use libcurl.
libcurl-mbedtls is linked with MbedTLS library.
%files -n %{libname_mbedtls}
2025-02-05 21:03:02 +00:00
#_docs
2024-06-27 23:01:12 +00:00
%{_libdir}/libcurl-mbedtls.so.%{major}*
%endif
#----------------------------------------------------------------------------
%if %{with wolfssl}
%package -n %{libname_wolfssl}
Summary: A library of functions for file transfer
Group: Networking/Other
Requires: rootcerts
%description -n %{libname_wolfssl}
libcurl is a library of functions for sending and receiving files through
various protocols, including http and ftp.
You should install this package if you plan to use any applications that
use libcurl.
libcurl-wolfssl is linked with WolfSSL library.
%files -n %{libname_wolfssl}
2025-02-05 21:03:02 +00:00
#_docs
2024-06-27 23:01:12 +00:00
%{_libdir}/libcurl-wolfssl.so.%{major}*
%endif
2021-03-09 20:12:34 +03:00
#----------------------------------------------------------------------------
2013-09-05 15:44:01 +04:00
%package -n %{devname}
2012-02-01 15:13:20 +04:00
Summary: Header files and static libraries for libcurl
Group: Development/C
2012-07-04 18:06:35 +04:00
Requires: %{libname} = %{EVRD}
Provides: %{name}-devel = %{EVRD}
2012-02-01 15:13:20 +04:00
2013-09-05 15:44:01 +04:00
%description -n %{devname}
2012-02-01 15:13:20 +04:00
libcurl is a library of functions for sending and receiving files through
various protocols, including http and ftp.
You should install this package if you wish to develop applications that
use libcurl.
2015-02-03 01:06:31 +10:00
%files -n %{devname}
2025-02-05 21:03:02 +00:00
#_docs
%{_bindir}/%{name}-config
2015-02-03 01:06:31 +10:00
%{_libdir}/libcurl.so
%{_includedir}/%{name}
2024-06-27 23:01:12 +00:00
#exclude %{_includedir}/curl-libressl
%{_libdir}/pkgconfig/libcurl.pc
2015-02-03 01:06:31 +10:00
%{_datadir}/aclocal/*.m4
2024-06-27 23:01:12 +00:00
#{_mandir}/man1/%{name}-config.1*
2015-02-03 01:06:31 +10:00
%{_mandir}/man3/*
#----------------------------------------------------------------------------
%if %{with libressl}
2020-01-30 03:06:43 +03:00
%package -n %{devname_libressl}
Summary: Header files and devel libraries for libcurl with LibreSSL
Group: Development/C
Requires: %{libname_libressl} = %{EVRD}
Provides: %{name}-libressl-devel = %{EVRD}
Provides: %{name}-gost-devel = %{EVRD}
%description -n %{devname_libressl}
libcurl is a library of functions for sending and receiving files through
various protocols, including http and ftp.
You should install this package if you wish to develop applications that
use libcurl linked with LibreSSL and capable of GOST.
%files -n %{devname_libressl}
2025-02-05 21:03:02 +00:00
#_docs
%{_includedir}/curl-libressl
%{_libdir}/pkgconfig/libcurl-libressl.pc
%{_libdir}/libcurl-libressl.so
2020-01-30 03:06:43 +03:00
%endif
2015-02-03 01:06:31 +10:00
#----------------------------------------------------------------------------
2021-03-09 20:12:34 +03:00
%if %{with gnutls}
%package -n %{devname_gnutls}
Summary: Header files and devel libraries for libcurl with gnutls
Group: Development/C
Requires: %{libname_gnutls} = %{EVRD}
Provides: %{name}-gnutls-devel = %{EVRD}
%description -n %{devname_gnutls}
libcurl is a library of functions for sending and receiving files through
various protocols, including http and ftp.
You should install this package if you wish to develop applications that
use libcurl linked with gnutls and capable of GOST.
%files -n %{devname_gnutls}
2025-02-05 21:03:02 +00:00
#_docs
2021-03-09 20:12:34 +03:00
%{_includedir}/curl-gnutls
%{_libdir}/pkgconfig/libcurl-gnutls.pc
%{_libdir}/libcurl-gnutls.so
2024-06-27 23:01:12 +00:00
%endif
#----------------------------------------------------------------------------
%if %{with mbedtls}
%package -n %{devname_mbedtls}
Summary: Header files and devel libraries for libcurl with mbedtls
Group: Development/C
Requires: %{libname_mbedtls} = %{EVRD}
Provides: %{name}-mbedtls-devel = %{EVRD}
%description -n %{devname_mbedtls}
libcurl is a library of functions for sending and receiving files through
various protocols, including http and ftp.
You should install this package if you wish to develop applications that
use libcurl linked with gnutls and capable of GOST.
%files -n %{devname_mbedtls}
2025-02-05 21:03:02 +00:00
#_docs
2024-06-27 23:01:12 +00:00
%{_includedir}/curl-mbedtls
%{_libdir}/pkgconfig/libcurl-mbedtls.pc
%{_libdir}/libcurl-mbedtls.so
%endif
#----------------------------------------------------------------------------
%if %{with wolfssl}
%package -n %{devname_wolfssl}
Summary: Header files and devel libraries for libcurl with wolfssl
Group: Development/C
Requires: %{libname_wolfssl} = %{EVRD}
Provides: %{name}-wolfssl-devel = %{EVRD}
%description -n %{devname_wolfssl}
libcurl is a library of functions for sending and receiving files through
various protocols, including http and ftp.
You should install this package if you wish to develop applications that
use libcurl linked with gnutls and capable of GOST.
%files -n %{devname_wolfssl}
2025-02-05 21:03:02 +00:00
#_docs
2024-06-27 23:01:12 +00:00
%{_includedir}/curl-wolfssl
%{_libdir}/pkgconfig/libcurl-wolfssl.pc
%{_libdir}/libcurl-wolfssl.so
2021-03-09 20:12:34 +03:00
%endif
#----------------------------------------------------------------------------
2012-02-01 15:13:20 +04:00
%package examples
Summary: Example files for %{name} development
Group: Development/C
2015-02-03 01:06:31 +10:00
Requires: %{name}-devel = %{EVRD}
2013-01-16 20:45:59 +04:00
BuildArch: noarch
2012-02-01 15:13:20 +04:00
%description examples
Example files for %{name} development.
2015-02-03 01:06:31 +10:00
%files examples
%doc docs/examples
#----------------------------------------------------------------------------
2012-02-01 15:13:20 +04:00
%prep
%setup -q -n curl-curl-%(echo %{version} | sed -e 's,\.,_,g')
cp libcurl.pc.in libcurl.pc.in.0
2024-06-27 23:01:12 +00:00
2024-09-18 08:04:49 +00:00
#patch3 -p1
#patch4 -p1
2024-06-02 10:46:09 +00:00
#apply_patches
2024-09-18 08:04:49 +00:00
2021-09-07 21:28:56 +03:00
# Prevent configure script from discarding -g in CFLAGS
# https://bugzilla.redhat.com/show_bug.cgi?id=496778
for i in flags_dbg_all flags_opt_all flags_opt_yes flags_dbg_yes
do
sed -i'' -E -e "s,flags_dbg_yes=.+,flags_dbg_yes=''," m4/curl-compilers.m4
done
# after Patch3 curl-libressl.patch
# 0 - original (OpenSSL), 1 - patched (LibreSSL)
cp libcurl.pc.in libcurl.pc.in.1
regexp="$(echo %{ssl_list} | sed -e 's, ,|,g')"
for i in %{ssl_list}; do
mkdir -p "$i"
cp -r $(ls -1v | grep -vE "$regexp") "$i"/
done
# remove "-DEV" from useragent ("curl/7.74.0-DEV" -> "curl/7.74.0")
sed -i -e 's,-DEV\",\",' include/curl/curlver.h
# %%_docs copy docs/*.md, remove odd ones
2024-09-18 08:04:49 +00:00
#rm -fv docs/README.md
# build scripts seem to remove useful files, backup them
2024-09-18 08:04:49 +00:00
#mkdir -p _docs/
#rsync -av --relative --progress $(echo "%_docs" | sed -e 's,%doc,,g' -e 's,_docs/,,g') _docs/
2024-09-18 08:04:49 +00:00
#rm -fr $(ls -1v | grep -vE "${regexp}|docs|COPYING|CHANGES")
2012-02-01 15:13:20 +04:00
%build
2020-01-13 14:41:59 +03:00
%setup_compile_flags
%shell_begin
ADD_CONF_OPTS=""
case "$SSL" in
libressl )
2024-07-01 14:07:04 +00:00
libressl_prefix=/opt/libressl/
2021-03-09 20:12:34 +03:00
with_gnutls=without
2021-09-07 21:28:56 +03:00
with_openssl=with
2024-06-27 23:01:12 +00:00
with_quic=without
cp libcurl.pc.in.1 libcurl.pc.in
2024-06-29 12:53:48 +00:00
export PREFIX_OPENSSL=/opt/openssl3.3
2024-06-27 23:01:12 +00:00
# validate that correct file is being used
2024-07-01 14:07:04 +00:00
grep -q LIBRESSL_ libcurl.pc.in
new_libname=libcurl-libressl
2021-09-07 21:28:56 +03:00
sed -i'' m4/curl-openssl.m4 \
-e 's,openssl.pc,libressl.pc,g' \
-e 's,PKGCONFIG(openssl,PKGCONFIG(libressl,g' \
-e 's,$PREFIX_OPENSSL/lib$libsuff,$PREFIX_OPENSSL/lib,g'
2024-06-27 23:01:12 +00:00
# $LIBS apply to libcurl.so only, so there will not be overlinking
# even if to add -lxxx here
export LIBS="$(pkg-config --cflags-only-I --libs-only-L libressl)"
export CFLAGS="$LIBS"
2024-06-29 12:53:48 +00:00
# export PREFIX_OPENSSL=%{libressl_prefix}
2024-06-27 23:01:12 +00:00
# It will be /usr/include/curl-libressl/curl
# to allow '#include <curl/xxx.h> to work with -I/usr/include/curl-libressl
ADD_CONF_OPTS="\
--includedir=%{_includedir}/curl-libressl \
2024-06-27 23:01:12 +00:00
--with-openssl \
--without-wolfssl \
--without-gnutls \
2024-06-29 12:53:48 +00:00
--without-mbedtls \
2024-06-27 23:01:12 +00:00
--without-nghttp3 \
2024-07-01 14:07:04 +00:00
--with-libressl \
"
;;
openssl )
2021-03-09 20:12:34 +03:00
with_gnutls=without
2021-09-07 21:28:56 +03:00
with_openssl=with
2024-06-27 23:01:12 +00:00
with_quic=with
cp libcurl.pc.in.0 libcurl.pc.in
! grep -q LIBRESSL_ libcurl.pc.in
new_libname=libcurl
export LIBS="$(pkg-config --cflags-only-I --libs-only-L openssl)"
export CFLAGS="$LIBS"
2024-06-27 23:01:12 +00:00
export PREFIX_OPENSSL=/opt/openssl3.3
2024-06-29 12:53:48 +00:00
ADD_CONF_OPTS="\
2024-07-01 14:07:04 +00:00
--with-openssl=/opt/openssl3.3 \
2024-06-29 12:53:48 +00:00
--without-libressl \
--without-wolfssl \
--without-gnutls \
--without-mbedtls \
--with-nghttp3 \
--with-openssl-quic \
2024-07-01 14:07:04 +00:00
--without-ngtcp2 \
--without-quiche \
--without-msh3 \
2024-06-29 12:53:48 +00:00
"
2021-03-09 20:12:34 +03:00
;;
gnutls )
with_gnutls=with
2021-09-07 21:28:56 +03:00
with_openssl=without
2024-06-27 23:01:12 +00:00
with_quic=without
2024-06-29 12:53:48 +00:00
export PREFIX_OPENSSL=/opt/openssl3.3
2021-03-09 20:12:34 +03:00
new_libname=libcurl-gnutls
# It will be /usr/include/curl-libressl/gnutls
# to allow '#include <curl/xxx.h> to work with -I/usr/include/curl-gnuttls
ADD_CONF_OPTS="\
--includedir=%{_includedir}/curl-gnutls \
2024-06-29 12:53:48 +00:00
--with-gnutls \
2024-06-27 23:01:12 +00:00
--without-nghttp3 \
2024-06-29 12:53:48 +00:00
--without-libressl \
--without-wolfssl \
--without-mbedtls \
PREFIX_OPENSSL=/opt/openssl3.3 \
2024-06-27 23:01:12 +00:00
"
;;
mbedtls )
with_gnutls=without
with_openssl=without
with_quic=without
new_libname=libcurl-mbedtls
# It will be /usr/include/curl-libressl/gnutls
# to allow '#include <curl/xxx.h> to work with -I/usr/include/curl-gnuttls
ADD_CONF_OPTS="\
--includedir=%{_includedir}/curl-mbedtls \
--with-mbedtls \
--without-wolfssl \
--without-nghttp3 \
--without-openssl \
2024-06-29 12:53:48 +00:00
--without-libressl \
2021-03-09 20:12:34 +03:00
"
;;
2024-06-27 23:01:12 +00:00
wolfssl )
with_gnutls=without
with_openssl=without
with_quic=without
new_libname=libcurl-wolfssl
# It will be /usr/include/curl-libressl/gnutls
# to allow '#include <curl/xxx.h> to work with -I/usr/include/curl-gnuttls
ADD_CONF_OPTS="\
--includedir=%{_includedir}/curl-wolfssl \
--with-wolfssl \
--without-mbedtls \
--without-openssl \
--without-nghttp3 \
"
;;
* ) echo 'Unknown $SSL' && exit 1 ;;
esac
2012-02-01 15:13:20 +04:00
autoreconf -fiv
sed -i configure \
-e "s,\$libname,${new_libname},g" \
-e "s,\${libname},${new_libname},g"
2012-02-01 15:13:20 +04:00
2024-06-27 23:01:12 +00:00
#configure --help
#exit 1
2020-01-04 03:09:28 +03:00
%configure \
2013-01-16 20:45:59 +04:00
--disable-static \
2021-09-07 21:28:56 +03:00
--${with_openssl}-openssl \
2021-03-09 20:12:34 +03:00
--${with_gnutls}-gnutls \
--without-bearssl \
2012-02-01 15:13:20 +04:00
--with-zlib \
2013-01-16 20:45:59 +04:00
--with-lber-lib=lber \
--with-libidn2 \
2018-05-08 17:20:01 +03:00
%if 0%{?ssh2}
2012-02-01 15:13:20 +04:00
--with-ssh2 \
2018-05-08 17:20:01 +03:00
%else
--with-libssh \
%endif
2012-02-01 15:13:20 +04:00
--with-random \
--enable-hidden-symbols \
--enable-optimize \
--enable-nonblocking \
--enable-thread \
--enable-crypto-auth \
--enable-libgcc \
--enable-ldaps \
--enable-ipv6 \
2019-12-26 08:45:43 +03:00
--with-ca-bundle=%{_openssldir}/certs/ca-bundle.crt \
2012-02-01 15:13:20 +04:00
--with-gssapi=%{_prefix} \
--enable-ares \
--enable-tls-srp \
--without-libpsl \
2023-10-12 21:23:06 +00:00
--with-brotli \
--with-librtmp \
--with-nghttp2 \
--enable-websockets \
$ADD_CONF_OPTS --
2012-02-01 15:13:20 +04:00
2023-10-12 21:23:06 +00:00
#--enable-ech
#--with-hyper
2020-01-13 14:41:59 +03:00
%make
2012-02-01 15:13:20 +04:00
2013-09-05 15:44:01 +04:00
# we don't want them in curl-examples:
rm -r docs/examples/.deps ||:
2021-09-07 21:55:27 +03:00
find docs/examples -name .gitignore -print -delete
2013-09-05 15:44:01 +04:00
%shell_end
2012-02-01 15:13:20 +04:00
%install
2024-06-27 23:01:12 +00:00
install -d %{buildroot}%{_bindir} \
%{buildroot}%{_libdir}/pkgconfig \
%{buildroot}%{_includedir}
%shell_begin
case "$SSL" in
openssl )
2020-01-13 14:41:59 +03:00
%makeinstall_std
;;
libressl )
2021-03-09 20:12:34 +03:00
tmp="$(mktemp -d -p $PWD)"
mkdir -p "$tmp"
make DESTDIR="${tmp}" install
mv -v ${tmp}%{_bindir}/curl %{buildroot}%{_bindir}/curl-libressl
mv -v ${tmp}%{_libdir}/libcurl-libressl* %{buildroot}%{_libdir}
mv -v ${tmp}%{_includedir}/curl-libressl %{buildroot}%{_includedir}/
2019-12-26 08:38:08 +03:00
cat ${tmp}%{_libdir}/pkgconfig/libcurl.pc | \
sed -r \
-e 's,^Name:.+,Name: libcurl-libressl,g' \
-e 's,-lcurl,-lcurl-libressl,g' \
-e "s,@LIBRESSL_LIBS@,$(pkg-config --libs-only-L libressl),g" \
-e "s,@LIBRESSL_LIBS_PRIVATE@,,g" \
-e "s,@LIBRESSL_CFLAGS@,$(pkg-config --cflags-only-I libressl),g" \
> %{buildroot}%{_libdir}/pkgconfig/libcurl-libressl.pc
#rm -fr "$tmp"
;;
2021-03-09 20:12:34 +03:00
gnutls )
tmp="$(mktemp -d -p $PWD)"
mkdir -p "$tmp"
make DESTDIR="${tmp}" install
mv -v ${tmp}%{_bindir}/curl %{buildroot}%{_bindir}/curl-gnutls
mv -v ${tmp}%{_libdir}/libcurl-gnutls* %{buildroot}%{_libdir}
mv -v ${tmp}%{_includedir}/curl-gnutls %{buildroot}%{_includedir}/
cat ${tmp}%{_libdir}/pkgconfig/libcurl.pc | \
sed -r \
-e 's,^Name:.+,Name: libcurl-gnutls,g' \
-e 's,-lcurl,-lcurl-gnutls,g' \
-e 's,-I$\{includedir\},-I$\{includedir\} -I$\{includedir\}/curl-gnutls,' \
> %{buildroot}%{_libdir}/pkgconfig/libcurl-gnutls.pc
;;
2024-06-27 23:01:12 +00:00
mbedtls )
tmp="$(mktemp -d -p $PWD)"
mkdir -p "$tmp"
make DESTDIR="${tmp}" install
mv -v ${tmp}%{_bindir}/curl %{buildroot}%{_bindir}/curl-mbedtls
mv -v ${tmp}%{_libdir}/libcurl-mbedtls* %{buildroot}%{_libdir}
mv -v ${tmp}%{_includedir}/curl-mbedtls %{buildroot}%{_includedir}/
cat ${tmp}%{_libdir}/pkgconfig/libcurl.pc | \
sed -r \
-e 's,^Name:.+,Name: libcurl-mbedtls,g' \
-e 's,-lcurl,-lcurl-mbedtls,g' \
-e 's,-I$\{includedir\},-I$\{includedir\} -I$\{includedir\}/curl-mbedtls,' \
> %{buildroot}%{_libdir}/pkgconfig/libcurl-mbedtls.pc
;;
wolfssl )
tmp="$(mktemp -d -p $PWD)"
mkdir -p "$tmp"
make DESTDIR="${tmp}" install
mv -v ${tmp}%{_bindir}/curl %{buildroot}%{_bindir}/curl-wolfssl
mv -v ${tmp}%{_libdir}/libcurl-wolfssl* %{buildroot}%{_libdir}
mv -v ${tmp}%{_includedir}/curl-wolfssl %{buildroot}%{_includedir}/
cat ${tmp}%{_libdir}/pkgconfig/libcurl.pc | \
sed -r \
-e 's,^Name:.+,Name: libcurl-wolfssl,g' \
-e 's,-lcurl,-lcurl-wolfssl,g' \
-e 's,-I$\{includedir\},-I$\{includedir\} -I$\{includedir\}/curl-wolfssl,' \
> %{buildroot}%{_libdir}/pkgconfig/libcurl-wolfssl.pc
;;
* ) echo 'Unknown $SSL' && exit 1 ;;
esac
2012-02-01 15:13:20 +04:00
2021-09-07 21:55:27 +03:00
%shell_end
2012-02-01 15:13:20 +04:00
# [july 2008] HACK. to be replaced by a real fix
2024-06-27 23:01:12 +00:00
#sed -i -e 's!-Wl,--as-needed!!' -e 's!-Wl,--no-undefined!!' %{buildroot}%{_bindir}/%{name}-config
#sed -i -e 's!-Wl,--as-needed!!' -e 's!-Wl,--no-undefined!!' %{buildroot}%{_libdir}/pkgconfig/*.pc
2012-02-01 15:13:20 +04:00
# (tpg) use rootcerts's certificates #35917
find %{buildroot} -name ca-bundle.crt -exec rm -f '{}' \;
# we don't package mk-ca-bundle so we don't need man for it
2013-01-16 20:45:59 +04:00
rm -f %{buildroot}%{_mandir}/man1/mk-ca-bundle.1*
%if %{with libressl}
( cd %{buildroot}%{_bindir} ; ln -s curl-libressl curl-gost )
%endif
%check
export LD_LIBRARY_PATH=%{buildroot}%{_libdir}
%if %{with libressl}
readelf -a %{buildroot}%{_bindir}/curl-libressl | grep NEEDED | grep -q libcurl-libressl
readelf -a %{buildroot}%{_libdir}/libcurl-libressl.so | grep SONAME | grep -q libcurl-libressl
readelf -a %{buildroot}%{_libdir}/libcurl-libressl.so | grep NEEDED | grep -q 'libssl.so.%{libressl_libssl_sover}'
readelf -a %{buildroot}%{_libdir}/libcurl-libressl.so | grep NEEDED | grep -q 'libcrypto.so.%{libressl_libcrypto_sover}'
2024-06-29 12:53:48 +00:00
#readelf -a %{buildroot}%{_libdir}/libcurl-gnutls.so | grep NEEDED | grep -q 'libgnutls.so.'
#! readelf -a %{buildroot}%{_libdir}/libcurl.so | grep SONAME | grep -q libcurl-libressl
#readelf -a %{buildroot}%{_libdir}/libcurl-gnutls.so | grep SONAME | grep -q libcurl-gnutls
# Check that GSS-API has been enabled
2024-06-29 12:53:48 +00:00
#readelf -a %{buildroot}%{_libdir}/libcurl.so | grep NEEDED | grep -q libgssapi
readelf -a %{buildroot}%{_libdir}/libcurl-libressl.so | grep NEEDED | grep -q libgssapi
2024-06-29 12:53:48 +00:00
#readelf -a %{buildroot}%{_libdir}/libcurl-gnutls.so | grep NEEDED | grep -q libgssapi
# This test will not fail if there is no connection with internet
# --insecure to ignore missing SSL certificate
if %{buildroot}%{_bindir}/curl-libressl --insecure \
"https://www.cryptopro.ru:4444/test/tls-cli.asp" 2>&1 | \
grep -q ':unsupported algorithm$' ;
then
echo "GOST is not supported"
exit 1
fi
2024-06-29 12:53:48 +00:00
%endif