1 # NOTE: linecache already in standard libraries since 2.?/3.?;
2 # linecache 1.0.0 is equivalent of version from cpython 3.5.0 .. 3.7.0 (no changes in this range)
3 # so the only point of providing linecache2 1.0.0 for python>=3.5.0 are external dependencies
6 %bcond_without python2 # CPython 2.x module
7 %bcond_without python3 # CPython 3.x module
8 %bcond_without tests # test target
10 Summary: Backport of linecache to older supported Pythons
11 Summary(pl.UTF-8): Backport modułu linecache do starszych wersji Pythona
12 Name: python-linecache2
16 Group: Development/Languages/Python
17 #Source0Download: https://pypi.org/pypi/linecache2/
18 Source0: https://files.pythonhosted.org/packages/source/l/linecache2/linecache2-%{version}.tar.gz
19 # Source0-md5: 7b25d0289ec36bff1f9e63c4329ce65c
20 URL: https://github.com/testing-cabal/linecache2
22 BuildRequires: python-devel >= 1:2.6
24 BuildRequires: python-fixtures
25 BuildRequires: python-unittest2
29 BuildRequires: python3-devel >= 1:3.2
31 BuildRequires: python3-fixtures
32 BuildRequires: python3-unittest2
35 BuildRequires: rpmbuild(macros) >= 1.710
36 Requires: python-modules
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 Backport of linecache to older supported Pythons.
43 linecache module provides random access to text lines.
45 %description -l pl.UTF-8
46 Backport modułu linecache do starszych wersji Pythona.
48 Moduł linecache pozwala na swobodny dostęp do linii tekstu.
50 %package -n python3-linecache2
51 Summary: Backport of linecache to older supported Pythons
52 Summary(pl.UTF-8): Backport modułu linecache do starszych wersji Pythona
53 Group: Development/Languages/Python
54 Requires: python3-modules
56 %description -n python3-linecache2
57 Backport of linecache to older supported Pythons.
59 linecache module provides random access to text lines.
61 %description -n python3-linecache2 -l pl.UTF-8
62 Backport modułu linecache do starszych wersji Pythona.
64 Moduł linecache pozwala na swobodny dostęp do linii tekstu.
67 %setup -q -n linecache2-%{version}
71 %py_build %{?with_tests:test}
75 %py3_build %{?with_tests:test}
79 rm -rf $RPM_BUILD_ROOT
85 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/linecache2/tests
91 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/linecache2/tests
95 rm -rf $RPM_BUILD_ROOT
99 %defattr(644,root,root,755)
100 %doc AUTHORS ChangeLog README.rst
101 %dir %{py_sitescriptdir}/linecache2
102 %{py_sitescriptdir}/linecache2/*.py[co]
103 %{py_sitescriptdir}/linecache2-%{version}-py*.egg-info
107 %files -n python3-linecache2
108 %defattr(644,root,root,755)
109 %doc AUTHORS ChangeLog README.rst
110 %dir %{py3_sitescriptdir}/linecache2
111 %{py3_sitescriptdir}/linecache2/*.py
112 %{py3_sitescriptdir}/linecache2/__pycache__
113 %{py3_sitescriptdir}/linecache2-%{version}-py*.egg-info