!6 修复由openssl 升级引起的编译失败

From: @lyn1001 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
This commit is contained in:
openeuler-ci-bot 2023-02-02 10:48:09 +00:00 committed by Gitee
commit cc1e68c645
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -4,8 +4,8 @@
%global library_name ntlm_auth
Name: python-%{srcname}
Version: 1.5.0
Release: 1
Summary: Python 3 compatible NTLM library
Release: 2
Summary: Python 3 compatible NTLM library (requires md4, thus legacy OpenSSL settings)
License: MIT
URL: https://pypi.python.org/pypi/%{pypi_name}
Source0: https://github.com/%{gh_owner}/%{pypi_name}/archive/v%{version}.tar.gz#/%{srcname}-%{version}.tar.gz
@ -13,9 +13,12 @@ BuildArch: noarch
BuildRequires: python3-setuptools python3-devel python3-pytest python3-requests
BuildRequires: python3dist(cryptography)
%description
This package allows Python clients running on any operating system to provide
This package allows Python clients running on any operating system to provide
NTLM authentication to a supporting server.
With OpenSSL 3 or above, the legacy OpenSSL provider needs to be set in order
to support md4 in Python.
%package -n python3-%{srcname}
Obsoletes: python3-ntlm3 < 1.0.3-1
Provides: python3-ntlm3 = %{version}-%{release}
@ -36,6 +39,26 @@ rm -rf %{pypi_name}.egg-info
%py3_install
%check
# see https://github.com/jborean93/ntlm-auth/issues/22
cat > openssl.cnf << EOF
openssl_conf = openssl_init
[openssl_init]
providers = provider_sect
[provider_sect]
default = default_sect
legacy = legacy_sect
[default_sect]
activate = 1
[legacy_sect]
activate = 1
EOF
export OPENSSL_CONF=${PWD}/openssl.cnf
%{__python3} -m pytest --ignore=tests/functional/test_iis.py tests
%files -n python3-%{srcname}
@ -45,6 +68,9 @@ rm -rf %{pypi_name}.egg-info
%{python3_sitelib}/%{library_name}-%{version}-py%{python3_version}.egg-info
%changelog
* Thu Feb 2 2023 liyanan <liyanan32@h-partners.com> - 1.5.0-2
- Use the legacy OpenSSL provider in %check to support md4
* Thu Jun 23 2022 SimpleUpdate Robot <tc@openeuler.org> - 1.5.0-1
- Upgrade to version 1.5.0