Package Management – Creating a Wrapper for Package Managers

cpanpackage-managementsetuptools

There are a lot of language-specific package managers like cpan for perl, cabal for haskell etc. When we want to install some software, it can sometimes be installed from a corresponding repo, with installation instruction just like (say, Yaxy) npm install yaxy or cpan something or cabal install something.

These package managers have slightly different syntaxes, they all need root privileges and/or custom setup, or (in case of Yaxy) just a newer version of interpreter (nodejs packaged by Ubuntu was too old to run it).

Is there a wrapper for different package managers that unifies/automates setup for different package managers?

Edit: what I want is a way to execute installation command like that npm install yaxy and make it working without manual installing system npm+nodejs, getting non-functional executable, finding the simplest way to install fresher nodejs on my system, reinstalling…

Best Answer

The closest thing I've seen to what you're asking for is a project I found a while back on github called fpm. Stands for Effing Package Manager.

Sources:

  • gem (even autodownloaded for you)
  • python modules (autodownload for you)
  • pear (also downloads for you)
  • directories
  • rpm
  • deb
  • node packages (npm)

Targets:

  • deb
  • rpm
  • solaris
  • tar
  • directories

The app fpm is a Ruby gem so you install it like so:

$ gem install fpm

Once installed you can build a package as follows:

 $ fpm -s <source type> -t <target type> [list of sources]...

OS Package Managers vs. Programming Language Managers

I would caution you in thinking of these as both package managers. OS packages are necessary to manage applications, but programming languages such as Perl, Ruby, and Python can be managed completely independent from the OS with tools such as:

None of the above programming language package managers require to be run as root. You can if you want to, but in general they manage both the base installation of the programming language in addition to any addon modules, gems, etc. that you install too. This is really the most appropriate way to manage programming languages such as these, especially if they're being setup on a system for a particular application's use.

For more examples see my answers to previous U&L questions where I've covered the programming language package managers:

Related Question