%global package_description\ The linecache module allows one to get any line from any file, while \ attempting to optimize internally, using a cache, the common case where many \ lines are read from a single file. This package provides a backport of \ linecache to older supported Python versions. Name: python-linecache2 Version: 1.0.0 Release: 18 Summary: A backport of linecache to older supported Python versions License: Python URL: https://github.com/testing-cabal/linecache2 Source0: http://pypi.python.org/packages/source/l/linecache2/linecache2-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel python2-pbr python3-devel python3-pbr BuildRequires: python2-fixtures python2-unittest2 python3-fixtures python3-unittest2 %description %{package_description} %package -n python2-linecache2 Summary: A backport of linecache to older supported Python versions %{?python_provide:%python_provide python2-linecache2} %description -n python2-linecache2 %{package_description} %package -n python3-linecache2 Summary: A backport of linecache to older supported Python versions %description -n python3-linecache2 %{package_description} %prep %autosetup -c mv linecache2-%{version} python2 mv python2/linecache2/tests . cp -a python2 python3 %build cd python2 %{__python2} setup.py build cd - cd python3 %{__python3} setup.py build cd - %install cd python3 %{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT cd - cd python2 %{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT cd - %check cd python2 mv ../tests linecache2/ %{__python2} -m unittest2 -v mv linecache2/tests ../ cd - cd python3 mv ../tests linecache2/ %{__python3} -m unittest2 -v mv linecache2/tests ../ %files -n python2-linecache2 %doc python2/AUTHORS python2/ChangeLog python2/README.rst %{python2_sitelib}/* %files -n python3-linecache2 %doc python3/AUTHORS python3/ChangeLog python3/README.rst %{python3_sitelib}/* %changelog * Tue Nov 26 2019 lihao - 1.0.0-18 - Package Init