Package: rt-tests / 1.0-3

install_hwlatdetect_into_sbindir.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Subject: rt-tests: install hwlatdetect directly into $sbindir

The python_lib directory is only for importable modules.  As hwlatdetect
needs root privileges install it into $sbindir.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 Makefile |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

--- a/Makefile
+++ b/Makefile
@@ -23,6 +23,7 @@
 DESTDIR	?=
 prefix  ?= /usr/local
 bindir  ?= $(prefix)/bin
+sbindir ?= $(prefix)/sbin
 mandir	?= $(prefix)/share/man
 srcdir	?= $(prefix)/src
 
@@ -30,8 +31,6 @@
 CPPFLAGS += -D_GNU_SOURCE -Isrc/include
 LDFLAGS ?=
 
-PYLIB  ?= $(shell python -c 'import distutils.sysconfig;  print distutils.sysconfig.get_python_lib()')
-
 ifndef DEBUG
 	CFLAGS	+= -O2
 else
@@ -181,13 +180,9 @@
 
 .PHONY: install_hwlatdetect
 install_hwlatdetect: hwlatdetect
-	if test -n "$(PYLIB)" ; then \
-		mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(mandir)/man8" ; \
-		install -D -m 755 src/hwlatdetect/hwlatdetect.py $(DESTDIR)$(PYLIB)/hwlatdetect.py ; \
-		rm -f "$(DESTDIR)$(bindir)/hwlatdetect" ; \
-		ln -s $(PYLIB)/hwlatdetect.py "$(DESTDIR)$(bindir)/hwlatdetect" ; \
-		gzip -c src/hwlatdetect/hwlatdetect.8 >"$(DESTDIR)$(mandir)/man8/hwlatdetect.8.gz" ; \
-	fi
+	mkdir -p "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(mandir)/man8"
+	install -D -m 755 src/hwlatdetect/hwlatdetect.py $(DESTDIR)$(sbindir)/hwlatdetect
+	gzip -c src/hwlatdetect/hwlatdetect.8 >"$(DESTDIR)$(mandir)/man8/hwlatdetect.8.gz"
 
 .PHONY: tarball
 tarball: