Chris Weyl b587b5d
--- redhat-rpm-config-9.0.3/macros.orig	2009-08-07 08:48:50.925412526 -0700
Chris Weyl b587b5d
+++ redhat-rpm-config-9.0.3/macros	2009-08-07 08:55:16.374536719 -0700
a4525c3
@@ -243,3 +243,37 @@ kernel_module_package_release	1
Chris Weyl b587b5d
 	fi \
Chris Weyl b587b5d
 	kmp_override_filelist="$filelist" kmp_override_preamble="$preamble" kmp_nobuildreqs="$buildreqs" %{kmodtool} rpmtemplate_kmp %{-n*}%{!-n:%name} %{kverrel} $flavors_to_build 2>/dev/null \
Chris Weyl b587b5d
 )}
Chris Weyl b587b5d
+
Chris Weyl b587b5d
+#==============================================================================
Chris Weyl b587b5d
+# ---- Generic auto req/prov filtering macros 
Chris Weyl b587b5d
+#
Chris Weyl b587b5d
+# http://fedoraproject.org/wiki/PackagingDrafts/AutoProvidesAndRequiresFiltering
Chris Weyl b587b5d
+
Chris Weyl b587b5d
+# prevent anything matching from being scanned for provides
Chris Weyl b587b5d
+%filter_provides_in(P) %{expand: \
Chris Weyl b587b5d
+%global __filter_prov_cmd %{?__filter_prov_cmd} %{__grep} -v %{-P} '%*' | \
Chris Weyl b587b5d
+}
Chris Weyl b587b5d
+
Chris Weyl b587b5d
+# prevent anything matching from being scanned for requires
Chris Weyl b587b5d
+%filter_requires_in(P) %{expand: \
Chris Weyl b587b5d
+%global __filter_req_cmd %{?__filter_req_cmd} %{__grep} -v %{-P} '%*' | \
Chris Weyl b587b5d
+}
Chris Weyl b587b5d
+
Chris Weyl b587b5d
+# filter anything matching out of the provides stream
Chris Weyl b587b5d
+%filter_from_provides() %{expand: \
Chris Weyl b587b5d
+%global __filter_from_prov %{?__filter_from_prov} | %{__sed} -e '%*' \
Chris Weyl b587b5d
+}
Chris Weyl b587b5d
+
Chris Weyl b587b5d
+# filter anything matching out of the requires stream
Chris Weyl b587b5d
+%filter_from_requires() %{expand: \
Chris Weyl b587b5d
+%global __filter_from_req %{?__filter_from_req} | %{__sed} -e '%*' \
Chris Weyl b587b5d
+}
Chris Weyl b587b5d
+
Chris Weyl b587b5d
+# actually set up the filtering bits 
Chris Weyl b587b5d
+%filter_setup %{expand: \
Chris Weyl b587b5d
+%global _use_internal_dependency_generator 0 \
Chris Weyl b587b5d
+%global __deploop() while read FILE; do /usr/lib/rpm/rpmdeps -%{1} ${FILE}; done | /bin/sort -u \
Chris Weyl b587b5d
+%global __find_provides /bin/sh -c "%{?__filter_prov_cmd} %{__deploop P} %{?__filter_from_prov}" \
Chris Weyl b587b5d
+%global __find_requires /bin/sh -c "%{?__filter_req_cmd}  %{__deploop R} %{?__filter_from_req}" \
Chris Weyl b587b5d
+}
Chris Weyl b587b5d
+