remove python2 subpackage

This commit is contained in:
lei_ju 2020-10-29 10:36:04 +08:00
parent 7eb23efcb9
commit 9b9d6d72a4

View File

@ -1,30 +1,18 @@
Name: python-google-apputils Name: python-google-apputils
Version: 0.4.2 Version: 0.4.2
Release: 15 Release: 16
Summary: Google Application Utilities for Python Summary: Google Application Utilities for Python
License: ASL 2.0 License: ASL 2.0
URL: https://github.com/google/google-apputils URL: https://github.com/google/google-apputils
Source0: https://pypi.python.org/packages/source/g/google-apputils/google-apputils-%{version}.tar.gz Source0: https://pypi.python.org/packages/source/g/google-apputils/google-apputils-%{version}.tar.gz
BuildArch: noarch BuildArch: noarch
BuildRequires: python2-devel python2-setuptools python2-dateutil python2-gflags BuildRequires: python3-devel python3-setuptools python3-dateutil python3-gflags python3-pytz
BuildRequires: python2-pytz python3-devel python2-mox python3-setuptools
BuildRequires: python2-tools python3-dateutil python3-gflags python3-pytz
%description %description
This project is a small collection of utilities for Python applications. This project is a small collection of utilities for Python applications.
It includes some of the same set of utilities used to build and It includes some of the same set of utilities used to build and
run internal Python apps at Google. run internal Python apps at Google.
%package -n python2-google-apputils
Summary: Google Application Utilities for Python2
Requires: python2-dateutil python2-gflags python2-pytz
%{?python_provide:%python_provide python2-google-apputils}
%description -n python2-google-apputils
This project is a small collection of utilities for Python2 applications.
It includes some of the same set of utilities used to build and
run internal Python apps at Google.
%package -n python3-google-apputils %package -n python3-google-apputils
Summary: Google Application Utilities for Python3 Summary: Google Application Utilities for Python3
Requires: python3-dateutil python3-gflags python3-pytz Requires: python3-dateutil python3-gflags python3-pytz
@ -34,51 +22,31 @@ This project is a small collection of utilities for Python3 applications.
It includes some of the same set of utilities used to build and It includes some of the same set of utilities used to build and
run internal Python apps at Google. run internal Python apps at Google.
%prep %prep
%autosetup -c %autosetup -c
mv google-apputils-%{version} python2 mv google-apputils-%{version} python3
find -name \*.py | xargs sed -i '/^#!\/usr\/bin\/.*python/d'
sed -i 's/pytz>.*"/pytz"/' python2/setup.py
cp -a python2 python3
2to3 --write --nobackups python3 2to3 --write --nobackups python3
%build %build
cd python2
%py2_build
cd -
cd python3 cd python3
%py3_build %py3_build
cd - cd ..
%install %install
cd python3 cd python3
%{__python3} setup.py install --skip-build --root %{buildroot} %{__python3} setup.py install --skip-build --root %{buildroot}
cd - cd ..
cd python2
%{__python2} setup.py install --skip-build --root %{buildroot}
cd -
%check %check
cd python2
%{__python2} setup.py test
cd -
%files -n python2-google-apputils
%license python2/LICENSE
%doc python2/README
%{python2_sitelib}/*
%files -n python3-google-apputils %files -n python3-google-apputils
%license python3/LICENSE %license python3/LICENSE
%doc python3/README %doc python3/README
%{python3_sitelib}/* %{python3_sitelib}/*
%changelog %changelog
* Wed Oct 21 2020 leiju4 <leiju4@huawei.com> 0.4.2-16
- remove python2 subpackage
* Wed Jan 8 2020 zhujunhao <zhujunhao5@huawei.com> 0.4.2-15 * Wed Jan 8 2020 zhujunhao <zhujunhao5@huawei.com> 0.4.2-15
- Package init - Package init