Filtering requires/provides

Paul Howarth paul at city-fan.org
Thu Mar 9 08:45:30 UTC 2006


On Wed, 2006-03-08 at 14:10 -0600, Jason L Tibbitts III wrote:
> >>>>> "SP" == Steven Pritchard <steve at silug.org> writes:
> 
> SP> Yes, this changes filter-requires.sh, so any source rpm built from
> SP> this will have @@PERL_REQ@@ pre-substituted, but is that really a
> SP> major problem?
> 
> I think any modification to the source directory is going to be
> problematic.  There's no guarantee that the RPM builder is going to
> have write access to that directory.  (It won't work one of my setups,
> where that directory is readable but not writable by the user I build
> RPMs as.)

Why not modify the script so that instead of having to substitute
@@PERL_REQ@@, the necessary value is passed as a parameter to it?

So the spec looks like this:

...
Source1:        filter-requires.sh
...
%prep
%setup -q -n Kwiki-Raw-%{version}
%global real_perl_requires %{__perl_requires}
%define __perl_requires %{SOURCE1} %{real_perl_requires}

There's no need to delete anything extra in %clean

The filter-requires.sh looks like this:

#!/bin/sh
PERL_REQ="$1"; shift
"${PERL_REQ}" "$@" | /bin/grep -Fvx '
perl(mixin)
'

Where multiple dependencies need to be filtered, add them one per line
where perl(mixin) is.

The only "unusual" requirement here is that the filter-requires.sh needs
to be executable in the SRPM, thus avoiding the need to chmod it.

Paul.




More information about the Fedora-perl-devel-list mailing list