summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClark Williams <williams@redhat.com>2010-01-26 12:23:49 -0600
committerClark Williams <williams@redhat.com>2010-01-26 12:23:49 -0600
commita1a06095616e3d89504e7a8b89f08de3b1218efe (patch)
tree329bb3d20a26d5659ca32f1af725b56da5ec1833
parent8947c646fed2afa8aacf7c816ab381b021a467fe (diff)
downloadrt-tests-a1a06095616e3d89504e7a8b89f08de3b1218efe.tar.gz
moved hwlatdetect to python site-library
Moved the hwlatdetect script to the python site-library directory so that it can be imported by other scripts Signed-off-by: Clark Williams <williams@redhat.com>
-rw-r--r--Makefile8
-rw-r--r--rt-tests.spec-in4
2 files changed, 10 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 48d98c7..ab073d7 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
VERSION_STRING = 0.61
TARGETS = cyclictest signaltest pi_stress \
- hwlatdetect rt-migrate-test ptsematest sigwaittest svsematest \
+ rt-migrate-test ptsematest sigwaittest svsematest \
sendme pip
LIBS = -lrt -lpthread
EXTRA_LIBS ?= -ldl # for get_cpu
@@ -13,6 +13,8 @@ srcdir ?= $(prefix)/src
CFLAGS = -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include
+PYLIB := $(shell python -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib()')
+
ifndef DEBUG
CFLAGS += -O2
else
@@ -38,7 +40,7 @@ VPATH += src/lib
$(CC) -D VERSION_STRING=$(VERSION_STRING) -c $< $(CFLAGS)
.PHONY: all
-all: $(TARGETS)
+all: $(TARGETS) hwlatdetect
cyclictest: cyclictest.o rt-utils.o
$(CC) $(CFLAGS) -o $@ $^ $(LIBS) $(NUMA_LIBS)
@@ -93,6 +95,8 @@ install: all
mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(mandir)/man4"
mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(mandir)/man8"
cp $(TARGETS) "$(DESTDIR)$(bindir)"
+ install -m 755 src/hwlatdetect/hwlatdetect.py $(DESTDIR)$(PYLIB)/hwlatdetect.py
+ ln -s $(PYLIB)/hwlatdetect.py "$(DESTDIR)$(bindir)/hwlatdetect"
mkdir -p "$(DESTDIR)$(srcdir)/backfire"
gzip src/backfire/backfire.4 -c >"$(DESTDIR)$(mandir)/man4/backfire.4.gz"
gzip src/cyclictest/cyclictest.8 -c >"$(DESTDIR)$(mandir)/man8/cyclictest.8.gz"
diff --git a/rt-tests.spec-in b/rt-tests.spec-in
index baffd57..b888b87 100644
--- a/rt-tests.spec-in
+++ b/rt-tests.spec-in
@@ -1,3 +1,5 @@
+%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+
Summary: Programs that test various rt-features
Name: rt-tests
Version: __VERSION__
@@ -23,6 +25,7 @@ make
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT/%{python_sitelib}
make DESTDIR=$RPM_BUILD_ROOT prefix=/usr install
%clean
@@ -30,6 +33,7 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
+%{python_sitelib}/hwlatdetect.py*
/usr/bin/cyclictest
/usr/bin/pi_stress
/usr/bin/signaltest