← all posts

Announcing a new pair of projects: carefully and jan

carefully

I frequently need to install software that’s not packaged for installation by a package manager. I also frequently need to uninstall that software. Unfortunately, uninstalling unpackaged software is not always easy – make install is a familiar sight, but make uninstall is less common, and even when it’s there, you have no guarantee that it won’t do something terrible to your system.

If you, too, frequently need to install software which isn’t packaged for your package manager, and you don’t have the time or the inclination to learn the ins and outs of how to package software, and your package manager is dpkg, then you may be interested in carefully.

carefully runs make install (or any other install command) inside overlayfs, and keeps the filesystem changes it makes inside a separate directory tree. It then creates a template Debian control file and opens it in your editor, and uses dpkg-deb to build a Debian package from the captured files and the metadata you’ve provided. You can then use any dpkg-based package manager to install your software, in a way that makes it easy to uninstall later.

carefully is currently fairly rough-and-ready. It doesn’t perform any checks on the package produced, so you will probably want to run lintian on the packages created, and check over the captured directory tree to make sure that no extra files have been captured (for example: overlayfs seems to eagerly copy_up processes’ working directories, so assuming you build software somewhere in /home, you’ll probably want to remove .carefully/pkg-data/home).

If you’d like to try carefully out, check out the project page.

jan

carefully needed some way of observing what files are created by make install. checkinstall uses a program/library called installwatch to do this, which works by replacing common file-handling functions using an LD_PRELOAD library; this kind of works, but it’s a labour-intensive way of doing it, and it doesn’t work at all with statically-linked binaries. I wrote an installwatch replacement called jan, which uses Linux’s overlayfs to redirect filesystem modifications to an isolated directory tree.

overlayfs has its quirks, but it’s certainly good enough for my purposes. I can envision jan being useful for other projects besides carefully, hence my decision to package and distribute it separately.

If you’d like to build something using jan, check out the project page.