future/future.spec
starlet-dx bf224afe52 Fix CVE-2022-40899
(cherry picked from commit 6fbcd802e72c79fcf573ac9c2ce40ef0564f0124)
2023-03-13 09:10:02 +08:00

84 lines
3.0 KiB
RPMSpec

%global with_tests 0%{?_with_tests:0}
%global desc \
This package intends to provides a compatibility layer for Python between its \
two version release. The future and past packages are both provides for backports \
and forwards, in which you are able to use a single, clean codebase to run under \
Python3 environmets easily. With also providing futurize and pasteurize scripts, \
you can convert you Python code to support both version.
%{!?python3_shortver: %global python3_shortver %(%{__python3} -c 'import sys; print(str(sys.version_info.major) + "." + str(sys.version_info.minor))')}
Name: future
Version: 0.18.2
Release: 2
Summary: Missing compatibility layer on Python 3
License: MIT
URL: http://python-future.org/
Source0: https://files.pythonhosted.org/packages/45/0b/38b06fd9b92dc2b68d58b75f900e97884c45bedd2ff83203d933cf5851c9/future-0.18.2.tar.gz
Patch0: CVE-2022-40899.patch
BuildArch: noarch
%description
%{desc}
%package -n python3-future
Summary: Missing compatibility layer on Python 3
%{?python_provide:%python_provide python3-future}
BuildRequires: python3-devel python3-setuptools python3-numpy python3-requests python3-pytest
%description -n python3-future
%{desc}
%prep
%autosetup -p1
%build
CFLAGS="%{optflags}" %{__python3} setup.py build --executable="%{__python3} -s"
%install
CFLAGS="%{optflags}" %{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
mv $RPM_BUILD_ROOT%{_bindir}/futurize $RPM_BUILD_ROOT%{_bindir}/python3-futurize
mv $RPM_BUILD_ROOT%{_bindir}/pasteurize $RPM_BUILD_ROOT%{_bindir}/python3-pasteurize
sed -i -e '/^#!\//, 1d' $RPM_BUILD_ROOT%{python3_sitelib}/future/backports/test/pystone.py
touch futurize-3 futurize-%{?python3_shortver}
install -p futurize-3 futurize-%{?python3_shortver} $RPM_BUILD_ROOT%{_bindir}
ln -sf %{_bindir}/python3-futurize $RPM_BUILD_ROOT%{_bindir}/futurize-3
ln -sf %{_bindir}/python3-futurize $RPM_BUILD_ROOT%{_bindir}/futurize-%{?python3_shortver}
touch pasteurize-3 pasteurize-%{?python3_shortver}
install -p pasteurize-3 pasteurize-%{?python3_shortver} $RPM_BUILD_ROOT%{_bindir}
ln -sf %{_bindir}/python3-pasteurize $RPM_BUILD_ROOT%{_bindir}/pasteurize-3
ln -sf %{_bindir}/python3-pasteurize $RPM_BUILD_ROOT%{_bindir}/pasteurize-%{?python3_shortver}
%check
%if %{with_tests}
PYTHONPATH=$PWD/build/lib py.test-3 -v
%endif
%files -n python3-future
%{!?_licensedir:%global license %doc}
%license LICENSE.txt
%doc README.rst
%{_bindir}/futurize-3
%{_bindir}/futurize-%{?python3_shortver}
%{_bindir}/pasteurize-3
%{_bindir}/pasteurize-%{?python3_shortver}
%{_bindir}/python3-futurize
%{_bindir}/python3-pasteurize
%{python3_sitelib}/*
%changelog
* Fri Mar 10 2023 yaoxin <yaoxin30@h-partners.com> - 0.18.2-2
- Fix CVE-2022-40899
* Wed Jul 14 2021 liksh <liks11@chinaunicom.cn> - 0.18.2-1
- update package from 0.16.0 to 0.18.2
* Wed Oct 21 2020 leiju <leiju4@huawei.com> - 0.16.0-12
- remove python2 subpackage
* Thu Jan 09 2020 lihao <lihao129@huawei.com> - 0.16.0-11
- Package Init