2019-12-17 09:58:46 +08:00
|
|
|
%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
|
2020-08-11 10:14:36 +08:00
|
|
|
Release: 5
|
2019-12-17 09:58:46 +08:00
|
|
|
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\
|
|
|
|
|
following tools and modules:\
|
|
|
|
|
\
|
|
|
|
|
* py.path: uniform local and svn path objects\
|
|
|
|
|
* py.apipkg: explicit API control and lazy-importing\
|
|
|
|
|
* py.iniconfig: easy parsing of .ini files\
|
|
|
|
|
* py.code: dynamic code generation and introspection
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
%{_description}
|
|
|
|
|
|
|
|
|
|
%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}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%if 0%{?with_help}
|
|
|
|
|
%package_help
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%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 {} \;
|
|
|
|
|
|
2020-08-11 10:14:36 +08:00
|
|
|
mv %{modnameversion} %{p3builddir}
|
2019-12-17 09:58:46 +08:00
|
|
|
|
|
|
|
|
%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
|
|
|
|
|
rm -rf doc/_build/html/.buildinfo
|
|
|
|
|
popd
|
|
|
|
|
|
|
|
|
|
%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 -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
|
2020-08-11 10:14:36 +08:00
|
|
|
* Mon Aug 10 202 zhangjiapeng <zhangjiapeng9@huawei.com> - 1.5.4-5
|
|
|
|
|
- Remove python2
|
|
|
|
|
|
2019-12-17 09:58:46 +08:00
|
|
|
* Tue Dec 10 2019 mengxian <mengxian@huawei.com> - 1.5.4-4
|
|
|
|
|
- Package init
|