]> git.pld-linux.org Git - packages/rpm.git/blobdiff - rpm.macros
- 10000x performance boost for packages calling %find_lang more than once (try kdemod...
[packages/rpm.git] / rpm.macros
index 6f4300859395281b5871e3367c6198d4a604ba22..354c9573b7468b74b85196f13fe3c2631c16b952 100644 (file)
@@ -31,6 +31,7 @@ fi; \
 
 %__glib_gettextize     glib-gettextize --copy --force
 %__gnome_doc_common    gnome-doc-common --copy
+%__gnome_doc_prepare   gnome-doc-prepare --copy --force
 %__gtkdocize           gtkdocize --copy
 %__intltoolize         intltoolize --copy --force
 %__libtoolize          libtoolize --copy --force
@@ -50,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 - %filterout_c   - %filterout_ld
+# %rpmcxxflags  = %optflags - %filterout - %filterout_cxx - %filterout_ld
+# %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} %{?filterout_c} %{?filterout_ld}",F);
+       %{filter_out}
+}')
+
+%rpmcxxflags %(awk 'BEGIN {
+       split("%{?debug:%debugcflags}%{!?debug:%optflags}%{?debuginfocflags}",I);
+       split("%{?filterout} %{?filterout_cxx} %{?filterout_ld}",F);
+       %{filter_out}
+}')
+
+%rpmldflags %(awk 'BEGIN {
+       split("%{?optldflags}",I);
+       split("%{?filterout_ld}",F)
+       %{filter_out}
+}')
+
 #-----------------------------------------------------------------
 %configure2_13 { \
  if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \
@@ -371,16 +412,34 @@ fi \
 #
 %update_desktop_database_post() {{ \
        umask 022; \
-       /usr/bin/update-desktop-database; \
+       /usr/bin/update-desktop-database -q; \
 }}
 
 %update_desktop_database_postun() {{ \
 if [ $1 = 0 ]; then \
        umask 022; \
-       /usr/bin/update-desktop-database; \
+       /usr/bin/update-desktop-database -q; \
 fi \
 }}
 
+#-----------------------------------------------------------------
+# Update shared MIME info database
+# requires: shared-mime-info
+#
+%update_mime_database() {{ \
+       umask 022; \
+       /usr/bin/update-mime-database %{_datadir}/mime; \
+}}
+
+#-----------------------------------------------------------------
+# Update icon cache
+# requires: gtk+
+#
+%update_icon_cache() {{ \
+       umask 022; \
+       /usr/bin/gtk-update-icon-cache -qf %{_datadir}/icons/%1; \
+}}
+
 #-----------------------------------------------------------------
 # Update scrollkeeper database
 # requires: scrollkeeper
This page took 0.038783 seconds and 4 git commands to generate.