remove python2 subpackage

This commit is contained in:
lei_ju 2020-10-29 10:35:14 +08:00
parent d426c6ee8a
commit 0333c45cc9

View File

@ -1,6 +1,6 @@
Name: python-gflags Name: python-gflags
Version: 2.0 Version: 2.0
Release: 16 Release: 17
Summary: Python commandline flags module Summary: Python commandline flags module
License: BSD License: BSD
URL: https://github.com/google/python-gflags URL: https://github.com/google/python-gflags
@ -13,17 +13,6 @@ processing. It is intended to be used in situations where a project wants to
mimic the command-line flag handling of a C++ app that uses google-gflags for mimic the command-line flag handling of a C++ app that uses google-gflags for
a Python app. a Python app.
%package -n python2-gflags
Summary: Python2 commandline flags module
BuildRequires: python2-devel python2-setuptools
%{?python_provide:%python_provide python2-gflags}
%description -n python2-gflags
The python-gflags package contains a library that implements commandline flags
processing. It is intended to be used in situations where a project wants to
mimic the command-line flag handling of a C++ app that uses google-gflags for
a Python app.
%package -n python3-gflags %package -n python3-gflags
Summary: Python3 commandline flags module Summary: Python3 commandline flags module
BuildRequires: python3-devel python3-setuptools python3-tools BuildRequires: python3-devel python3-setuptools python3-tools
@ -37,46 +26,26 @@ a Python app.
%prep %prep
%setup -q -c %setup -q -c
mv python-gflags-python-gflags-2.0 python2 mv python-gflags-python-gflags-2.0 python3
sed -i '1s|^#!/usr/bin/env python$|#!%{__python2}|' python2/gflags2man.py
sed -i '/^#!\/usr\/bin\/env python$/,+1 d' python2/gflags*.py
cp -a python2 python3
sed -i '1s|^#!%{__python2}$|#!%{__python3}|' python3/gflags2man.py sed -i '1s|^#!%{__python2}$|#!%{__python3}|' python3/gflags2man.py
2to3 --write --nobackup python3 2to3 --write --nobackup python3
%build %build
cd python2 cd python3
python2 setup.py build
cd ../python3
python3 setup.py build python3 setup.py build
cd ..
%install %install
cd python3 cd python3
python3 setup.py install --skip-build --root %{buildroot} python3 setup.py install --skip-build --root %{buildroot}
mv %{buildroot}%{_bindir}/gflags2man.py %{buildroot}%{_bindir}/gflags2man-3 mv %{buildroot}%{_bindir}/gflags2man.py %{buildroot}%{_bindir}/gflags2man-3
chmod +x %{buildroot}%{_bindir}/gflags2man-3 chmod +x %{buildroot}%{_bindir}/gflags2man-3
cd ..
cd ../python2
python2 setup.py install --skip-build --root %{buildroot}
mv %{buildroot}%{_bindir}/gflags2man.py %{buildroot}%{_bindir}/gflags2man
chmod +x %{buildroot}%{_bindir}/gflags2man
%check %check
cd python2 cd python3
python2 setup.py test
cd ../python3
python3 setup.py test python3 setup.py test
cd ..
%files -n python2-gflags
%license python2/COPYING
%doc python2/AUTHORS python2/ChangeLog python2/COPYING python2/README
%{_bindir}/gflags2man
%{python2_sitelib}/gflags*.py*
%{python2_sitelib}/python_gflags-%{version}-*egg-info
%files -n python3-gflags %files -n python3-gflags
%license python3/COPYING %license python3/COPYING
@ -88,5 +57,8 @@ python3 setup.py test
%changelog %changelog
* Wed Oct 21 2020 leiju <leiju4@huawei.com> - 2.0-17
- remove python2 subpackage
* Thu Jan 8 2020 yanzhihua <yanzhihua4@huawei.com> - 2.0-16 * Thu Jan 8 2020 yanzhihua <yanzhihua4@huawei.com> - 2.0-16
- Package init - Package init