Mailinglist Archive: opensuse (1658 mails)

< Previous Next >
Re: [opensuse] perl module install question

On Wed, 07 Dec 2011, Greg Freemyer wrote:
From what I see, your'e right the perl specfile should probably not
have any of the explicit Provides statements, and the Obsoletes should
be both expanded to cover all of the appropriate packages and they
should be version-ed.

Actually: it seems some stuff is also in the perl-tarball,
i.e. perl-core pulls in a version "at release" time (comparable to
openSUSE pulling in e.g. a certain kernel) and from then on, both go
their own paths again. There is e.g. cpan/Compress-Raw-Zlib in the
perl-5.14.2 tarball in the d:l:p perl-package, as well as in the
upstream tarball ( There's also the IO::Compress package

Since I'm messing with perl(IO::Compress::*) pretty heavily I don't
mind doing a SR to address that for them.

Is there a good syntax that will get the module version easily?

Obsoletes: perl(IO::Compress::Base) < version(perl(IO::Compress::Base))
Obsoletes: perl(IO::Compress::Bzip2) <

I just tried the above and it fails. I don't want to hard code in
version numbers.

As they're completely independent "external" modules integrated into
the perl-tarball, they have independent version numbers. You should be
able to get at their versions like this (from the unpacked tarball, in
the dir ${RPM_BUILD_DIR}/%{name}-%{version} (i.e. perl-5.14.2):

for pkg in Compress::Raw::Zlib; do
path=$(echo "$pkg" | sed 's,::,/,g')
name=$(echo "$pkg" | sed 's,::,-,g')
PERL5LIB="./cpan/${name}/lib" \
perl -M${pkg} -e "print qq[${pkg} <= \$${pkg}::VERSION\n];"

That's a bad example though, with non-pure-perl modules you'll likely
get an error like:

Compress::Raw::Zlib object version 2.045 does not match bootstrap
parameter 2.033 at cpan/Compress-Raw-Zlib/lib/Compress/Raw/
line 98.

unless the relevant .so is already built (and you'd need to set
PERL5LIB to ./cpan/${name}/blib/lib I'd guess (if those modules are
build seperately and not from "up tree").

But: "bootstrap parameter 2.033" is the information you want.

For IO::Compress, you need a special case, as there's no actual
IO::Compress module, the version is in the ::Base module:

$ for pkg in IO::Compress; do
path=$(echo "$pkg" | sed 's,::,/,g');
name=$(echo "$pkg" | sed 's,::,-,g;');
perl -M${pkg}::Base -e "print qq[${pkg} <= \$${pkg}::Base::VERSION\n];";
IO::Compress <= 2.033

(my in system version is 2.036, so that 2.033 is from the unpacked

You could try to grep for 'VERSION\s*=\s*[\d._]' in the relevant .pm
files. And/or the Makefile.PL / Build.PL. I'd help work on that (worst
case: one rule for each dir under ./cpan/). But, I'd actually prefer
just not having those "Obsoletes:".

Argh: "Obsoletes: perl-ExtUtils-ParseXS". IIRC ExtUtils::ParseXS is a
highly volatile target, with other modules often requiring recent
versions. openSuSE 11.4/perl-5.12.3 comes with 2.21, 12.1/perl-5.14.2
with 2.2210 which I also have in my ~obs Repo for 11.4 and others,
cpan has 3.05! And cpan reports:
CPAN_FILE S/SM/SMUELLER/ExtUtils-ParseXS-3.05.tar.gz

# zypper in 'perl-ExtUtils-ParseXS'
Loading repository data...
Reading installed packages...
Resolving package dependencies...

Problem: perl-B-C-1.34-1.x86_64 requires perl(B::Debug), but this requirement
cannot be provided
uninstallable providers: perl-5.14.2-67.1.i586[home:doiggl]
Solution 1: do not install perl-ExtUtils-ParseXS-2.2206-10.1.x86_64
Solution 2: do not install perl-ExtUtils-ParseXS-2.2206-10.1.x86_64
Solution 3: break perl-B-C by ignoring some of its dependencies

Choose from above solutions by number or cancel [1/2/3/c] (c):

That perl-B-C stuff is totally bogus: rpm -q --whatprovides 'perl(B::Debug)'

Same with Yast, just without the perl-B-C stuff.

Anyway, I don't really see a reason for the "Obsoletes" in the .spec,
I propose to just drop those.


"Amnesia used to be my favorite word, but then I forgot it."
-- the BSD fortune file
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >