This commit is contained in:
Sergey Zhemoytel 2024-06-29 12:53:48 +00:00
parent 65bd57f9ff
commit 82ac98360b

View file

@ -15,12 +15,12 @@
# HTTP/3 / QUIC
%bcond_without quic
%bcond_without openssl
%bcond_with openssl
# 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
%bcond_with libressl
%bcond_without libressl
# Quite a lot of third-party software is compiled on Debian/Ubuntu
# and is linked with libcurl dynamically, Debian's invention libcurl-gnutls.so
@ -29,14 +29,14 @@
# - OnlyOffice DesktopEditors (and probably R7 Office)
# - SberPro https://www.sberbank.ru/ru/legal/new/sbrfbusiness
# GnuTLS, btw, is also capable of GOST.
%bcond_without gnutls
%bcond_with gnutls
# alternaatives SSL
# v5.7.0-stable https://github.com/wolfSSL/wolfssl
%bcond_without wolfssl
%bcond_with wolfssl
# Embedded TLS
%bcond_without mbedtls
%bcond_with mbedtls
# RusTLS
%bcond_with rustls
@ -69,7 +69,7 @@
Summary: Gets a file from a FTP, GOPHER or HTTP server
Name: curl
Version: 8.8.0
Release: 1
Release: 2
Epoch: 1
License: BSD-like
Group: Networking/Other
@ -494,6 +494,7 @@ case "$SSL" in
with_openssl=with
with_quic=without
cp libcurl.pc.in.1 libcurl.pc.in
export PREFIX_OPENSSL=/opt/openssl3.3
# validate that correct file is being used
# grep -q LIBRESSL_ libcurl.pc.in
new_libname=libcurl-libressl
@ -505,15 +506,16 @@ case "$SSL" in
# even if to add -lxxx here
export LIBS="$(pkg-config --cflags-only-I --libs-only-L libressl)"
export CFLAGS="$LIBS"
export PREFIX_OPENSSL=%{libressl_prefix}
# export PREFIX_OPENSSL=%{libressl_prefix}
# 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 \
PREFIX_OPENSSL=%{libressl_prefix} \
PREFIX_OPENSSL=/opt/openssl3.3 \
--with-openssl \
--without-wolfssl \
--without-gnutls \
--without-mbedtls \
--without-nghttp3 \
"
;;
@ -527,18 +529,33 @@ case "$SSL" in
export LIBS="$(pkg-config --cflags-only-I --libs-only-L openssl)"
export CFLAGS="$LIBS"
export PREFIX_OPENSSL=/opt/openssl3.3
ADD_CONF_OPTS=""
ADD_CONF_OPTS="\
PREFIX_OPENSSL=/opt/openssl3.3 \
--with-openssl \
--without-libressl \
--without-wolfssl \
--without-gnutls \
--without-mbedtls \
--with-nghttp3 \
--with-openssl-quic \
"
;;
gnutls )
with_gnutls=with
with_openssl=without
with_quic=without
export PREFIX_OPENSSL=/opt/openssl3.3
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 \
--with-gnutls \
--without-nghttp3 \
--without-libressl \
--without-wolfssl \
--without-mbedtls \
PREFIX_OPENSSL=/opt/openssl3.3 \
"
;;
mbedtls )
@ -554,6 +571,7 @@ case "$SSL" in
--without-wolfssl \
--without-nghttp3 \
--without-openssl \
--without-libressl \
"
;;
wolfssl )
@ -727,13 +745,13 @@ readelf -a %{buildroot}%{_bindir}/curl-libressl | grep NEEDED | grep -q libcurl-
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}'
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
#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
readelf -a %{buildroot}%{_libdir}/libcurl.so | grep NEEDED | grep -q libgssapi
#readelf -a %{buildroot}%{_libdir}/libcurl.so | grep NEEDED | grep -q libgssapi
readelf -a %{buildroot}%{_libdir}/libcurl-libressl.so | grep NEEDED | grep -q libgssapi
readelf -a %{buildroot}%{_libdir}/libcurl-gnutls.so | grep NEEDED | grep -q libgssapi
#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 \
@ -743,4 +761,8 @@ then
echo "GOST is not supported"
exit 1
fi
export LD_LIBRARY_PATH=/opt/openssl3.3/lib:${LD_LIBRARY_PATH}
%{buildroot}%{_bindir}/curl-libressl --insecure https://www.cryptopro.ru:4444/test/tls-cli.asp
%endif