Perl module's rpm doesn't provide all included files and tries to get missing ones as a dependancies

118 Views Asked by At

So, I've built an rpm for centos from tar.gz dist using cpanspec and rpmbuild tools. This module contains several embedded modules, the filesystem of dist looks like this:

lib/Module.pm
lib/Module/SubModule1.pm
lib/Module/SubModule1/SubSub1.pm
lib/Module/SubModule1/SubSub2.pm
lib/Module/SubModule2.pm
lib/Module/SubModule2/SubSub1.pm

... etc

When I try to install the rpm I see that part of these modules is required as a dependencies, like: "can't get a module Module::SubModule2 from any repo" or so. But these modules are part of the current rpm I need to install. Looks like kind of recursion: need to install module from an rpm package but can't install it because part of this module is in dependency list.

$ rpm -qp Module-1.0.rpm --provides 

Shows not all files inside of the rpm.

$ rpd -qp Module-1.0.rpm --requires

Shows some modules that are the part of the rpm itself, which is weird because I expect all these modules should be installed as a whole module package.

MANIFEST contains all files. rpm itself contains all files even these that look like dependencies.

Please help me to figure out how to setup spec file or do another thing to provide a valid rpm package.

Thanks.

2

There are 2 best solutions below

0
Dave Cross On

A quick workaround would be to add a "provides" line to your spec file.

Provides:    perl(Module::SubModule2)
0
msuchy On

You may want to read https://docs.fedoraproject.org/en-US/packaging-guidelines/Perl/#_build_dependencies

The dependency on Module::SubModule2 is automatically created by the dependency generator (in package perl-generators). On the other hand, this generator should generate the provides as well.

E.g.:

$ rpm -ql perl-DateTime
...
/usr/lib64/perl5/vendor_perl/DateTime
/usr/lib64/perl5/vendor_perl/DateTime.pm
/usr/lib64/perl5/vendor_perl/DateTime/Conflicts.pm
/usr/lib64/perl5/vendor_perl/DateTime/Duration.pm
/usr/lib64/perl5/vendor_perl/DateTime/Helpers.pm
/usr/lib64/perl5/vendor_perl/DateTime/Infinite.pm
/usr/lib64/perl5/vendor_perl/DateTime/LeapSecond.pm
/usr/lib64/perl5/vendor_perl/DateTime/PP.pm
/usr/lib64/perl5/vendor_perl/DateTime/PPExtra.pm
/usr/lib64/perl5/vendor_perl/DateTime/Types.pm
...
$ rpm -q --provides perl-DateTime
perl(DateTime) = 1.59
perl(DateTime::Duration) = 1.59
perl(DateTime::Helpers) = 1.59
perl(DateTime::Infinite) = 1.59
perl(DateTime::Infinite::Future)
perl(DateTime::Infinite::Past)
perl(DateTime::LeapSecond) = 1.59
perl(DateTime::PP) = 1.59
perl(DateTime::PPExtra) = 1.59
perl(DateTime::Types) = 1.59
perl-DateTime = 2:1.59-2.fc38
perl-DateTime(x86-64) = 2:1.59-2.fc38

If you have only requires but no provides, then you have a broken Perl dependency generator.