I'm researching about how to package some of my Perl apps and better manage their dependencies to make distribution easier for me and my customers, which most likely doesn't include uploading to CPAN at all. Instead, I would provide custom repos if necessary or, more likely, access to SCMs like Subversion.
CPAN::Meta::Spec seems to provide what I need to describe my apps, their dependencies and even where to get them from, but what I'm wondering is about the level of detail of pre-requisites. The spec contains the following sentence:
The set of relations must be specified as a Map of package names to version ranges.
Requiring packages seems a little too low level for my needs, I would prefer requiring distributions instead. Pretty much the level (from my understanding) tools like Maven and Gradle work at, e.g. Apache Commons Lang vs. Apache Commons IO etc. instead of individual classes like org.apache.commons.lang3.AnnotationUtils
or org.apache.commons.io.ByteOrderMark
. OTOH, the example in the docs contains the following lines:
requires => {
'perl' => '5.006',
'File::Spec' => '0.86',
'JSON' => '2.16',
},
The line containing perl
doesn't look like a package to me and I didn't find some package perl
or perl.pm
anywhere on my system. Seems to me like that is handled differently to the other things of the example.
I have a system wide folder containing e.g. some utility packages, which seems comparable to some abstract perl
to me. That folder should get defined as one distribution, maintain a version number for all of the packages in that folder and therefore should allow other apps to require
that whole thing. If I understand the docs correctly, I would need to create not only the META.yml
in the folder, but additionally some e.g. sysutils.pm
containing package sysutils;
and defining some version.
Is there some way to avoid creating that file and really require
the distribution itself only?
The META.yml
already contains a name and version on it's own, so looks like some abstract thing one could require
in theory. I don't see the need of adding an additional .pm
-file representing the distribution itself only to allow require
to work. It wouldn't contain any business logic in my case.
Thanks!