Skip to contentSkip to conversation

rt-tests: NUMA optional for make rpm

PATCH In review Frank Rowand 2 participants 2 messages Feb 11, 2013 – Feb 15, 2013 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 rt-tests: NUMA optional for make rpm

version 2:
- Add new placeholders in rt-tests.spec-in to make the replacements by "make rpm" more visible to future maintainers of rt-tests.spec-in
- fix typo of my name in rt-tests.spec-in

rt-tests can be built without NUMA:

make NUMA=0

But "make rpm" does not have a way to be successful without NUMA:

build_rt-tests_0.85> make rpm
for F in cyclictest signaltest pi_stress rt-migrate-test ptsematest sigwaittest svsematest pmqtest sendme pip_stress hackbench *.o .depend *.*~ *.orig *.rej rt-tests.spec *.d *.a ChangeLog; do find -type f -name $F | xargs rm -f; done rm -f hwlatdetect
rm -f tags
rm -rf BUILD BUILDROOT RPMS SRPMS SPECS releases *.tar.gz rt-tests.spec tmp
git log >ChangeLog
mkdir -p releases
mkdir -p tmp/rt-tests
cp -r Makefile COPYING ChangeLog src tmp/rt-tests
tar -C tmp -czf rt-tests-0.85.tar.gz rt-tests
rm -f ChangeLog
cp rt-tests-0.85.tar.gz releases
sed s/__VERSION__/0.85/ <rt-tests.spec-in >rt-tests.spec
rpmbuild -ba --define "_topdir /a/home/frowand/me/src/rt-tests/build_rt-tests_0.85" --define "_sourcedir /a/home/frowand/me/src/rt-tests/build_rt-tests_0.85/releases" --define "_builddir /a/home/frowand/me/src/rt-tests/build_rt-tests_0.85/BUILD" rt-tests.spec
error: Failed build dependencies:

           numactl-devel is needed by rt-tests-0.85-1.fc12.src

make: *** [rpm] Error 1

The following patch allows the rpm to be built without NUMA, with the command:

make NUMA=0 rpm

---

 Makefile         |    8 	8 +	0 -	0 !
 rt-tests.spec-in |    9 	6 +	3 -	0 !
 2 files changed, 14 insertions(+), 3 deletions(-)
Makefile +8 -0
Index: b/Makefile
===================================================================
@@ -161,6 +161,14 @@ pushtest: release
 
 rt-tests.spec: Makefile rt-tests.spec-in
 	sed s/__VERSION__/$(VERSION_STRING)/ <$@-in >$@
+ifeq ($(NUMA),1)
+	sed -i -e 's/__MAKE_NUMA__/NUMA=1/' $@
+	sed -i -e 's/__BUILDREQUIRES_NUMA__/numactl-devel/' $@
+else
+	sed -i -e 's/__MAKE_NUMA__//' $@
+	sed -i -e 's/__BUILDREQUIRES_NUMA__//' $@
+endif
+
 
 HERE	:=	$(shell pwd)
 RPMARGS	:=	--define "_topdir $(HERE)" 	\
rt-tests.spec-in +6 -3
Index: b/rt-tests.spec-in
===================================================================
@@ -2,6 +2,7 @@
 
 Summary: Programs that test various rt-features
 Name: rt-tests
+# __VERSION__ will be replaced by "make rpm"
 Version: __VERSION__
 Release: 1%{?dist}
 License: GPLv2
@@ -10,7 +11,8 @@ URL: git://git.kernel.org/pub/scm/linux/
 Source0: %{name}-%{version}.tar.gz
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 Obsoletes: cyclictest signaltest pi_tests
-BuildRequires: numactl-devel python
+# __BUILDREQUIRES__ will be replaced by "make rpm"
+BuildRequires: __BUILDREQUIRES_NUMA__ python
 
 %description
 rt-tests is a set of programs that test and measure various components of
@@ -21,7 +23,8 @@ latency. It also tests the functioning o
 %setup -qn rt-tests
 
 %build
-make NUMA=1
+# __MAKE_NUMA__ will be replaced by "make rpm"
+make __MAKE_NUMA__
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -64,7 +67,7 @@ rm -rf $RPM_BUILD_ROOT
 %changelog
 * Tue Nov 13 2012 Clark Williams <[email protected]> - 0.85-1
 - [cyclictest] add tracemark function back to breaktrace logic
-- from Frank Rowland <[email protected]>:
+- from Frank Rowand <[email protected]>:
   - [cyclictest] report large measured clock latency
   - [cyclictest] cleanup getopt_long() parameters
 - from John Kacur <[email protected]>:
#1 lore raw
Quoted 96 lines · Frank Rowand

