RFC: auto install C (and other) deps on OS level

chorny on 2009-07-31T08:49:29

I'd like to allow distributions to specify dependencies on OS packages (OS name, for ex, Debian => OS package, for every OS). For ex., for XML::Parser: { 'Fedora' => 'expat-devel', 'Debian=>'expat-devel-debian-name', }.

Steps to implement this: 1. Research if deps names change in different OS versions. 2. Finish Linux::Distribution changes. 3. There are several CPAN modules to interface package managers: Linux::APT, RPM, RPM2, RPM4. Slackware::Slackget is a package manager. Try several of them and patch/rewrite if necessary. 4. Write a general module to interface them, with Linux dist detection by Linux::Distribution. It can be named Package::Installer. 5. As experiment, write Module::Install plugin that will ask to install OS package if Package::Installer is installed. Use `sudo` if user is not root. 6. Teach CPAN/CPANPLUS to do it. List of deps can be written in JSON file.

Advantages of this idea: 1. Easier installation of modules. And it would be more clear why install failed. 2. Better and more useful cpantesters results.

Future possibilities 3. More full implementation of automatic CPAN -> package converters (requires separation between work and build deps). 4. Teach CPAN/CPANPLUS to install modules from OS package repository. 5. Maybe it can also work on Win32, but it requires additional research.

P.S. It just came to my mind, that CPAN -> package dependencies can also be stored in some web DB edited by users.


A external dependency data structure proposal

srezic on 2009-07-31T20:02:20

ad 1: Yes, they do. Once I setup a yaml file to keep the names of all
non-perl dependencies for some application. It looked roughly like
this:

    - pngcrush

    - jpegtran:
            debian:
                - libjpeg-progs
            redhat:
                - libjpeg
            cygwin:
                - jpeg

    - netpbm:
            debian:
                - "netpbm-progs (>= 10.26.54-5)"
                - "netpbm (>= 2:10.26.54-7)"
            redhat:
                - "netpbm >= 10.26.39"

So if you're lucky, then the package is called everywhere the same.
Sometimes it's everywhere called completely different. Sometimes in
one distribution some software components consists of one and in
another of multiple packages. Sometimes you have to specify versions
(I just used here the .deb resp. .rpm version syntaxes).

I did not have the need to differentiate between various distribution
versions, but I guess that there will be the some edge case when one
has to specify different package names or versions for debian/lenny
vs. debian/etch.

ad 6: Why not put it into META.yml? Perl dependencies are already
there, why not OS dependencies?