Filtering requires/provides
Steven Pritchard
steve at silug.org
Wed Mar 8 19:20:27 UTC 2006
I just want to throw this idea out for everyone to consider. I'm not
100% happy with it, but I can't say I'm 100% happy with any other
solution I've seen.
Let me state for the record that TMTOWTDI, but I'm looking for
something that I can script in cpanspec, that doesn't litter
%_sourcedir, that honors %__perl_requires, and that isn't *too* ugly.
I'm using the perl-Kwiki-Raw package (not yet submitted, but available
at http://ftp.kspei.com/pub/steve/rpms/perl-Kwiki-Raw/) as my test.
In it, I need to filter a dependency on "perl(mixin)".
First, I added the following to the spec:
Source1: filter-requires.sh
%global real_perl_requires %{__perl_requires}
%define __perl_requires %{SOURCE1}
Then, in %prep, added the following:
sed -i -e 's,@@PERL_REQ@@,%{real_perl_requires},' %{SOURCE1}
The filter_requires.sh looks like this:
#!/bin/sh
@@PERL_REQ@@ "$@" | sed -e '/^perl(mixin)$/d'
Yes, this changes filter-requires.sh, so any source rpm built from
this will have @@PERL_REQ@@ pre-substituted, but is that really a
major problem?
Steve
--
Steven Pritchard - K&S Pritchard Enterprises, Inc.
Email: steve at kspei.com http://www.kspei.com/
Phone: (618)398-3000 Mobile: (618)567-7320
More information about the Fedora-perl-devel-list
mailing list