version 2:
- Add new placeholders in rt-tests.spec-in to make the replacements by "make rpm" more visible to future maintainers of rt-tests.spec-in
- fix typo of my name in rt-tests.spec-in

rt-tests can be built without NUMA:

make NUMA=0

But "make rpm" does not have a way to be successful without NUMA:

build_rt-tests_0.85> make rpm
for F in cyclictest signaltest pi_stress rt-migrate-test ptsematest sigwaittest svsematest pmqtest sendme pip_stress hackbench *.o .depend *.*~ *.orig *.rej rt-tests.spec *.d *.a ChangeLog; do find -type f -name $F | xargs rm -f; done rm -f hwlatdetect
rm -f tags
rm -rf BUILD BUILDROOT RPMS SRPMS SPECS releases *.tar.gz rt-tests.spec tmp
git log >ChangeLog
mkdir -p releases
mkdir -p tmp/rt-tests
cp -r Makefile COPYING ChangeLog src tmp/rt-tests
tar -C tmp -czf rt-tests-0.85.tar.gz rt-tests
rm -f ChangeLog
cp rt-tests-0.85.tar.gz releases
sed s/__VERSION__/0.85/ <rt-tests.spec-in >rt-tests.spec
rpmbuild -ba --define "_topdir /a/home/frowand/me/src/rt-tests/build_rt-tests_0.85" --define "_sourcedir /a/home/frowand/me/src/rt-tests/build_rt-tests_0.85/releases" --define "_builddir /a/home/frowand/me/src/rt-tests/build_rt-tests_0.85/BUILD" rt-tests.spec
error: Failed build dependencies:

           numactl-devel is needed by rt-tests-0.85-1.fc12.src

make: *** [rpm] Error 1

The following patch allows the rpm to be built without NUMA, with the command:

make NUMA=0 rpm

---

 Makefile         |    8 	8 +	0 -	0 !
 rt-tests.spec-in |    9 	6 +	3 -	0 !
 2 files changed, 14 insertions(+), 3 deletions(-)

Index: b/Makefile
===================================================================

Makefile +8 -0
@@ -161,6 +161,14 @@ pushtest: release
 
 rt-tests.spec: Makefile rt-tests.spec-in
 	sed s/__VERSION__/$(VERSION_STRING)/ <$@-in >$@
+ifeq ($(NUMA),1)
+	sed -i -e 's/__MAKE_NUMA__/NUMA=1/' $@
+	sed -i -e 's/__BUILDREQUIRES_NUMA__/numactl-devel/' $@
+else
+	sed -i -e 's/__MAKE_NUMA__//' $@
+	sed -i -e 's/__BUILDREQUIRES_NUMA__//' $@
+endif
+
 
 HERE	:=	$(shell pwd)
 RPMARGS	:=	--define "_topdir $(HERE)" 	\

Index: b/rt-tests.spec-in
===================================================================

rt-tests.spec-in +5 -2
@@ -2,6 +2,7 @@
 
 Summary: Programs that test various rt-features
 Name: rt-tests
+# __VERSION__ will be replaced by "make rpm"
 Version: __VERSION__
 Release: 1%{?dist}
 License: GPLv2
@@ -10,7 +11,8 @@ URL: git://git.kernel.org/pub/scm/linux/
 Source0: %{name}-%{version}.tar.gz
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 Obsoletes: cyclictest signaltest pi_tests
-BuildRequires: numactl-devel python
+# __BUILDREQUIRES__ will be replaced by "make rpm"
+BuildRequires: __BUILDREQUIRES_NUMA__ python
 
 %description
 rt-tests is a set of programs that test and measure various components of
@@ -21,7 +23,8 @@ latency. It also tests the functioning o
 %setup -qn rt-tests
 
 %build
-make NUMA=1
+# __MAKE_NUMA__ will be replaced by "make rpm"
+make __MAKE_NUMA__
 
 %install
 rm -rf $RPM_BUILD_ROOT

rt-tests.spec-in rm -rf $RPM_BUILD_ROOT · line 73

Quoted 8 lines
rt-tests.spec-in +1 -1
@@ -64,7 +67,7 @@ rm -rf $RPM_BUILD_ROOT
 %changelog
 * Tue Nov 13 2012 Clark Williams <[email protected]> - 0.85-1
 - [cyclictest] add tracemark function back to breaktrace logic
-- from Frank Rowland <[email protected]>:
+- from Frank Rowand <[email protected]>:
   - [cyclictest] report large measured clock latency
   - [cyclictest] cleanup getopt_long() parameters
 - from John Kacur <[email protected]>:

Thanks Frank, I added this to my queue, will push to Clark for the next build.

John