problem packaging Net::TFTP for fedora 13 amd64

N

Natxo

hi,

Fedora 13 does not have the Net::TFTP module in their repositories, so I
am using cpanspec to try to build a rpm module. I follow the
instructions on http://fedoraproject.org/wiki/Perl/cpanspec

I then run this:

$ cpanspec -v Net::TFTP --packager 'Natxo Asenjo <[email protected]>'
--srpm
Updating
/home/user/.cpan/sources/modules/02packages.details.txt.gz...
Fetching /home/user/.cpan/sources/modules/02packages.details.txt.gz
from http://www.cpan.org/modules/02packages.details.txt.gz...
Fetching Net-TFTP-0.18.tar.gz from
http://www.cpan.org/authors/id/G/GB/GBARR/Net-TFTP-0.18.tar.gz...
Trying to fetch description from Net-TFTP-0.18/TFTP.pm...
Writing perl-Net-TFTP.spec...
Building source rpm from perl-Net-TFTP.spec
Wrote: /home/user/perl/build/perl-Net-TFTP-0.18-1.fc13.src.rpm

So I get a source rpm file. When I try to rebuild it:

$ rpmbuild --rebuild perl-Net-TFTP-0.18-1.fc13.src.rpm
Installing perl-Net-TFTP-0.18-1.fc13.src.rpm
error: Failed build dependencies:
perl(Test::More) >= 0.8701 is needed by
perl-Net-TFTP-0.18-1.fc13.noarch

But the Test::More version is bigger than that:

$ perl -MTest::More\ 9999
Test::More version 9999 required--this is only version 0.94.
BEGIN failed--compilation aborted.

Any idea why?

TIA,
 
P

Peter J. Holzer

Fedora 13 does not have the Net::TFTP module in their repositories, so I
am using cpanspec to try to build a rpm module. I follow the
instructions on http://fedoraproject.org/wiki/Perl/cpanspec [...]
$ rpmbuild --rebuild perl-Net-TFTP-0.18-1.fc13.src.rpm
Installing perl-Net-TFTP-0.18-1.fc13.src.rpm
error: Failed build dependencies:
perl(Test::More) >= 0.8701 is needed by
perl-Net-TFTP-0.18-1.fc13.noarch

But the Test::More version is bigger than that:

$ perl -MTest::More\ 9999
Test::More version 9999 required--this is only version 0.94.
BEGIN failed--compilation aborted.

Any idea why?

The versioning schemes of RPM and Perl are incompatible. Perl version
numbers are simple floating point numbers, so 0.94 > 0.8701. But RPM
version numbers consist of segments which are compared indvidually from
left to right. Since 0 = 0 and 94 < 8701, 0.94 is less than 0.8701.

This means that when packaging Perl modules as RPMs, one may have to
adjust the number of digits in version numbers. If there was a version
0.8701 and the new version is 0.94, it must be written as 0.9400 to be
larger than the old version. Or you could change the dependency in the
..spec file from 0.8701 to 0.87.01 so that it is less than 0.94.

In any case you have to inspect the version numbers of the RPM packages
not the Perl modules, to see what scheme is used by Fedora.

hp
 
J

J.I. Asenjo

This means that when packaging Perl modules as RPMs, one may have to
adjust the number of digits in version numbers. If there was a version
0.8701 and the new version is 0.94, it must be written as 0.9400 to be
larger than the old version. Or you could change the dependency in the
.spec file from 0.8701 to 0.87.01 so that it is less than 0.94.

ok, I changed that in the spec file and it works. Thanks for the
pointer.
In any case you have to inspect the version numbers of the RPM packages
not the Perl modules, to see what scheme is used by Fedora.

Yes, that will be the correct way for future packages. I need to read up
on rpm packaging now.

Thanks again.
 
P

Peter J. Holzer

Ahahahahaha. Would that it were so.

I left out v-strings, since I think they weren't relevant to the OP's
question.

In the case of Test::More (and many other modules on CPAN), v-strings
also don't capture the intent of the author. If you have two version
numbers like "0.8701" and "0.94", I think it is clear that the author
intended that to mean "version 0, subversion 87, subsubversion 1" and
"version 0, subversion 94", respectively. But 0.8701 is equivalent to
v0.870.100 and 0.94 is equivalent to v.940.0. Fortunately, for
comparison purposes, it doesn't make any difference.

BTW, there's an error in perldoc version. It says (at least until
5.12.1):

$v1 = version->parse("v0.95.0");
$bool = $v1 < 0.96; # FALSE since 0.96 is v0.960.0

The comment should read "TRUE since 0.96 is v0.960.0", but of course
that isn't surprising. A better example would be

$v1 = version->parse("v0.97.0");
$bool = $v1 < 0.96; # TRUE since 0.96 is v0.960.0

Presumably you haven't come across the 'delights' of version.pm yet?

I know about v-strings, the _ convention for alpha versions on CPAN,
etc. But so far it hasn't caused me any trouble.

hp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top