xpkg: Generic Package Managment Software
Many projects benefit from package-based distribution with dependencies. Famously, Perl has CPAN and Debian has apt. It can be argued these two projects are alive and successful because of CPAN and apt. Various packages can be downloaded from central server package repositories and installed on a local machine. If one package has declared dependencies on other packages then those other packages are installed also. Many package management systems are quite similar and it would make sense if they could use the same package management software on the client and sever.
xpkg is just such a bunch of generic package management tools. I've extracted these tools from the xjs project and these tools will be able to work on the client and server for any project that could benefit from package distribution on any operating system. Think of things like a central emacs extensions repository, a central C library repository, a central anything plugin repository. There are plenty of projects that could benefit from package-based distribution and a central package repository but cannot justify writing the software to manage the packages on the client or server. xpkg to the rescue.
Here is how it will work on a UNIX-like system.
First, install the generic xpkg package management client software.
curl -O http://xpkg.michaux.ca/releases/XPKG-0.01.tar.gz
tar xvzf XPKG-0.01.tar.gz
cd XPKG-0.01
perl Makefile.pl
make
sudo make install
Second, set up a "package set" named ourcobol to manage system-wide Cobol packages. (Note this is an example. The sources don't actually exist.)
sudo xpkg create ourcobol \
source=http://cobol.org/packages \
source=https://mycompany.com/internal_cobol_packages \
architecture=cobol85 \
architecture=cobol \
libdir=/usr/local/lib/cobol \
bindir=/usr/local/bin
Third, install the cobol-on-rails public package, the company-specific get-rich-quick code and all their dependencies in the ourcobol package set.
sudo xpkg install ourcobol cobol-on-rails
sudo xpkg install ourcobol get-rich-quick
Easy.
Suppose just one system user, sue, would like to manage her local emacs extensions from some central repository with a package set sue-emacs.
xpkg create sue-emacs \
source=http://emacs-packages.com/packages \
libdir=/home/sue/.elisp
xpkg install sue-emacs snippets
Many package sets, all with their own configuration variables/installation directories, can be managed on the same system by a single xpkg install.
I'm currently writing an xpkg implementation in Perl. Other xpkg implementations could be written in Lisp, C, Python or Java, for example, but Perl happens to be a perfect fit for this project. I never quite thought I'd be excited about Perl for anything but it really does suit this project well. Since Perl is on virtually every UNIX-like system already and can work on Microsoft Windows (from what I understand) it keeps the apparent installation cost low. The only other "neutral" language option was C and that really seems like development overkill as Perl does all the necessary things for package management.
xjs is distributed completely through xpkg. This removes a great deal of complexity from the xjs project as it doesn't have to bootstrap itself to run its own package management system written in JavaScript. I've talked a bit with the folks from the Helma NG project. They seem interested in having a drop-in package management system. I'm looking for other projects that would also be interested in having free and easy package management software to ensure the xpkg code is general enough for their needs. If you are interested please leave a comment below.
Comments
Have something to write? Comment on this article.
Maybe will you use 'XPKG':XPKG as a package description format? It may not give you currently all needed features, but I will be happy to add them.
LEW21, This blog software didn't seem to like your formatting. I saw the link was XPKG.
Namespace collision. Oops.
Do you have any documentation about how the developer workflow goes for installing an client, building a package and installing packages with your tools?
My XPKG is only a format, it doesn't provide any tools currently. I'm working on XPKG packages editor (in C++ and Qt so it will be portable), and I plan to create a web-based package manager for webapps, but I don't plan to create a normal package manager.
LEW21, What do a "XPKG packages editor" and a "a web-based package manager for webapps" do as opposed to a "normal package manager"?
XPKG editor, as the name suggests, will be a tool for creating and editing XPKG packages. It's for package developers, not for normal users.
Web-based package manager for webapps will be an package manager written mainly in JS, with parts related to editing files or saving some data written in PHP. It's designed for installing modifications for webapplications, like phpBB MODs.
Normal package managers, like apt/aptitude/zypper, are much better solution for normal, not web-based applications, because user doesn't have to run a webserver to use them, and he can use them from command line. However, I can't write everything, so I only plan to create XPKG editor and web-based package manager.
Have something to write? Comment on this article.
feed
It's what xkcd would be called if it were a package manager instead of a webcomic.