f36cd7
%if 0%{?fedora} > 12
f36cd7
%global with_python3 1
f36cd7
%global python3_version %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3])")
f36cd7
%endif
f36cd7
%if 0%{?rhel} && 0%{?rhel} < 6
f36cd7
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
f36cd7
%endif
f36cd7
f36cd7
# we have a circular (build) dependency with the (new) pytest package
f36cd7
# when generating the docs or running the testsuite
f36cd7
%global with_docs 1
f36cd7
%if 0%{?rhel} > 6
f36cd7
%global run_check 0
f36cd7
%else
f36cd7
%global run_check 1
f36cd7
%endif
f36cd7
f36cd7
%global pytest_version 2.3.1
f36cd7
f36cd7
Name:           python-py
f36cd7
Version:        1.4.14
75432c
Release:        4%{?dist}
f36cd7
Summary:        Library with cross-python path, ini-parsing, io, code, log facilities
f36cd7
Group:          Development/Languages
f36cd7
License:        MIT and Public Domain
f36cd7
#               main package: MIT, except: doc/style.css: Public Domain
f36cd7
URL:            http://pylib.readthedocs.org/
f36cd7
Source:         http://pypi.python.org/packages/source/p/py/py-%{version}.tar.gz
f36cd7
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
f36cd7
BuildArch:      noarch
f36cd7
BuildRequires:  python-devel
f36cd7
BuildRequires:  python-setuptools
f36cd7
Requires:       python-setuptools
f36cd7
%if 0%{?with_docs}
f36cd7
%if 0%{?rhel} > 6 || 0%{?fedora}
f36cd7
BuildRequires:  python-sphinx
f36cd7
%else
f36cd7
BuildRequires:  python-sphinx10
f36cd7
%endif # fedora
f36cd7
%endif # with_docs
f36cd7
%if 0%{?run_check}
f36cd7
BuildRequires:  pytest >= %{pytest_version}
f36cd7
%endif # run_check
f36cd7
%if 0%{?with_python3}
f36cd7
BuildRequires:  python3-devel
f36cd7
BuildRequires:  python3-setuptools
f36cd7
%if 0%{?run_check}
f36cd7
BuildRequires:  python3-pytest >= %{pytest_version}
f36cd7
%endif # run_check
f36cd7
%endif # with_python3
f36cd7
f36cd7
# needed by the testsuite
f36cd7
BuildRequires:  subversion
f36cd7
f36cd7
f36cd7
%description
f36cd7
The py lib is a Python development support library featuring the
f36cd7
following tools and modules:
f36cd7
f36cd7
  * py.path: uniform local and svn path objects
f36cd7
  * py.apipkg: explicit API control and lazy-importing
f36cd7
  * py.iniconfig: easy parsing of .ini files
f36cd7
  * py.code: dynamic code generation and introspection
f36cd7
  * py.path: uniform local and svn path objects
f36cd7
f36cd7
%if 0%{?with_python3}
f36cd7
%package -n python3-py
f36cd7
Summary:        Library with cross-python path, ini-parsing, io, code, log facilities
f36cd7
Requires:       python3-setuptools
f36cd7
f36cd7
%description -n python3-py
f36cd7
The py lib is a Python development support library featuring the
f36cd7
following tools and modules:
f36cd7
f36cd7
  * py.path: uniform local and svn path objects
f36cd7
  * py.apipkg: explicit API control and lazy-importing
f36cd7
  * py.iniconfig: easy parsing of .ini files
f36cd7
  * py.code: dynamic code generation and introspection
f36cd7
  * py.path: uniform local and svn path objects
f36cd7
f36cd7
%endif # with_python3
f36cd7
f36cd7
%prep
f36cd7
%setup -q -n py-%{version}
f36cd7
f36cd7
# remove shebangs and fix permissions
f36cd7
find -type f -a \( -name '*.py' -o -name 'py.*' \) \
f36cd7
   -exec sed -i '1{/^#!/d}' {} \; \
f36cd7
   -exec chmod u=rw,go=r {} \;
