%global pkgname linecache2
# For bootstrapping Python
%bcond_with tests
Name: python-%{pkgname}
Version: 1.0.0
Release: 18%{?dist}
Summary: Backport of the linecache module
License: Python
URL: https://github.com/testing-cabal/linecache2
Source0: http://pypi.python.org/packages/source/l/%{pkgname}/%{pkgname}-%{version}.tar.gz
BuildArch: noarch
%global _description\
A backport of linecache to older supported Pythons.\
%description %_description
%package -n python2-%{pkgname}
Summary: %summary
BuildRequires: python2-devel
BuildRequires: python2-pbr
# Test dependencies
%if %{with tests}
BuildRequires: python2-fixtures
BuildRequires: python2-unittest2
%endif # with tests
%{?python_provide:%python_provide python2-%{pkgname}}
%description -n python2-%{pkgname} %_description
%package -n python%{python3_pkgversion}-%{pkgname}
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-pbr
# Test dependencies
%if %{with tests}
BuildRequires: python%{python3_pkgversion}-fixtures
BuildRequires: python%{python3_pkgversion}-unittest2
%endif # with tests
Summary: Backport of the linecache module
%description -n python%{python3_pkgversion}-%{pkgname} %_description
%if 0%{?python3_other_pkgversion}
%package -n python%{python3_other_pkgversion}-%{pkgname}
BuildRequires: python%{python3_other_pkgversion}-devel
BuildRequires: python%{python3_other_pkgversion}-pbr
# Test dependencies
%if %{with tests}
BuildRequires: python%{python3_other_pkgversion}-fixtures
BuildRequires: python%{python3_other_pkgversion}-unittest2
%endif # with tests
Summary: Backport of the linecache module
%description -n python%{python3_other_pkgversion}-%{pkgname} %_description
%endif # python3_other_pkgversion
%prep
%setup -q -n %{pkgname}-%{version}
%build
%py2_build
%py3_build
%if 0%{?python3_other_pkgversion}
%py3_other_build
%endif # python3_other_pkgversion
%install
%py2_install
# tests/inspect_fodder2.py not Py2 compatible
# besides tests shouldn't be installed
rm -r %{buildroot}%{python2_sitelib}/%{pkgname}/tests
%py3_install
rm -r %{buildroot}%{python3_sitelib}/%{pkgname}/tests
%if 0%{?python3_other_pkgversion}
%py3_other_install
rm -r %{buildroot}%{python3_other_sitelib}/%{pkgname}/tests
%endif # python3_other_pkgversion
%if %{with tests}
%check
%{__python2} -m unittest2 -v
%{__python3} -m unittest2 -v
%if 0%{?python3_other_pkgversion}
%{__python3_other} -m unittest2 -v
%endif # python3_other_pkgversion
%endif # with tests
%files -n python2-%{pkgname}
# license not shipped by upstream
%doc AUTHORS ChangeLog README.rst
%{python2_sitelib}/*
%files -n python%{python3_pkgversion}-%{pkgname}
%doc AUTHORS ChangeLog README.rst
%{python3_sitelib}/*
%if 0%{?python3_other_pkgversion}
%files -n python%{python3_other_pkgversion}-%{pkgname}
%doc AUTHORS ChangeLog README.rst
%{python3_other_sitelib}/*
%endif # python3_other_pkgversion
%changelog
* Sat Nov 3 2018 Orion Poplawski <orion@nwra.com> - 1.0.0-18
- Build for Python 3 for EPEL
- Bootstrap build
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Mon Jun 18 2018 Miro Hrončok <mhroncok@redhat.com> - 1.0.0-16
- Rebuilt for Python 3.7
* Wed Jun 13 2018 Miro Hrončok <mhroncok@redhat.com> - 1.0.0-15
- Bootstrap for Python 3.7
* Mon Feb 12 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.0.0-14
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Fri Sep 29 2017 Troy Dawson <tdawson@redhat.com> - 1.0.0-12
- Cleanup spec file conditionals
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.0.0-11
- Python 2 binary package renamed to python2-linecache2
See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Tue Dec 13 2016 Charalampos Stratakis <cstratak@redhat.com> - 1.0.0-8
- Enable tests
* Fri Dec 09 2016 Charalampos Stratakis <cstratak@redhat.com> - 1.0.0-7
- Rebuild for Python 3.6
- Disable python3 tests
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-6
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Sat Nov 14 2015 Toshio Kuratomi <toshio@fedoraproject.org> - - 1.0.0-4
- And re-enable the tests
* Sat Nov 14 2015 Toshio Kuratomi <toshio@fedoraproject.org> - - 1.0.0-3
- Temproarily disable tests to bootstrap testtools
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
* Wed Jul 22 2015 Michel Alexandre Salim <salimma@fedoraproject.org> - 1.0.0-1
- Initial package