1
0
Fork 0

Makefile: added support for python interpreter with arbitrary path

Also used python macros in the spec file.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
Jaroslav Škarvada 2018-07-09 14:48:56 +02:00
parent 38700a9523
commit d9fc98357c
No known key found for this signature in database
GPG key ID: D8E1C00E076E840B
2 changed files with 4 additions and 4 deletions

View file

@ -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\/)\<python\>/\1$(PYTHON)/'
SHEBANG_REWRITE_REGEX= '1s|^\#!/usr/bin/\<python\>|\#!$(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)

View file

@ -215,9 +215,9 @@ It can be also used to fine tune your system for specific scenarios.
%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