[packages/rpm-build-macros] __noauto_regexp_helper: detect quote char at runtime
glen
glen at pld-linux.org
Fri Jul 11 06:41:07 CEST 2014
commit 4b369e1f5d82685cac7f195b9c26fb14fe33bfe6
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Fri Jul 11 07:38:47 2014 +0300
__noauto_regexp_helper: detect quote char at runtime
this allows to use same rpm-build-macros but using old rpm 4.5 build
rpm-build-macros.spec | 9 ---------
rpm.macros | 7 ++++++-
rpm4.patch | 11 -----------
3 files changed, 6 insertions(+), 21 deletions(-)
---
diff --git a/rpm-build-macros.spec b/rpm-build-macros.spec
index 1d88d0e..03c11b9 100644
--- a/rpm-build-macros.spec
+++ b/rpm-build-macros.spec
@@ -1,10 +1,3 @@
-#
-# Conditional build:
-%bcond_with rpm4 # prepare macros for PLD rpm 4.5 instead of rpm5
-#
-%if "%{pld_release}" == "ac"
-%define with_rpm4 1
-%endif
%define rpm_macros_rev 1.694
%define find_lang_rev 1.36
Summary: PLD Linux RPM build macros
@@ -19,7 +12,6 @@ Source1: service_generator.sh
Source3: find-lang.sh
Source4: dokuwiki-find-lang.sh
Patch0: disable-systemd.patch
-Patch1: rpm4.patch
#Patchx: %{name}-pydebuginfo.patch
BuildRequires: rpm >= 4.4.9-56
BuildRequires: sed >= 4.0
@@ -62,7 +54,6 @@ cp -p %{SOURCE1} .
%{__sed} -i -e '/libtoolize --copy --force --install/s/ --install//' rpm.macros
%patch0 -p1
%endif
-%{?with_rpm4:%patch1 -p1}
%build
%{__sed} -i -e 's,{Revision},%{rpm_macros_rev},' rpm.macros
diff --git a/rpm.macros b/rpm.macros
index 3357ddf..725cb0a 100644
--- a/rpm.macros
+++ b/rpm.macros
@@ -895,7 +895,12 @@ fi; \
# %define _noautoreq_perl Apache::.*
# BuildRequires: rpmbuild(macros) >= 1.672
# %define _noautoreq_java ClassDataVersion
-%__noauto_regexp_helper(p:) %(echo "%*" | awk 'BEGIN{RS=" "}{printf("%{-p*}\\\\\\(%%s\\\\\\) ", $1)}')
+#
+%__noauto_regexp_helper(p:) %(echo "%*" | awk 'BEGIN{RS=" "}{printf("%{-p*}%{__qchar}(%%s%{__qchar}) ", $1)}')
+# detect quote character runtime
+%__qchar_4 \\\\%{nil}
+%__qchar_5 \\\\\\%{nil}
+%__qchar %{expand:%%global __qchar %%__qchar_%(echo %{_rpmversion} | cut -c1)}%__qchar
#%_noautocompressdoc %{nil}
#
diff --git a/rpm4.patch b/rpm4.patch
deleted file mode 100644
index 01d97bd..0000000
--- a/rpm4.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- rpm-build-macros-1.672/rpm.macros.orig 2013-08-18 17:59:05.046732903 +0200
-+++ rpm-build-macros-1.672/rpm.macros 2013-08-18 18:25:39.536665989 +0200
-@@ -878,7 +878,7 @@
- # %define _noautoreq_perl Apache::.*
- # BuildRequires: rpmbuild(macros) >= 1.672
- # %define _noautoreq_java ClassDataVersion
--%__noauto_regexp_helper(p:) %(echo "%*" | awk 'BEGIN{RS=" "}{printf("%{-p*}\\\\\\(%%s\\\\\\) ", $1)}')
-+%__noauto_regexp_helper(p:) %(echo "%*" | awk 'BEGIN{RS=" "}{printf("%{-p*}\\\\(%%s\\\\) ", $1)}')
-
- #%_noautocompressdoc %{nil}
- #
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/rpm-build-macros.git/commitdiff/4b369e1f5d82685cac7f195b9c26fb14fe33bfe6
More information about the pld-cvs-commit
mailing list