f36cd7
f36cd7
%if 0%{?with_python3}
f36cd7
cp -a . %{py3dir}
f36cd7
%endif # with_python3
f36cd7
f36cd7
f36cd7
%build
f36cd7
%{__python} setup.py build
f36cd7
f36cd7
%if 0%{?with_docs}
f36cd7
%if 0%{?rhel} > 6 || 0%{?fedora}
f36cd7
make -C doc html PYTHONPATH=$(pwd)
f36cd7
%else
f36cd7
make -C doc html SPHINXBUILD=sphinx-1.0-build PYTHONPATH=$(pwd)
f36cd7
%endif # fedora
f36cd7
%endif # with_docs
f36cd7
f36cd7
%if 0%{?with_python3}
f36cd7
pushd %{py3dir}
f36cd7
%{__python3} setup.py build
f36cd7
popd
f36cd7
%endif # with_python3
f36cd7
f36cd7
f36cd7
%install
f36cd7
rm -rf %{buildroot}
f36cd7
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
f36cd7
f36cd7
%if 0%{?with_python3}
f36cd7
pushd %{py3dir}
f36cd7
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
f36cd7
popd
f36cd7
%endif # with_python3
f36cd7
f36cd7
# remove hidden file
f36cd7
rm -rf doc/_build/html/.buildinfo
f36cd7
f36cd7
f36cd7
%check
f36cd7
%if 0%{?run_check}
f36cd7
PYTHONPATH=%{buildroot}%{python_sitelib} \
f36cd7
LC_ALL="en_US.UTF-8" \
f36cd7
py.test -r s
f36cd7
%if 0%{?with_python3}
f36cd7
pushd %{py3dir}
f36cd7
PYTHONPATH=%{buildroot}%{python3_sitelib} \
f36cd7
LC_ALL="en_US.UTF-8" \
f36cd7
py.test-%{python3_version} -r s
f36cd7
popd
f36cd7
%endif # with_python3
f36cd7
%endif # run_check
f36cd7
f36cd7
%clean
f36cd7
rm -rf %{buildroot}
f36cd7
f36cd7
f36cd7
%files
f36cd7
%defattr(-,root,root,-)
f36cd7
%doc CHANGELOG LICENSE README.txt
f36cd7
%if 0%{?with_docs}
f36cd7
%doc doc/_build/html
f36cd7
%endif # with_docs
f36cd7
%{python_sitelib}/*
f36cd7
f36cd7
f36cd7
%if 0%{?with_python3}
f36cd7
%files -n python3-py
f36cd7
%defattr(-,root,root,-)
f36cd7
%doc CHANGELOG LICENSE README.txt
f36cd7
%if 0%{?with_docs}
f36cd7
%doc doc/_build/html
f36cd7
%endif # with_docs
f36cd7
%{python3_sitelib}/*
f36cd7
%endif # with_python3
f36cd7
f36cd7
f36cd7
%changelog
75432c
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.4.14-4
75432c
- Mass rebuild 2013-12-27
75432c
f36cd7
* Tue Jun 18 2013 Endi S. Dewata <edewata@redhat.com> - 1.4.14-3
f36cd7
- Disabled pytest dependency for RHEL 7.
f36cd7
f36cd7
* Wed Jun 12 2013 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.14-2
f36cd7
- Use python-sphinx for rhel > 6 (rhbz#973321).
f36cd7
- Update URL.
f36cd7
- Fix changelog entry with an incorrect date (rhbz#973325).
f36cd7
f36cd7
* Sat May 11 2013 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.14-1
f36cd7
- Update to 1.4.14.
f36cd7
f36cd7
* Sat Mar  2 2013 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.13-1
f36cd7
- Update to 1.4.13.
f36cd7
f36cd7
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.12-2
f36cd7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
f36cd7
f36cd7
* Fri Nov 23 2012 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.12-1
f36cd7
- Update to 1.4.12.
f36cd7
f36cd7
* Sat Oct 27 2012 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.11-1
f36cd7
- Update to 1.4.11.
f36cd7
f36cd7
* Sun Oct 21 2012 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.10-2
f36cd7
- Re-enable doc building and testsuite.
f36cd7
- Minor testsuite fixes.
f36cd7
f36cd7
* Sun Oct 21 2012 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.10-1
f36cd7
- Update to 1.4.10.
f36cd7
f36cd7
* Fri Oct 12 2012 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.9-8
f36cd7
- Re-enable doc building and testsuite.
f36cd7
f36cd7
* Thu Oct 11 2012 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.9-7
f36cd7
- Add conditional for sphinx on rhel.
f36cd7
- Remove rhel logic from with_python3 conditional.
f36cd7
f36cd7
* Wed Oct 10 2012 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.9-6
f36cd7
- Re-enable doc building and testsuite.
f36cd7
f36cd7
* Sat Aug  4 2012 David Malcolm <dmalcolm@redhat.com> - 1.4.9-5
f36cd7
- Temporarily disable docs and testsuite.
f36cd7
f36cd7
* Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 1.4.9-4
f36cd7
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3
f36cd7
f36cd7
* Fri Jul 27 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.9-3
f36cd7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
f36cd7
f36cd7
* Fri Jun 15 2012 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.9-2
f36cd7
- Re-enable doc building and testsuite.
f36cd7
f36cd7
* Thu Jun 14 2012 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.9-1
f36cd7
- Update to 1.4.9.
f36cd7
f36cd7
* Sat Jun  9 2012 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.8-2
f36cd7
- Re-enable doc building and testsuite.
f36cd7
f36cd7
* Wed Jun  6 2012 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.8-1
f36cd7
- Update to 1.4.8.
f36cd7
f36cd7
* Wed Feb  8 2012 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.7-2
f36cd7
- Re-enable doc building and testsuite.
f36cd7
f36cd7
* Wed Feb  8 2012 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.7-1
f36cd7
- Update to 1.4.7.
f36cd7
f36cd7
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.6-3
f36cd7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
f36cd7
f36cd7
* Sat Dec 17 2011 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.6-2
f36cd7
- Re-enable doc building and testsuite.
f36cd7
f36cd7
* Sat Dec 17 2011 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.6-1
f36cd7
- Update to 1.4.6.
f36cd7
- Remove %%prerelease macro.
f36cd7
- Temporarily disable docs and testsuite.
f36cd7
f36cd7
* Wed Oct 26 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.5-4
f36cd7
- Rebuilt for glibc bug#747377
f36cd7
f36cd7
* Sat Sep  3 2011 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.5-3
f36cd7
- Fix: python3 dependencies.
f36cd7
f36cd7
* Tue Aug 30 2011 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.5-2
f36cd7
- Re-enable doc building and testsuite.
f36cd7
f36cd7
* Sat Aug 27 2011 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.5-1
f36cd7
- Update to 1.4.5.
f36cd7
f36cd7
* Thu Aug 11 2011 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.4-2
f36cd7
- Re-enable doc building and testsuite.
f36cd7
f36cd7
* Thu Aug 11 2011 Thomas Moschny <thomas.moschny@gmx.de> - 1.4.4-1
f36cd7
- Update to 1.4.4.
f36cd7
- Upstream provides a .zip archive only.
f36cd7
- pytest and pycmd are separate packages now. 
f36cd7
- Disable building html docs und the testsuite to break the circular
f36cd7
  build dependency with pytest.
f36cd7
- Update summary and description.
f36cd7
- Remove BRs no longer needed.
f36cd7
- Create a Python 3 subpackage.
f36cd7
f36cd7
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.4-2
f36cd7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
f36cd7
f36cd7
* Sat Sep 18 2010 Thomas Moschny <thomas.moschny@gmx.de> - 1.3.4-1
f36cd7
- Update to 1.3.4
f36cd7
f36cd7
* Fri Aug 27 2010 Thomas Moschny <thomas.moschny@gmx.de> - 1.3.3-2
f36cd7
- Add dependency on python-setuptools (see bz 626808).
f36cd7
f36cd7
* Sat Jul 31 2010 Thomas Moschny <thomas.moschny@gmx.de> - 1.3.3-1
f36cd7
- Update to 1.3.3.
f36cd7
f36cd7
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 1.3.2-2
f36cd7
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
f36cd7
f36cd7
* Sat Jul 10 2010 Thomas Moschny <thomas.moschny@gmx.de> - 1.3.2-1
f36cd7
- Update to 1.3.2.
f36cd7
- Do cleanups already in %%prep to avoid inconsistent mtimes between
f36cd7
  source files and bytecode.
f36cd7
f36cd7
* Sat May 29 2010 Thomas Moschny <thomas.moschny@gmx.de> - 1.3.1-1
f36cd7
- Update to 1.3.1.
f36cd7
f36cd7
* Sat May  8 2010 Thomas Moschny <thomas.moschny@gmx.de> - 1.3.0-1
f36cd7
- Update to 1.3.0.
f36cd7
- Remove some backup (.orig) files.
f36cd7
f36cd7
* Sun Feb 14 2010 Thomas Moschny <thomas.moschny@gmx.de> - 1.2.1-1
f36cd7
- Update to 1.2.1.
f36cd7
f36cd7
* Wed Jan 27 2010 Thomas Moschny <thomas.moschny@gmx.de> - 1.2.0-1
f36cd7
- Update to 1.2.0.
f36cd7
- Adjust summary and %%description.
f36cd7
- Use %%global instead of %%define.
f36cd7
f36cd7
* Sat Nov 28 2009 Thomas Moschny <thomas.moschny@gmx.de> - 1.1.1-1
f36cd7
- Update to 1.1.1.
f36cd7
f36cd7
* Sat Nov 21 2009 Thomas Moschny <thomas.moschny@gmx.de> - 1.1.0-1
f36cd7
- Update to 1.1.0. Upstream reorganized the package's structure and
f36cd7
  cleaned up the install process, so the specfile could be greatly
f36cd7
  simplified.
f36cd7
- Dropped licenses for files no longer present from the License tag.
f36cd7
f36cd7
* Thu Aug 27 2009 Thomas Moschny <thomas.moschny@gmx.de> - 1.0.2-1
f36cd7
- Update to 1.0.2.
f36cd7
- One failing test is no longer part of the testsuite, thus needs not
f36cd7
  to be skipped anymore.
f36cd7
- Some developer docs are missing this time in upstream's tarfile, so
f36cd7
  cannot be moved to %%{_docdir}
f36cd7
f36cd7
* Thu Aug 13 2009 Thomas Moschny <thomas.moschny@gmx.de> - 1.0.0-1
f36cd7
- Update to 1.0.0.
f36cd7
- Re-enable SVN tests in %%check.
f36cd7
f36cd7
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-1.b8
f36cd7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
f36cd7
f36cd7
* Wed Jul 22 2009 Thomas Moschny <thomas.moschny@gmx.de> - 1.0.0-0.b8
f36cd7
- Update to 1.0.0b8.
f36cd7
- Remove patches applied upstream.
f36cd7
- Greenlets have been removed upstream. So, package is noarch and
f36cd7
  - installs to %%{python_sitelib} again
f36cd7
  - %%ifarch sections have been removed.
f36cd7
- Don't remove files used by the testsuite for now.
f36cd7
- Add dependency on python-pygments, pylint and pexpect (for the
f36cd7
  testsuite).
f36cd7
f36cd7
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2-7
f36cd7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
f36cd7
f36cd7
* Wed Jan 14 2009 Thomas Moschny <thomas.moschny@gmx.de> - 0.9.2-6
f36cd7
- Use system doctest module again, as this wasn't the real cause of
f36cd7
  the test failure. Instead, remove the failing test for now.
f36cd7
f36cd7
* Fri Dec 12 2008 Thomas Moschny <thomas.moschny@gmx.de> - 0.9.2-5
f36cd7
- Add patch from trunk fixing a subversion 1.5 problem (pylib
f36cd7
  issue66).
f36cd7
- Don't replace doctest compat module (pylib issue67).
f36cd7
f36cd7
* Fri Nov 21 2008 Thomas Moschny <thomas.moschny@gmx.de> - 0.9.2-4
f36cd7
- Use dummy_greenlet on ppc and ppc64.
f36cd7
f36cd7
* Tue Oct  7 2008 Thomas Moschny <thomas.moschny@gmx.de> - 0.9.2-3
f36cd7
- Replace compat modules by stubs using the system modules instead.
f36cd7
- Add patch from trunk fixing a timing issue in the tests.
f36cd7
f36cd7
* Tue Sep 30 2008 Thomas Moschny <thomas.moschny@gmx.de> - 0.9.2-2
f36cd7
- Update license information.
f36cd7
- Fix the tests.
f36cd7
f36cd7
* Sun Sep  7 2008 Thomas Moschny <thomas.moschny@gmx.de> - 0.9.2-1
f36cd7
- Update to 0.9.2.
f36cd7
- Upstream now uses setuptools and installs to %%{python_sitearch}.
f36cd7
- Remove %%{srcname} macro.
f36cd7
- More detailed information about licenses.
f36cd7
f36cd7
* Thu Aug 21 2008 Thomas Moschny <thomas.moschny@gmx.de> - 0.9.1-1
f36cd7
- New package.