[packages/re2] build test objects with main build

glen glen at pld-linux.org
Sat Mar 16 13:33:52 CET 2013


commit e2543a2f16bf14f8c83bdacd9ae1487b602fc6cb
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sat Mar 16 14:30:21 2013 +0200

    build test objects with main build
    
    this way running tests don't do compiling

 re2.spec           |  8 ++++++--
 test-compile.patch | 13 +++++++++++++
 2 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/re2.spec b/re2.spec
index f6d5494..94c2646 100644
--- a/re2.spec
+++ b/re2.spec
@@ -12,6 +12,7 @@ Group:		Libraries
 URL:		http://code.google.com/p/re2/
 Source0:	http://re2.googlecode.com/files/%{name}-%{version}.tgz
 # Source0-md5:	ef66646926e6cb8f11f277b286eac579
+Patch0:		test-compile.patch
 BuildRequires:	libstdc++-devel
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -52,12 +53,15 @@ Static %{name} library.
 Statyczna biblioteka %{name}.
 
 %prep
-%setup -q -n %{name}
+%setup -qc
+# want versioned builddir, so shuffle files around
+mv re2 .re2; mv .re2/* .
+%patch0 -p1
 
 %build
 # The -pthread flag issue has been submitted upstream:
 # http://groups.google.com/forum/?fromgroups=#!topic/re2-dev/bkUDtO5l6Lo
-%{__make} \
+%{__make} all %{?with_tests:compile-test} \
 	CXX="%{__cxx}" \
 	CXXFLAGS="%{rpmcxxflags}" \
 	LDFLAGS="%{rpmldflags} -pthread" \
diff --git a/test-compile.patch b/test-compile.patch
new file mode 100644
index 0000000..480780c
--- /dev/null
+++ b/test-compile.patch
@@ -0,0 +1,13 @@
+--- re2-20130115/Makefile~	2012-10-21 16:15:03.000000000 +0300
++++ re2-20130115/Makefile	2013-03-16 14:27:32.606438040 +0200
+@@ -214,7 +214,9 @@
+ 
+ testofiles: $(TESTOFILES)
+ 
+-test: $(DTESTS) $(TESTS) $(STESTS) debug-test static-test shared-test
++compile-test: $(DTESTS) $(TESTS) $(STESTS)
++
++test: compile-test debug-test static-test shared-test
+ 
+ debug-test: $(DTESTS)
+ 	@echo
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/re2.git/commitdiff/e2543a2f16bf14f8c83bdacd9ae1487b602fc6cb



More information about the pld-cvs-commit mailing list