RPM Community Forums

Mailing List Message of <rpm-devel>

Examples of PLD _noauto* depfilter macros

From: Jeff Johnson <n3npq@mac.com>
Date: Sun 18 Jan 2009 - 20:33:29 CET
Message-id: <A0D57791-2511-4665-BE8E-B09D005037B7@mac.com>
While I'm getting ready to wire up miRE patterns to globally
filter Requires: and Provides:, its likely time to take a stab
at describing how PLD is already filtering dependencies everywhere

Here are all PLD *.spec files:
	[jbj@wellfleet SPECS]$ ls -1 *.spec | wc -l

And here's an estimate of the spec files that are filtering deps:
	[jbj@wellfleet SPECS]$ grep -l _noautoreq *.spec | wc -l
	[jbj@wellfleet SPECS]$ grep -l _noautoprov *.spec | wc -l

Here's an example that most everyone can relate to, from opera.spec.
	%ifarch %{ix86}
	%if %{with qt4}
	%setup -q -T -b 13 -n %{name}-%{version}-%{buildid}.gcc4-qt4.i386
	%define         _noautoreq      'libpng12.so.0(.*)'

The added exclude pattern
	%define         _noautoreq      'libpng12.so.0(.*)'
filters out matching Requires:, no fuss, no muss.

There's another type of exclude pattern used by PLD that disables  
dependency extraction on a given file.

Here's an example of the automagic dependecy extraction disabling  
usage case,
from the PLD wget.spec file:

A file path matching
	%define         _noautoreqfiles         %{_bindir}/rmold
will not have whatever dependency extraction helper script run on that  

Where the PLD filtering gets interesting (to me anyways), is when filter
patterns are added at the distro build level persistently. Anything
done in *.spec files is highly unportable to other distro dialects and  
just gets nuked. But the same filter patterns can be added to global
build factory configuration, and, if someone designs a per-package
hierarchical inheiritance for per-package build macros, then there's
plain and simply no need to go off and edit gazillions of spec files
just because you can.

Note also that PCRE or glob patterns, with "grep -v" negation, will
be permitted when I finish.

Note also that global macro configuration can __PREVENT__ overrides
in *.spec files using the '.' RDONLY operation like
	%._noautoreq		'libpng12.so.0(.*)'
	%._noautoreqfiles	%{_bindir}/rmold
if necessary.

So that's PLD dependency filtering in a nutshell. Q.E.D.

I would have incorporated the rpm-pld-autodeps patch into RPM years ago,
but I needed to commit to a *RE dialect first: PCRE.

So its time to start the discussion:

	Is the above syntax using patterns through macros "gud enuf" @rpm5.org?

73 de Jeff	back to wiring up miRE patterns to finish the implementation
Received on Sun Jan 18 20:33:32 2009
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.