]> git.pld-linux.org Git - packages/rpm.git/blobdiff - rpm.macros
- %filterout_* support (in build-specyfic macros because of awk requeriment)
[packages/rpm.git] / rpm.macros
index 95550ad20588c7436851ae6d110fde92639de524..df7db86271ce7dbc1fd87a798aa149e24a87cf64 100644 (file)
@@ -51,6 +51,46 @@ fi; \
 #      and that both p and q are package names (i.e. no version/release).
 %_dependency_whiteout  %{nil}
 
+
+#-----------------------------------------------------------------
+#
+# (re)definition of %{rpm*flags} with %filterout_* support
+# Requires:            awk
+#
+# Flags specified in %filterout_* are removed from %rpm*flags, exactly:
+# %rpmcflags   = %optflags - %filterout_c - %filterout_ld
+# %rpmcxxflags = %rpmcflags - %filterout_cxx
+# %rpmldflags  = %optldflags - %filterout_ld
+#
+# Regular expressions are supported, but to avoid some character be treated
+# as regular expression it must be escaped twice.
+
+%filter_out                                            \
+       for (i in I) {  A=0;                    \
+               for (f in F) {                          \
+                       if (I[i] ~ "^" F[f] "$") A=1;   \
+               };                                                      \
+               if (!A) printf(I[i] FS);        \
+       }
+
+%rpmcflags %(awk 'BEGIN {
+       split("%{?debug:%debugcflags}%{!?debug:%optflags}%{?debuginfocflags}",I);
+       split("%{?filterout_c} %{?filterout_ld}",F);
+       %{filter_out}
+}')
+
+%rpmcxxflags %(awk 'BEGIN {
+       split("%{rpmcflags}",I);
+       split("%{?filterout_cxx}",F);
+       %{filter_out}
+}')
+
+%rpmldflags %(awk 'BEGIN {
+       split("%{optldflags}",I);
+       split("%{?filterout_ld}",F)
+       %{filter_out}
+}')
+
 #-----------------------------------------------------------------
 %configure2_13 { \
  if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \
@@ -397,7 +437,7 @@ fi \
 #
 %update_icon_cache() {{ \
        umask 022; \
-       gtk-update-icon-cache -qf %{_datadir}/icons/%1; \
+       /usr/bin/gtk-update-icon-cache -qf %{_datadir}/icons/%1; \
 }}
 
 #-----------------------------------------------------------------
This page took 0.027567 seconds and 4 git commands to generate.