[sf-perl] Request for comments - Perl rpm builds

Fred Moyer fred at redhotpenguin.com
Wed May 18 14:00:03 PDT 2011

On Wed, May 18, 2011 at 10:37 AM, Chris Weyl <cweyl at alumni.drew.edu> wrote:
> A couple thoughts from a cursory once-over:
> You can use the canonical source package and location, and cause tell rpm
> what directory to change into by:
> %prep
> %setup -q -n perl-%{version}

Oh nice - thank you.

> You're going to want to strip or rename the metadata given in the Provides
> lines (e.g. the perl(Foo)), as that will conflict with the metadatasystem
> provided by the system Perl package.

The filter-depends.sh program seems to have taken care of most of the
troublemakers so far, but thanks for the spot, I'll implement that.

> Automatic Perl metadata generation should be disabled, for the same reason
> (conflicts with the system Perl package).  Generally speaking, this does the
> trick without impacting other metadata generation:
> %global __perl_requires %{nil}
> %global __perl_provides %{nil}
> Similarly, you're going to want to remove the "Obsoletes" lines.
> %global vs %define: %define was the standard approach for years, but
> eschewing %define for %global has become the norm in the Fedora/RHEL world
> at this point.  (AFAICT the difference is in lazy evaluation -- %global is
> evaluated and set as it's read, %defined as used.)

Thanks for the protips.

> I generally set %_prefix to /usr/perl-%{version} instead of /opt/... as I'm
> given to understand that /opt is reserved for packages completely
> independent from the system itself (e.g. self-satisfying to just about all
> dependencies) and the non-system Perl packages I build still leverage parts
> of the installed system (e.g. shared libraries) and express RPM dependency
> information.  I suspect this might get a touch religious, however. :)

What do you mean by 'completely independent'?  Perhaps /usr/local/ is
a good approach here.

> I'm going on the assumption here that you don't want to replace the system
> Perl package.  If this is the case, then you're going to want to steer clear
> of the existing RPM/Perl metadata system (autogeneration of deps of the form
> perl(Foo)), or you'll run into no end of trouble.  If you're building RPMs
> to deliver CPAN package as well, you're going to need a way to declare
> dependencies to RPM that satisfies their needs and doesn't conflict with the
> system Perl dependency system.

That's right, I don't want to replace it.

Ah, this brings back memories of building RPMs for the separate perl
binary rpm.  It is looking like I will need to prefix the binary and
associated module rpms with a namespace to differentiate them from the
system Perl module rpms.

> Whew!  Now I'm feeling an itch to get back into reviewing Fedora packages
> :-D
>                            -Chris
> --
> Chris Weyl
> Ex astris scientia

More information about the SanFrancisco-pm mailing list