Although the old tuna.spec file is only being used to retrieve the
VERSION from the makefile, it is causing errors by not explicitly
defining the version of python it uses.
For example, if you type, 'make tags', you get
error: attempt to use unversioned python, define %__python to /usr/bin/python2 or
/usr/bin/python3 explicitly
error: query of specfile rpm/SPECS/tuna.spec failed, can't parse
Fix this by explicitly defining the version of python in the spec file.
Signed-off-by: John Kacur <jkacur(a)redhat.com>
---
rpm/SPECS/tuna.spec | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/rpm/SPECS/tuna.spec b/rpm/SPECS/tuna.spec
index 2ab5511081d5..eca96c833265 100644
--- a/rpm/SPECS/tuna.spec
+++ b/rpm/SPECS/tuna.spec
@@ -1,6 +1,3 @@
-%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from
distutils.sysconfig import get_python_lib; print get_python_lib()")}
-%{!?python_ver: %define python_ver %(%{__python} -c "import sys ;
print(sys.version[:3])")}
-
Name: tuna
Version: 0.15
Release: 1%{?dist}
@@ -46,11 +43,11 @@ priority is changed, be it using tuna or plain chrt & taskset.
%setup -q
%build
-%{__python} setup.py build
+%{python3} setup.py build
%install
rm -rf %{buildroot}
-%{__python} setup.py install --skip-build --root %{buildroot}
+%{python3} setup.py install --skip-build --root %{buildroot}
mkdir -p %{buildroot}/%{_sysconfdir}/tuna/
mkdir -p %{buildroot}/{%{_bindir},%{_datadir}/tuna/help/kthreads,%{_mandir}/man8}
mkdir -p %{buildroot}/%{_datadir}/polkit-1/actions/
@@ -80,11 +77,11 @@ rm -rf %{buildroot}
%defattr(-,root,root,-)
%doc ChangeLog
%if "%{python_ver}" >= "2.5"
-%{python_sitelib}/*.egg-info
+%{python2_sitelib}/*.egg-info
%endif
%{_bindir}/tuna
%{_datadir}/tuna/
-%{python_sitelib}/tuna/
+%{python3_sitelib}/tuna/
%{_mandir}/man8/tuna.8*
%{_sysconfdir}/tuna.conf
%{_sysconfdir}/tuna/*
--
2.31.1
Show replies by date