Bug 53051 - Perl-RPM build problems with rpm-4.0.3-0.96.src.rpm
Summary: Perl-RPM build problems with rpm-4.0.3-0.96.src.rpm
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: rpm-perl
Version: 1.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-09-02 18:40 UTC by Ed Avis
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-09-07 16:03:18 UTC
Embargoed:


Attachments (Terms of Use)

Description Ed Avis 2001-09-02 18:40:49 UTC
Description of Problem:

The package  (from Rawhide) contains leftover
generated files in the Perl-RPM directory - the source tarball is
not 'clean'.  This stops it from building correctly unless you have
the exact same version of perl that was used to generate the files.

Version-Release number of selected component (if applicable):

rpm-4.0.3-0.96.src.rpm

How Reproducible:

Download the SRPM and rpm --rebuild.  But it is more convenient
to extract the source tarball from the SRPM and build that by hand.
I can reproduce the problems on my system because it has a differing
(ie, older) version of perl installed to that used by the package
builder.  If you have the same version of perl you may not notice
a problem, but it is still a bad idea to have partially-built sources.

There are several things which stop Perl-RPM from building.  The first
is a bug in Makefile.PL where it checks the installed RPM version.  I
have sent a bug report for this to the RPM mailing list (put
$rpm_version = oct($rpm_version); before the numeric comparison is made).

Secondly, there are lots of .c files lying around.  These were generated
by xsubpp from .xs files, and they are tied closely to one version of
perl.  If you have a different version they often won't build.  Since
these .c files are not actually source code, just intermediate files,
they should be removed (make distclean does this).  Perhaps these .c
files ended up in the CVS tree by mistake.  make distclean also removes
some other intermediate files like manual pages.

If you go to the sources in /usr/src/redhat/BUILD/rpm-4.0.3/Perl-RPM/,
fix the bug in Makefile.PL and do a perl Makefile.PL followed by make
distclean, you should have a clean source tree, suitable for making into
an SRPM.

But there is one more bug: the pod documentation in RPM.pm does not have
a SYNOPSIS section.  My version of pod2man insists on this, perhaps later
versions do not, but since a synopsis is a nice thing to have anyway
here's a fix:

=head1 SYNOPSIS

    use RPM qw(vercmp);
    print 'OS: ', rpm_osname(), ', arch: ', rpm_archname(), "\n";
    if (vercmp('1.2', '7', '1.3', '2') > 0) {
        print "newer\n";
    }


Put this in between the NAME and DESCRIPTION sections of RPM.pm.  Hmm,
this isn't so much a RedHat issue as something for the rpm maintainers
themselves.  I'll send another message to the rpm mailing list with this
fix.

Once you've done these three things, the source tree should work.

(In fact, it looks like some kind of distclean or maintainerclean is needed
for the source tree as a whole - there are a lot of Makefiles about which
should surely be generated by configure.)

Comment 1 Jeff Johnson 2001-09-02 18:53:34 UTC
The "partially built source" is a remnant of
how rpm "make dist" currently packages rpm-perl
(aka Perl-RPM). You should probably look for
Randy's Perl-RPM distribution rather than extracting
from rpm if you want just Perl-RPM

Comment 2 Ed Avis 2001-09-02 19:01:11 UTC
Oh, I didn't realize that the source tree came from 'make dist' (I assumed it
was straight out of CVS).  In that case, this looks like a bug in rpm itself
rather than RedHat's packaging job.  make dist should try harder to get clean
sources (and it could remove the CVS/ directories lying around, too).

I didn't really want Perl-RPM, I wanted to upgrade rpm itself (too see whether
a segfault bug had been fixed in the latest snapshot) and Perl-RPM stopped it
building.

I do think this is a fairly important issue though: it's possible that
half-built .c files generated with one version of perl could cause
subtle bugs used with a different version.  I was lucky - all that happened
was that it failed to build :-).  (I have perl 5.005_03.)

Would you like me to chase this up on the rpm mailing list or are they already
aware of the problem?  (I don't subscribe to that list myself.)

Comment 3 Jeff Johnson 2001-09-07 16:03:13 UTC
Changing component ...

Comment 4 Jeff Johnson 2002-06-28 16:14:41 UTC
I believe that this problem has been fixed.
Howvere, the rpm-perl package has been dropped
in favor of a CPAN distribution. Try Perl-RPM
from CPAN, or RPM@, also from CPAN.


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