Bug 183256 - Add requires and provides filtering to the Perl template
Add requires and provides filtering to the Perl template
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: fedora-rpmdevtools (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ville Skyttä
Fedora Extras Quality Assurance
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-02-27 15:08 EST by Jason Tibbitts
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-05-24 21:09:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jason Tibbitts 2006-02-27 15:08:16 EST
It seems that many Perl packages require filtering the dependencies that RPM
generates.  Please consider inserting some standard boilerplate into the Perl
specfile template providing a standard way to do this.

cat <<XXX > %{name}-prov
#!/bin/sh
%{__perl_provides} $* | sed -e '/perl(unwanted_provide)/d'
XXX
%define __perl_provides %{_builddir}/%{name}-%{version}/%{name}-prov
chmod +x %{__perl_provides}

If you think that's too much to clutter the template with then I understand;
I'll try to get it added to the wiki in any case.
Comment 1 Ville Skyttä 2006-02-27 15:41:03 EST
(In reply to comment #0)
> If you think that's too much to clutter the template with then I understand;
> I'll try to get it added to the wiki in any case.

Personally I do think it's too much as this stuff is relatively rarely needed
anyway, but let's see if folks on fedora-extras-list have differing opinions. 
There's also the same stuff for filtering spurious perl(...) autodependencies,
but luckily that's even more rare.

Some nitpickery about the suggested boilerplate:

> cat <<XXX > %{name}-prov

This should be "... << \XXX ..." (note the backslash) to prevent too early shell
variable expansion (such as with "$*" below).  And EOF sounds better than XXX to me.

> #!/bin/sh
> %{__perl_provides} $* | sed -e '/perl(unwanted_provide)/d'

No sed in perl packages, for god's sake! :)  I'd personally use grep -v.

> XXX
> %define __perl_provides %{_builddir}/%{name}-%{version}/%{name}-prov

%{name}-%{version} practically never works for perl module packages in this
context, but needs to be Foo-Bar-%{version}.
Comment 2 Jason Tibbitts 2006-02-27 16:01:30 EST
You illustrate precisely why this needs to be standardized.  Much of it is
lifted directly from the examples I found in Core and Extras CVS, although I
admit to flubbing the \EOF thing.  Every example I found in what I currently had
checked out of CVS (perl, subversion, rt3) uses sed.
Comment 3 Ville Skyttä 2006-02-27 16:12:17 EST
Standardized: sure, but in the spec template: still IMHO no.

sed vs grep: note the smiley...
Comment 4 Ralf Corsepius 2006-02-28 03:00:08 EST
(In reply to comment #2)
> You illustrate precisely why this needs to be standardized.  Much of it is
> lifted directly from the examples I found in Core and Extras CVS, although I
> admit to flubbing the \EOF thing.
POSIX. All POSIX shells support it and it's widestly used (eg. autoconf
generated configure scripts internally use it) ...

>  Every example I found in what I currently had
> checked out of CVS (perl, subversion, rt3) uses sed.
POSIX. 

sed is required to be available by POSIX, so it's safe to use it and very portable.

Using perl (or awk or ...) instead of sed for string substitutions are options,
but making it mandatory is nothing but overengineering and basically sense-free.

Choose the tool you're familiar with, for most perl packagers this will be perl,
but I prefer to use sed ;)
 
Comment 5 Jason Tibbitts 2007-05-24 21:09:06 EDT
This has been sitting open for some time, but frankly cpanspec does all of the
filtering necessary so there's little reason to have it in the suggested template.

I'll close it.

Note You need to log in before you can comment on or make changes to this bug.