CPAN to deb autopackaging
- Amount Requested:
The aim of the project would be to create automatic CPAN distribution to Debian deb packaging system. Then use it to autopackage and backport at least 50% of the CPAN distributions resulting in a Debian repository with multiple thousand Perl related packages.
Benefits to the Perl Community
Debian+Ubuntu operating systems are very popular among Perl developers. According to a http://perlide.org/poll201004/ - used by %37 percent. The Debian packaging proved over the time to be a consistent and a clean way to install software to the OS. Having CPAN distributions packaged as Debian packages would create a way to cleanly install, reinstall and uninstall Perl modules. Taking care of file conflicts and the records of which files comes from which source improving the deployment quality and maintainability.
One quite important advantage of another layer above the CPAN is the ability to apply custom patches in a well controlled and defined way.
dh-make-pm(the Debian::Apt::PM manpage) and package at least 50% (10k) of CPAN distributions.
Create and maintain Debian repository for this packages + provide hosting for it for at least 1 year.
I'm already working on and experimenting with automated Debian packaging for couple of months already. The task is not easy. The biggest problem of CPAN is that there is no way how to declare non-CPAN dependencies like shared libraries, so it has to be done manually. Another problem is the CPAN module version to CPAN distribution version (that mostly match but not always) and then the Debian package to CPAN distribution mapping. This is needed to declare minimum package version when setting up dependencies. Another minor problem is that not all requires and build_requires are listed, which is not so common thanks to CPAN testers. Sometimes the CPAN distribution are not libraries but applications. And sometimes the distributions lack the META.yml file that makes the packager life harder.
I would like to build the automates system on top of the work of Debian-Perl group. The most of the most important CPAN distributions are already packaged and needs to be just backported for the stable distribution.
Just note: Autopackaged ≠ maintained.
- Isn't this a task for Debian developers?
Yes and no.
Currently Debian squeezy (testing) has 2000+ Perl related packages. That is ~10% of all CPAN distributions. The numbers, both CPAN and Debian are growing. But for Debian the amount is limited as the packages index files needs to be loaded and processed on different machines with often limited resources. In this regard it makes sense to create a special repository dedicated just for Perl.
Second reason why no, is that the Debian developers work on testing/unstable release. Stable is stable thanks to not upgrading, just doing security bug fixing. For a Perl world having 2-3 years old CPAN distributions can be acceptable in some cases but for most cases when a Perl product is actively developed no.
- Why bother with Debian packaging?
As I mentioned earlier another layer above CPAN allows more flexibility that Linux distribution maintainers need in order to work with "foreign" software. That means adding custom patches, tweaking and customizing. Distribution packaging also keed track of the installed files and of course the package names and versions. Installing, upgrading, downgrading, removing is a part of the system. It is also easy to find from which package the installed file is coming from. Or lookup a specific file in a package indexes. Packaging also makes sure that no two packages overwrites the same file.
- How will it work? Or how does it work so far?
dpkg-scanpmpackagescan index Perl modules in a Debian repository.
apt-pmor the Debian::Apt::PM manpage can use them to look up minimal package version for a given required module version.
dh-make-pmwill build a package and recursively all the packages that are needed for it. Ex. -
dh-make-pm --cpan Geo::KML. If also apply local patches using the CPAN::Patches manpage. Debian-Perl group patches and dependencies are extracted using
Current status of setting up the build system is here:
Backport 1600+ modules that are maintained by Debian-Perl group for Debian Lenny (stable)
Note my plan is to have 1:1 relation CPAN distribution to Debian package, while original Debian has a couple of bundles to minimize the repository packages index sizes.
Continue with some CPAN author sample (ex. http://jozef.kutej.net/2010/07/cpan-authors-sample.html) and package their modules.
try to go beyond 10k packages
Set-up repository that can handle so many Debian packages
Create a repository web site with a detailed how-to reproduce so that anyone can easily build Debian packages for his/her internal purposes.
File bugs when build dependencies are missing.
Improve the CPAN::Patches manpage example set by collecting patches from RT to allow some unmaintained but still useful modules pass their tests and be packaged.
The project should be finish by the end of this year. Having funding from TPF will allow me to work starting from October 10-20h a week on it.
The grant can be simply evaluated by counting the number of packages in a repository. Installing them to a Debian Lenny machine.