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:
parent
38700a9523
commit
d9fc98357c
2 changed files with 4 additions and 4 deletions
4
Makefile
4
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\/)\<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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue