m2crypto/m2crypto.spec
starlet-dx 6cb405ce6f Fix CVE-2020-25657
(cherry picked from commit b32f1d4be1dc6c88e8c2ae083740acce38bf44c2)
2022-08-17 17:41:38 +08:00

88 lines
2.9 KiB
RPMSpec

Name: m2crypto
Summary: A crypto and SSL toolkit for Python
Version: 0.30.1
Release: 5
License: MIT
URL: https://gitlab.com/m2crypto/m2crypto/
Source0: https://files.pythonhosted.org/packages/41/50/7d85dc99b1c4f29eca83873d851ec29a8e484a66b31351e62e30be9db7d1/M2Crypto-0.30.1.tar.gz
Source1: https://files.pythonhosted.org/packages/41/50/7d85dc99b1c4f29eca83873d851ec29a8e484a66b31351e62e30be9db7d1/M2Crypto-0.30.1.tar.gz.asc
# https://gitlab.com/m2crypto/m2crypto/commit/83d4d9bc3aa4466e540fa00f8cc6891c0301ec82
Patch0: CVE-2020-25657-pre1.patch
# https://gitlab.com/m2crypto/m2crypto/commit/0b22d79082afd7c564b2ac07fb0ef5d76d692586
Patch1: CVE-2020-25657-pre2.patch
# https://gitlab.com/m2crypto/m2crypto/commit/3ee65bd56e92f8f3c465947b6752d92d5986dc81
Patch2: CVE-2020-25657-pre3.patch
# https://gitlab.com/m2crypto/m2crypto/commit/d06eaa88a5f491827733f32027c46de3557fbd05
Patch3: CVE-2020-25657-pre4.patch
# https://gitlab.com/m2crypto/m2crypto/commit/84c53958def0f510e92119fca14d74f94215827a
Patch4: CVE-2020-25657.patch
Requires: python2-typing
BuildRequires: openssl openssl-devel perl-interpreter pkgconfig python2-typing swig which
BuildRequires: python3-devel python3-setuptools python2-devel python2-setuptools
%description
M2Crypto is a crypto and SSL toolkit for Python. It allows you to call OpenSSL functions from Python2 scripts.
%package -n python3-m2crypto
Summary: A crypto and SSL toolkit for Python3
%description -n python3-m2crypto
python3-m2crypto is a crypto and SSL toolkit for Python3. It allows you to call OpenSSL functions from Python3 scripts.
%prep
%autosetup -n M2Crypto-%{version} -c -p1
cp -a M2Crypto-%{version} M2Crypto-python3
%build
export CFLAGS="$RPM_OPT_FLAGS"
if pkg-config openssl ; then
export CFLAGS="$CFLAGS `pkg-config --cflags openssl`"
export LDFLAGS="$LDFLAGS`pkg-config --libs-only-L openssl`"
fi
cd M2Crypto-%{version}
%{__python2} setup.py build
cd ../M2Crypto-python3
%{__python3} setup.py build
%install
cd M2Crypto-%{version}
%{__python2} setup.py install --root=$RPM_BUILD_ROOT
cd ../M2Crypto-python3
%{__python3} setup.py install --root=$RPM_BUILD_ROOT
%check
%if 0%{?_with_check}
cd M2Crypto-%{version}
%{__python2} setup.py test
cd ../M2Crypto-python3
%{__python3} setup.py test
%endif
%files
%doc M2Crypto-%{version}/{CHANGES,LICENCE,README.rst}
%{python2_sitearch}/M2Crypto
%{python2_sitearch}/M2Crypto-*.egg-info
%files -n python3-m2crypto
%doc M2Crypto-python3/{CHANGES,LICENCE,README.rst}
%{python3_sitearch}/M2Crypto
%{python3_sitearch}/M2Crypto-*.egg-info
%changelog
* Wed Aug 17 2022 yaoxin <yaoxin30@h-partners.com> - 0.30.1-5
- Fix CVE-2020-25657
* Thu Aug 18 2020 xinghe <xinghe1@huawei.com> - 0.30.1-4
- add release version for update
* Wed Nov 06 2019 Lijin Yang <yanglijin@huawei.com> - 0.30.1-3
- init package