- add filtering system macros, w/o backporting other updates (#516240)

This commit is contained in:
Chris Weyl 2009-08-21 20:54:07 +00:00
parent 576c77367e
commit c2d31ae7a1
2 changed files with 45 additions and 1 deletions

View File

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

View File

@ -1,7 +1,7 @@
Summary: Red Hat specific rpm configuration files.
Name: redhat-rpm-config
Version: 9.0.3
Release: 5%{?dist}
Release: 6%{?dist}
# No version specified.
License: GPL+
Group: Development/System
@ -9,6 +9,7 @@ Source: redhat-rpm-config-%{version}.tar.bz2
Patch0: redhat-rpm-config-9.0.3-fix-requires.patch
Patch1: limit-smp-16-threads.patch
Patch2: redhat-rpm-config-9.0.3-always_delete_buildroot_at_install.patch
Patch3: redhat-rpm-config-9.0.3-filtering-macros.patch
BuildArch: noarch
Requires: mktemp
BuildRoot: %{_tmppath}/%{name}-root
@ -33,6 +34,9 @@ rm -rf ${RPM_BUILD_ROOT}
%{_prefix}/lib/rpm/redhat
%changelog
* Fri Aug 21 2009 Chris Weyl <cweyl@alumni.drew.edu> - 9.0.3-6
- add filtering system macros, w/o backporting other updates (#516240)
* Tue Jul 21 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 9.0.3-5
- always delete %%buildroot as first step of %%install (as long as %buildroot is not /)