Dienstag, 19. Juni 2012

Programming languages often have their own packaging system to resolve dependencies. For Perl this would be CPAN, for Ruby this would be "Ruby gems".

When it comes to Gentoo and programming languages the package system of Gentoo (Portage) and the package system of the language collide. That's mostly because the Gentoo developers think they have to resolve all dependencies by the Gentoo Portage System.

Gentoo and Perl CPAN have a quite similar problem. The Perl Package Management does not honor Gentoo (with a good default permission set) and Gentoo can't honor already installed CPAN packages and to resolve its own Portage dependency hell.

The Problem

So, once you install a package with CPAN by:

cpan install Net::Twitter::Lite

You end up with permissions that won't let your users find the newly installed module. Instead they find the following error message slightly amusing:

What's wrong with g-cpan? I've never seen CPAN that well integrated with the package manager on any other system. Debian has dh-perl that automagically creates all the files to build a deb archive from an unpacked tarball from CPAN, but it leaves all the dependency resolution to the user. Extremely tedious at times. I don't know of anything equivalent for RPM-based systems. Only Gentoo lets you type "g-cpan -i " and have the module and all dependencies installed via Portage in one go. Yes, it doesn't always work perfectly---but even when it doesn't, it's usually easier than anything else. Maybe not easier than raw cpan(plus|minus)? but having your software know to the package manager (if only for easy checking and deinstallation) is always a Good Thing.