remove python2

This commit is contained in:
19909236985 2020-10-30 16:14:05 +08:00
parent ce289b3485
commit d00082f56a

View File

@ -1,11 +1,10 @@
%bcond_without python2
%bcond_with python3
%global oname rtslib-fb
Name: python-rtslib
Version: 2.1.70
Release: 5
Release: 6
Summary: Python object API for Linux kernel LIO SCSI target
License: ASL 2.0
@ -15,7 +14,7 @@ Patch1: 0001-saveconfig-copy-temp-configfile-with-permissions.patch
Patch2: 0002-saveconfig-open-the-temp-configfile-with-modes-set.patch
BuildArch: noarch
BuildRequires: epydoc, systemd-units
BuildRequires: systemd-units
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
@ -28,19 +27,6 @@ Obsoletes: python-rtslib-doc
which includes the 'target' service and targetctl tool for restoring
configuration.
%if %{with python2}
%package -n python2-rtslib
Summary: Python2 object API for Linux kernel LIO SCSI target
BuildRequires: python2-devel, python2-setuptools
Requires: python2-kmod, python2-six, python2-pyudev
%{?python_provide:%python_provide python2-rtslib}
%description -n python2-rtslib
python2-rtslib is a python object API for generic Linux SCSI kernel
target which includes the 'target' service and targetctl tool for
restoring configuration.
%endif
%if %{with python3}
%package -n python3-rtslib
Summary: Python3 object API for Linux kernel LIO SCSI target
@ -58,8 +44,6 @@ restoring configuration.
Summary: Systemd service for targetcli/rtslib
%if %{with python3}
Requires: python3-rtslib = %{version}-%{release}
%else
Requires: python2-rtslib = %{version}-%{release}
%endif
%description -n target-restore
@ -77,12 +61,6 @@ cp -a . %{py3dir}
%endif
%build
%if %{with python2}
%py2_build
mkdir -p doc/html
epydoc --no-sourcecode --html -n rtslib -o doc/html rtslib/*.py
%endif
gzip --stdout doc/targetctl.8 > doc/targetctl.8.gz
gzip --stdout doc/saveconfig.json.5 > doc/saveconfig.json.5.gz
@ -97,14 +75,6 @@ popd
pushd %{py3dir}
%py3_install
popd
%if %{with python2}
%{__python2} setup.py install --skip-build --root %{buildroot} --install-scripts py2scripts
rm -rf %{buildroot}/py2scripts
%endif
%else
%if %{with python2}
%py2_install
%endif
%endif
mkdir -p %{buildroot}%{_mandir}/man8/
@ -126,13 +96,6 @@ install -m 644 doc/saveconfig.json.5.gz %{buildroot}%{_mandir}/man5/
%postun -n target-restore
%systemd_postun_with_restart target.service
%if %{with python2}
%files -n python2-rtslib
%defattr(-,root,root)
%license COPYING
%{python2_sitelib}/*
%endif
%if %{with python3}
%files -n python3-rtslib
%defattr(-,root,root)
@ -152,14 +115,14 @@ install -m 644 doc/saveconfig.json.5.gz %{buildroot}%{_mandir}/man5/
%files help
%defattr(-,root,root)
%if %{with python2}
%doc doc/html
%endif
%doc README.md doc/getting_started.md
%{_mandir}/man8/targetctl.8.gz
%{_mandir}/man5/saveconfig.json.5.gz
%changelog
* Fri Oct 30 2020 tianwei <tianwei12@huawei.com> - 2.1.70-6
- remove python2
* Fri Jul 17 2020 Ruijun Ge <geruijun@huawei.com> - 2.1.70-5
- fix CVE-2020-14019