回退 'Pull Request !5 : Update python-py to 1.9.0 version'

This commit is contained in:
small_leek 2020-12-31 15:11:05 +08:00 committed by Gitee
parent 1958fdfbb8
commit 1c3e5142d6
3 changed files with 72 additions and 53 deletions

BIN
py-1.5.4.tar.gz Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,12 +1,23 @@
%global _empty_manifest_terminate_build 0
Name: python-py
Version: 1.9.0
Release: 1
Summary: library with cross-python path, ini-parsing, io, code, log facilities
License: MIT license
URL: https://py.readthedocs.io/
Source0: https://files.pythonhosted.org/packages/97/a6/ab9183fe08f69a53d06ac0ee8432bc0ffbb3989c575cc69b73a0229a9a99/py-1.9.0.tar.gz
BuildArch: noarch
%bcond_with tests
%global with_help 1
%global modname py
%global modnameversion %{modname}-%{version}
%global p2builddir python2tmp
%global p3builddir python3tmp
Name: python-%{modname}
Version: 1.5.4
Release: 5
Summary: Library with cross-python path, ini-parsing, io, code, log facilities
License: MIT and Public Domain
URL: http://pylib.readthedocs.io/en/stable/
Source: https://files.pythonhosted.org/packages/source/p/%{modname}/%{modnameversion}.tar.gz
BuildArch: noarch
%if %{with tests}
BuildRequires: subversion
%endif
%global _description \
The py lib is a Python development support library featuring the\
@ -20,65 +31,73 @@ following tools and modules:\
%description
%{_description}
%package -n python3-py
Summary: library with cross-python path, ini-parsing, io, code, log facilities
Provides: python-py
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-setuptools_scm
%description -n python3-py
%package -n python3-%{modname}
Summary: %{summary}
BuildRequires: python3-devel python3-setuptools python3-setuptools_scm
%if 0%{?with_help}
BuildRequires: %{_bindir}/sphinx-build-3
%endif
%if %{with tests}
BuildRequires: python3-pytest >= 2.9.0, python3-pytest < 2.10
%endif
Requires: python3-setuptools
%{?python_provide:%python_provide python3-%{modname}}
Provides: bundled(python3-apipkg) = 1.4 bundled(python3-iniconfig) = 1.0.0
Obsoletes: platform-python-%{modname} < %{version}-%{release}
%description -n python3-%{modname}
%{_description}
%package help
Summary: Development documents and examples for py
Provides: python3-py-doc
%description help
%{_description}
%if 0%{?with_help}
%package_help
%endif
%prep
%autosetup -n py-1.9.0
%autosetup -c -n %{modnameversion}
find %{modnameversion} \
-type f -a \( -name '*.py' -o -name 'py.*' \) \
-exec sed -i '1{/^#!/d}' {} \; \
-exec chmod u=rw,go=r {} \;
mv %{modnameversion} %{p3builddir}
%build
pushd %{p3builddir}
%py3_build
%if 0%{?with_help}
make -C doc html PYTHONPATH=$(pwd) SPHINXBUILD=sphinx-build-3
%endif
popd
%install
pushd %{p3builddir}
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
rm -rf doc/_build/html/.buildinfo
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-py -f filelist.lst
%dir %{python3_sitelib}/*
%check
%if %{with tests}
pushd %{p3builddir}
PYTHONPATH=%{buildroot}%{python3_sitelib} LC_ALL="en_US.UTF-8" \
py.test-%{python3_version} -r s -k"-TestWCSvnCommandPath" testing
popd
%endif
%files help -f doclist.lst
%{_pkgdocdir}
%files -n python3-%{modname}
%license %{p3builddir}/LICENSE
%{python3_sitelib}/py-*.egg-info/
%{python3_sitelib}/py/
%if 0%{?with_help}
%files help
%doc %{p3builddir}/CHANGELOG
%doc %{p3builddir}/README.rst
%doc %{p3builddir}/doc/_build/html
%endif
%changelog
* Wed Dec 09 2020 baizhonggui <baizhonggui@huawei.com> - 1.9.0-1
- Update to 1.9.0
* Mon Aug 10 202 zhangjiapeng <zhangjiapeng9@huawei.com> - 1.5.4-5
- Remove python2