[packages/rpm-build-macros] adjust to build with git

glen glen at pld-linux.org
Thu Aug 2 21:38:54 CEST 2012


commit 84bc5ffe1af6924f88841755ea3450397e957619
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Thu Aug 2 22:38:44 2012 +0300

    adjust to build with git

 rpm-build-macros.spec | 7 +++++--
 rpm-find-lang         | 3 +--
 rpm.macros            | 3 +--
 3 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/rpm-build-macros.spec b/rpm-build-macros.spec
index 6de164e..9f150b0 100644
--- a/rpm-build-macros.spec
+++ b/rpm-build-macros.spec
@@ -15,6 +15,7 @@ Source4:	dokuwiki-find-lang.sh
 Patch0:		disable-systemd.patch
 #Patchx: %{name}-pydebuginfo.patch
 BuildRequires:	rpm >= 4.4.9-56
+BuildRequires:	sed >= 4.0
 Requires:	findutils >= 1:4.2.26
 Provides:	rpmbuild(find_lang) = %{find_lang_rev}
 Provides:	rpmbuild(macros) = %{rpm_macros_rev}
@@ -56,12 +57,14 @@ cp -p %{SOURCE1} .
 %endif
 
 %build
-rev=$(awk '/^#.*Revision:.*Date/{print $3}' rpm.macros)
+%{__sed} -i -e 's,\$Revision\$,%{rpm_macros_rev},' rpm.macros
+
+rev=$(awk '/^%%rpm_build_macros/{print $2}' rpm.macros)
 if [ "$rev" != "%rpm_macros_rev" ]; then
 	: Update rpm_macros_rev define to $rev, and retry
 	exit 1
 fi
-rev=$(awk '/^#.*Id:.*/{print $4}' %{SOURCE3})
+rev=$(awk -F= '/^VERSION/{print $2}' %{SOURCE3})
 if [ "$rev" != "%find_lang_rev" ]; then
 	: Update find_lang_rev define to $rev, and retry
 	exit 1
diff --git a/rpm-find-lang b/rpm-find-lang
index 12e47cd..8b440fa 100644
--- a/rpm-find-lang
+++ b/rpm-find-lang
@@ -1,5 +1,4 @@
 #!/bin/sh
-# $Id$
 
 # find-lang - automagically generate list of language specific files
 # for inclusion in an rpm spec file.
@@ -35,7 +34,7 @@
 #   * start support for KDE help files
 
 PROG=${0##*/}
-VERSION=$(set -- $Revision$; echo $2)
+VERSION=1.35
 
 usage () {
 cat <<EOF
diff --git a/rpm.macros b/rpm.macros
index 9bcf7a7..86a5e2c 100644
--- a/rpm.macros
+++ b/rpm.macros
@@ -1,11 +1,10 @@
-# $Revision$, $Date$
 # vim:ts=4 sw=4 noet ft=spec
 #
 # PLD Linux rpm macros.
 # <http://www.pld-linux.org/>
 
 # can be used by builder script to check for version
-%rpm_build_macros	%(R="$Revision$"; RR="${R##: }"; echo ${RR%%?})
+%rpm_build_macros	$Revision$
 
 %epoch		0
 %x8664		x86_64 amd64 ia32e


More information about the pld-cvs-commit mailing list