!10 python-rtslib 删除python2-rtslib

From: @lixiaokeng
Reviewed-by: @liuzhiqiang26,@wubo009
Signed-off-by: @wubo009
This commit is contained in:
openeuler-ci-bot 2021-01-18 15:11:28 +08:00 committed by Gitee
commit 5d46c9e39d

View File

@ -1,64 +1,39 @@
%bcond_without python2
%bcond_with python3
%global oname rtslib-fb %global oname rtslib-fb
Name: python-rtslib Name: python-rtslib
Version: 2.1.70 Version: 2.1.70
Release: 3 Release: 4
Summary: Python object API for Linux kernel LIO SCSI target Summary: Python object API for Linux kernel LIO SCSI target
License: ASL 2.0 License: ASL 2.0
URL: https://github.com/open-iscsi/%{oname} URL: https://github.com/open-iscsi/%{oname}
Source0: %{url}/archive/v%{version}/%{oname}-%{version}.tar.gz Source0: %{url}/archive/v%{version}/%{oname}-%{version}.tar.gz
BuildArch: noarch BuildArch: noarch
BuildRequires: epydoc, systemd-units BuildRequires: systemd
Requires(post): systemd Requires(post): systemd
Requires(preun): systemd Requires(preun): systemd
Requires(postun): systemd Requires(postun): systemd
Provides: python-rtslib-doc
Obsoletes: python-rtslib-doc
%description %description
%{name} is a python object API for generic Linux SCSI kernel target python-rtslib is a python object API for generic Linux SCSI kernel target
which includes the 'target' service and targetctl tool for restoring which includes the 'target' service and targetctl tool for restoring
configuration. 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 %package -n python3-rtslib
Summary: Python3 object API for Linux kernel LIO SCSI target Summary: Python3 object API for Linux kernel LIO SCSI target
BuildRequires: python3-devel, python3-setuptools BuildRequires: python3-devel, python3-setuptools
Requires: python3-kmod, python3-six, python3-pyudev Requires: python3-kmod, python3-six, python3-pyudev
%{?python_provide:%python_provide python3-rtslib} %{?python_provide:%python_provide python3-rtslib}
%description -n python3-rtslib %description -n python3-rtslib
python3-rtslib is a python object API for generic Linux SCSI kernel python3-rtslib is a python object API for generic Linux SCSI kernel
target which includes the 'target' service and targetctl tool for target which includes the 'target' service and targetctl tool for
restoring configuration. restoring configuration.
%endif
%package -n target-restore %package -n target-restore
Summary: Systemd service for targetcli/rtslib Summary: Systemd service for targetcli/rtslib
%if %{with python3}
Requires: python3-rtslib = %{version}-%{release} Requires: python3-rtslib = %{version}-%{release}
%else
Requires: python2-rtslib = %{version}-%{release}
%endif
%description -n target-restore %description -n target-restore
Systemd service to restore the LIO kernel target settings on system Systemd service to restore the LIO kernel target settings on system
@ -69,41 +44,11 @@ restart.
%prep %prep
%autosetup -n %{oname}-%{version} -p1 %autosetup -n %{oname}-%{version} -p1
%if %{with python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build %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
%if 0%{?with_python3}
pushd %{py3dir}
%py3_build %py3_build
popd
%endif
%install %install
%if %{with python3}
pushd %{py3dir}
%py3_install %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/ mkdir -p %{buildroot}%{_mandir}/man8/
mkdir -p %{buildroot}%{_mandir}/man5/ mkdir -p %{buildroot}%{_mandir}/man5/
@ -112,8 +57,8 @@ mkdir -p %{buildroot}%{_sysconfdir}/target/backup
mkdir -p %{buildroot}%{_localstatedir}/target/pr mkdir -p %{buildroot}%{_localstatedir}/target/pr
mkdir -p %{buildroot}%{_localstatedir}/target/alua mkdir -p %{buildroot}%{_localstatedir}/target/alua
install -m 644 systemd/target.service %{buildroot}%{_unitdir}/target.service install -m 644 systemd/target.service %{buildroot}%{_unitdir}/target.service
install -m 644 doc/targetctl.8.gz %{buildroot}%{_mandir}/man8/ install -m 644 doc/targetctl.8 %{buildroot}%{_mandir}/man8/
install -m 644 doc/saveconfig.json.5.gz %{buildroot}%{_mandir}/man5/ install -m 644 doc/saveconfig.json.5 %{buildroot}%{_mandir}/man5/
%post -n target-restore %post -n target-restore
%systemd_post target.service %systemd_post target.service
@ -124,19 +69,10 @@ install -m 644 doc/saveconfig.json.5.gz %{buildroot}%{_mandir}/man5/
%postun -n target-restore %postun -n target-restore
%systemd_postun_with_restart target.service %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 %files -n python3-rtslib
%defattr(-,root,root) %defattr(-,root,root)
%license COPYING %license COPYING
%{python3_sitelib}/* %{python3_sitelib}/*
%endif
%files -n target-restore %files -n target-restore
%defattr(-,root,root) %defattr(-,root,root)
@ -150,14 +86,14 @@ install -m 644 doc/saveconfig.json.5.gz %{buildroot}%{_mandir}/man5/
%files help %files help
%defattr(-,root,root) %defattr(-,root,root)
%if %{with python2}
%doc doc/html
%endif
%doc README.md doc/getting_started.md %doc README.md doc/getting_started.md
%{_mandir}/man8/targetctl.8.gz %{_mandir}/man8/targetctl.8*
%{_mandir}/man5/saveconfig.json.5.gz %{_mandir}/man5/saveconfig.json.5*
%changelog %changelog
* Thu Jan 07 2021 Lixiaokeng <lixiaokeng@huawei.com> - 2.1.70-4
- python2-kmod is removed and required by python2-rtslib. Remove python2-rtslib.
* Thu Jan 09 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.1.70-3 * Thu Jan 09 2020 openEuler Buildteam <buildteam@openeuler.org> - 2.1.70-3
- re-package for rtslib-fb - re-package for rtslib-fb