Managing Unpackaged Packages, or “What’s this ‘importare’ thing?”
There’s a problem that most Linux distributions don’t solve well: what do you do when there’s no package available for something you want to install? For Gentoo, for example, your options are generally:
- Installing it by hand. Then, when it comes to upgrading or removing it, realising you’re stuck with either nothing at all or autotools’ broken ‘make uninstall’ support. And realise that your depclean / uninstall-unused is broken unless you add dependencies of that package to world, even if you don’t really care about the dependencies.
- Whining “how do I get an ebuild for this package that me and two other people use into the tree?” repeatedly until you give up.
- Writing a really bad (no USE flags, no reliability checking, bad deps and so on) ebuild that works for yourself, and putting it in a local overlay.
- Spend ages writing a good ebuild, and hopefully putting it into a public overlay where it can be neglected once you realise that you don’t really want the package after all, despite having spent three days installing it.
This is even more of an issue for Exherbo, where one of the stated goals is to avoid having packages for things not used by a lot of people (but this isn’t a problem, as we’ll see).
A similar problem is how to handle manual installs of, say, svn or git packages when there’s no scm ebuild available. Either you spend ages making an scm ebuild (possibly for a one-off bug fix test) or you install outside of the package manager and hope for the best (and cry when you have things depending upon that package).
Paludis provides a different solution: importare. This little toy is a tool for using the package manager to install a package where no ‘package’ (ebuild / exheres / rpm / deb / whatever) is available. Specifically, it provides for:
- Clean upgrades and uninstalls of the package.
- Dependency tracking for the package.
- Ability to use that package to satisfy dependencies of other properly-packaged packages.
- Querying packages that have been installed that way, including content queries (’what provides /bin/foo’?)
To use importare, you need an installed-unpackaged repository. You can’t use an existing VDB or Exndbam repository for tracking installed packages because there’s considerable difference metadata-wise between Ebuild or Exheres generated installs and importare-generated installs. A Paludis repository config file would look something like:
format = installed_unpackaged location = /var/db/paludis/repositories/installed-unpackaged
Then, make an image of what you want to install under some directory. For autotools packages, you can just do make DESTDIR=/path/to/some/tmpdir install. Other build systems provide a similar option.
Install this image using importare --location /path/to/the/tmpdir category-name/package-name version slot, where:
category-name/package-nameis what you want to call the installed package. If you’re going to use the package to satisfy dependencies, use the same name as the repository package (app-misc/whatever, for example). If not, you might want to useunpackaged/whatever.versionis the package version. If unspecified,0will be used. You can usescmfor scm packages.slotis the package slot. If unspecified,0will be used.
Then you can clean up your temporary directory.
One small caveat: Paludis 0.26 doesn’t realise that it should do an install-uninstall rather than just an install if you install to an installed-unpackaged repository when you have an identical package-slot in a vdb or exndbam repository. If you’re replacing something ebuild-installed or exheres-installed with something importare-installed, you’ll have to tell Paludis to uninstall the previous package afterwards.
A few more options:
--install-under /foowill install toROOT/foorather thanROOT/. This is useful if you’re dealing with packages that are just ‘untar into this directory’.--descriptioncan be used to provide a description. This will show up in--queryand the like.--build-dependencyand--run-dependencycan be used to specify dependencies (both can be provided multiple times). The parameter is a standard package dependency string.--preserve-metadatawill copy descriptions and dependencies from a previous importare-installed package that is being replaced by this install.
kloeri announces Exherbo, another source based Linux distribution…
Bryan Østergaard (aka kloeri) announced Exherbo today. He assembled a team of (ex-)Gentoo developers including Ciaran McCreesh (ciaranm), Richard Brown (rbrown), Fernando J. Pereda (ferdy) and Alexander Færøy (eroyf) to build a new source based Li…
Trackback by Daniel Lange's blog — May 23, 2008 @ 6:09 am