From 565b5a038b877dcc25d179f9f18a25817b782438 Mon Sep 17 00:00:00 2001 From: Ondřej Lysoněk Date: Jul 10 2018 15:08:26 +0000 Subject: Use python intepreter path from the rpm macro --- diff --git a/tuned-2.10.0-makefile-full-python-path.patch b/tuned-2.10.0-makefile-full-python-path.patch new file mode 100644 index 0000000..39b3f4b --- /dev/null +++ b/tuned-2.10.0-makefile-full-python-path.patch @@ -0,0 +1,18 @@ +--- a/Makefile ++++ b/Makefile +@@ -30,12 +30,12 @@ VERSIONED_NAME = $(NAME)-$(VERSION)$(GIT_PSUFFIX) + SYSCONFDIR = /etc + DATADIR = /usr/share + DOCDIR = $(DATADIR)/doc/$(NAME) +-PYTHON = python3 ++PYTHON = /usr/bin/python3 + PYLINT = pylint-3 + ifeq ($(PYTHON),python2) + PYLINT = pylint-2 + endif +-SHEBANG_REWRITE_REGEX= '1s/^(\#!\/usr\/bin\/)\/\1$(PYTHON)/' ++SHEBANG_REWRITE_REGEX= '1s|^\#!/usr/bin/\|\#!$(PYTHON)|' + PYTHON_SITELIB = $(shell $(PYTHON) -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib());') + ifeq ($(PYTHON_SITELIB),) + $(error Failed to determine python library directory) + diff --git a/tuned.spec b/tuned.spec index 7ef02a0..4beb38b 100644 --- a/tuned.spec +++ b/tuned.spec @@ -32,9 +32,9 @@ Summary: A dynamic adaptive system tuning daemon Name: tuned Version: 2.10.0 -Release: 2%{?prerel1}%{?dist} +Release: 3%{?prerel1}%{?dist} License: GPLv2+ -Source0: https://github.com/redhat-performance/%{name}/archive/v%{version}%{?prerel2}.tar.gz#/%{name}-%{version}%{?prerel1}.tar.gz +Source0: https://github.com/redhat-performance/%{name}/archive/v%{version}%{?prerel2}.tar.gz#/%{name}-%{version}%{?prerel2}.tar.gz URL: http://www.tuned-project.org/ BuildArch: noarch BuildRequires: systemd, desktop-file-utils @@ -59,6 +59,8 @@ Recommends: kernel-tools Patch0: tuned-2.10.0-python-3.7-fix.patch # Upstream patch: Patch1: 0001-tuned-adm-Fix-a-traceback-when-run-without-action-sp.patch +# Upstream patch: +Patch2: tuned-2.10.0-makefile-full-python-path.patch %description The tuned package contains a daemon that tunes system settings dynamically. @@ -205,15 +207,16 @@ It can be also used to fine tune your system for specific scenarios. %setup -q -n %{name}-%{version}%{?prerel2} %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build %install make install DESTDIR=%{buildroot} DOCDIR=%{docdir} \ %if %{with python3} - PYTHON=python3 + PYTHON=%{__python3} %else - PYTHON=python2 + PYTHON=%{__python2} %endif %if 0%{?rhel} sed -i 's/\(dynamic_tuning[ \t]*=[ \t]*\).*/\10/' %{buildroot}%{_sysconfdir}/tuned/tuned-main.conf @@ -437,6 +440,9 @@ fi %{_mandir}/man7/tuned-profiles-compat.7* %changelog +* Tue Jul 10 2018 Ondřej Lysoněk - 2.10.0-3 +- Used python intepreter path from the rpm macro + * Tue Jul 10 2018 Ondřej Lysoněk - 2.10.0-2 - tuned-adm: Fix a traceback when run without action specified - Fixed compatibility with python-3.7