%define name python3-linecache2 %define srcname linecache2 %define version 1.0.0 %define release 1 %define is_python %(test -e /opt/freeware/bin/python3_32 && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(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_64 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif Summary: Backport of the linecache module Name: %{name} Version: %{version} Release: %{release} Source0: %{srcname}-%{version}.tar.gz License: Python Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} BuildArch: noarch Url: https://pypi.org/ #for running test cases install fixtures using "python3 -m pip install" command %description A backport of linecache to older supported Pythons. %prep %setup -q -n %{srcname}-%{version} %build python3 setup.py build %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT python3 setup.py install --skip-build --root ${RPM_BUILD_ROOT} %check #mv tests %{srcname}/ python3 -m unittest2 -v #mv %{srcname}/tests %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc AUTHORS ChangeLog README.rst %{python_sitelib}/linecache2 %{python_sitelib}/linecache2-%{version}-py?.?.egg-info %changelog *Mon Nov 25 2019 Baanu Tumma - 1.0.0-1 - First version for AIX, built using python3