[sockperf/el6] simplify spec; build fix

Michal Schmidt michich at fedoraproject.org
Mon Sep 8 15:37:20 UTC 2014


commit f338165324bd75f29d2a91576e54ca2ef35df9b7
Author: Michal Schmidt <mschmidt at redhat.com>
Date:   Mon Sep 8 16:29:29 2014 +0200

    simplify spec; build fix
    
    Simplify svnversion substitution.
    
    Conflicts:
    	sockperf.spec

 sockperf.spec |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/sockperf.spec b/sockperf.spec
index 54120ec..961dc0d 100644
--- a/sockperf.spec
+++ b/sockperf.spec
@@ -1,5 +1,7 @@
 Name:           sockperf
-Version:        2.5.244
+%global mainversion 2.5
+%global svnversion 244
+Version:        %{mainversion}.%{svnversion}
 Release:        1%{?dist}
 Summary:        Network benchmarking utility for testing latency and throughput
 
@@ -9,7 +11,7 @@ URL:            https://code.google.com/p/sockperf/
 #Source archive generated from upstream SVN checkout:
 # svn export -r 244 http://sockperf.googlecode.com/svn/branches/sockperf_v2/ sockperf-2.5.244
 # tar -cJvf sockperf-2.5.244.tar.xz sockperf-2.5.244/
-Source0:        sockperf-2.5.244.tar.xz
+Source0:        %{name}-%{version}.tar.xz
 Patch1:         0001-Don-t-throw-away-Fedora-s-CXXFLAGS.patch
 Patch2:         0002-drop-the-sockperf_-version-copy-of-the-binary.patch
 Patch3:         0003-doc-installation-fixes.patch
@@ -53,11 +55,9 @@ following:
 
 %build
 # configure.ac invokes 'svnversion' to detect the exact version number.
-# It wouldn't work with the tarball. Let's replace it with the part of
-# the known version number after the last dot.
-VER_SVN=%{version}
-VER_SVN=${VER_SVN##*.}
-sed -i -e "s/svnversion \./echo $VER_SVN/" configure.ac
+# It wouldn't work with the tarball. Let's replace it with the SVN version
+# known at build time.
+sed -i -e "s/svnversion \./echo %{svnversion}/" configure.ac
 mkdir -p config/m4
 autoreconf -fi
 %configure --enable-doc
@@ -77,8 +77,8 @@ make %{?_smp_mflags}
 
 %changelog
 * Mon Sep 08 2014 Michal Schmidt <mschmidt at redhat.com> - 2.5.244-1
-- Update to current upstream from SVN.
-- Has aarch64 and ppc64 support.
+- Update to current upstream from SVN. Has aarch64 and ppc64 support.
+- Simplify svnversion substitution.
 
 * Fri May 09 2014 Michal Schmidt <mschmidt at redhat.com> - 2.5.241-3.el6.1
 - (EL6-specific) Make the spec file compatible with older rpm and autotools.


More information about the scm-commits mailing list