!15 remove "%bcond_with python3" from spec file to resolve local rpmbuild failure issue

From: @hifi521
Reviewed-by: @wenchao-hao,@yangzhao_kl
Signed-off-by: @yangzhao_kl
This commit is contained in:
openeuler-ci-bot 2021-09-06 11:29:57 +00:00 committed by Gitee
commit 975c24dd5d

View File

@ -1,10 +1,8 @@
%bcond_with python3
%global oname rtslib-fb
Name: python-rtslib
Version: 2.1.70
Release: 7
Release: 8
Summary: Python object API for Linux kernel LIO SCSI target
License: ASL 2.0
@ -28,7 +26,6 @@ Obsoletes: python-rtslib-doc
which includes the 'target' service and targetctl tool for restoring
configuration.
%if %{with python3}
%package -n python3-rtslib
Summary: Python3 object API for Linux kernel LIO SCSI target
BuildRequires: python3-devel, python3-setuptools
@ -39,13 +36,10 @@ Requires: python3-kmod, python3-six, python3-pyudev
python3-rtslib is a python object API for generic Linux SCSI kernel
target which includes the 'target' service and targetctl tool for
restoring configuration.
%endif
%package -n target-restore
Summary: Systemd service for targetcli/rtslib
%if %{with python3}
Requires: python3-rtslib = %{version}-%{release}
%endif
%description -n target-restore
Systemd service to restore the LIO kernel target settings on system
@ -56,27 +50,21 @@ restart.
%prep
%autosetup -n %{oname}-%{version} -p1
%if %{with python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build
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
popd
%endif
%install
%if %{with python3}
pushd %{py3dir}
%py3_install
popd
%endif
mkdir -p %{buildroot}%{_mandir}/man8/
mkdir -p %{buildroot}%{_mandir}/man5/
@ -97,12 +85,10 @@ install -m 644 doc/saveconfig.json.5.gz %{buildroot}%{_mandir}/man5/
%postun -n target-restore
%systemd_postun_with_restart target.service
%if %{with python3}
%files -n python3-rtslib
%defattr(-,root,root)
%license COPYING
%{python3_sitelib}/*
%endif
%files -n target-restore
%defattr(-,root,root)
@ -121,6 +107,9 @@ install -m 644 doc/saveconfig.json.5.gz %{buildroot}%{_mandir}/man5/
%{_mandir}/man5/saveconfig.json.5.gz
%changelog
* Mon Sep 6 2021 zhanchengbin <zhanchengbin1@huawei.com> - 2.1.70-8
- remove "%bcond_with python3" from spec file to resolve local rpmbuild failure issue
* Mon Nov 2 2020 Zhiqiang Liu <lzhq28@mail.ustc.edu.cn> - 2.1.70-7
- backport upstream patch to solve one problem