# Tests by default. No tests: rpm -ba --define 'dotests 0' *.spec %{!?dotests: %define dotests 1} %define name python3-py %define srcname py %define version 1.8.0 %define release 1 %define is_python %(test -e /opt/freeware/bin/python3_32 && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(/opt/freeware/bin/python3_32 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif %define _libdir64 %{_prefix}/lib64 %define is_python_64 %(test -e /opt/freeware/bin/python3 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(/opt/freeware/bin/python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif %global pytest_version_lb 2.9.0 %global pytest_version_ub 2.10 %global srcname py Name: %{name} Version: %{version} Release: %{release} Summary: Library with cross-python path, ini-parsing, io, code, log facilities License: MIT and Public Domain # main package: MIT, except: doc/style.css: Public Domain Group: Development/Libraries URL: http://pylib.readthedocs.io/en/stable/ Source0: https://files.pythonhosted.org/packages/source/p/%{srcname}/%{srcname}-%{version}.tar.gz Source10: %{name}-%{version}-%{release}.build.log BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} BuildArch: noarch BuildRequires: python3-devel >= 3.7.4 BuildRequires: python3-sphinx >= 2.3.0 BuildRequires: python3-pytest >= 5.3.1 # needed by the testsuite BuildRequires: subversion %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 * py.path: uniform local and svn path objects Provides: python3-py Provides: bundled(python3-apipkg) = 1.3.dev %prep %setup -q -n %{srcname}-%{version} echo "dotests=%{dotests}" # remove shebangs and fix permissions find . -type f -a \( -name '*.py' -o -name 'py.*' \) \ -exec sed -i '1{/^#!/d}' {} \; \ -exec chmod u=rw,go=r {} \; %build python3 setup.py build make -C doc html PYTHONPATH=$(pwd) SPHINXBUILD="sphinx-build-3" %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT python3 setup.py install --skip-build --root ${RPM_BUILD_ROOT} # remove hidden file rm -rf doc/_build/html/.buildinfo # %check if [ "%{dotests}" == 1 ] then (PYTHONPATH=%{buildroot}%{python_sitelib} \ LC_ALL="en_US.UTF-8" \ py.test-3.7 -r s -k"-TestWCSvnCommandPath" testing || true) fi #%clean #[ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files -n python3-py %defattr(-,root,system,-) %doc CHANGELOG %doc README.rst #%license python2/LICENSE %doc doc/_build/html %{python_sitelib}/* %changelog * Mon Dec 30 2019 Ashwini Chandrappa - 1.8.0-1 -Build with python3 * Wed Sep 20 2017 Ravi Hirekurabar - 1.4.26-1 - Initial Port