Auto-DESTDIR

This is the main web site for Auto-DESTDIR, a set of programs for POSIX/Unix/Linux systems that helps automate program installation from source code. The Auto-DESTDIR tools (run-redir and make-redir) redirect file installations so that the installed files are placed inside the the $DESTDIR directory, even if the provided programs or “makefile” doesn’t support the DESTDIR convention. In most cases you can replace “make install” with “make-redir DESTDIR=xyz install”, and suddenly the DESTDIR environment variable will be implemented, allowing you to store files in a different place than where they run from — even if the original makefile doesn’t support DESTDIR. It will even automatically create directories as necessary (e.g., if $DESTDIR/usr/bin doesn’t exist, and a program tries to copy a file into /usr/bin/somename, then Auto-DESTDIR will automatically create the directory $DESTDIR/usr/bin and then copy the file into $DESTDIR/usr/bin/somename). Auto-DESTDIR is released under the “MIT” license, so it is Free-libre/open source software (FLOSS).

Below is a longer explanation on why supporting DESTDIR is useful, user testimonials, how it works, future directions, and downloadables (including documentation).

Why is supporting DESTDIR useful?

Many programs for Unix/Linux are provided as source code; they must be configured, built, and installed, and that last step is normally performed by typing “make install”. The “make install” step normally writes directly to privileged directories like “/usr/bin” to perform the installation. Unfortunately, because of security concerns and other issues, this is often no longer permitted. The DESTDIR convention resolves this, but only (til now) if programs supported it.

Why is supporting DESTDIR important? Here are two examples:

User testimonials

"Great set of bash scripts, would be very hard to write my port manager without it... Love the program man, working great." - Matthew Reschke

How it works

Auto-DESTDIR is implemented using a set of bash shell scripts that wrap typical install commands (such as install, cp, ln, and mkdir). These wrappers are placed in a special directory. The run-redir command modifies the PATH so that the directory with these scripts is listed first, and then runs the given command. The make-redir command invokes “make” using run-redir, along with some extra settings to simplify things. For more information on this approach, and why this is a good way to automate DESTDIR, see the paper Automating DESTDIR, especially its section on wrappers. Yes, this is an odd way to solve the problem. But other “technically correct” solutions turn out to have serious problems that make them “not work” in practice. This approach is small, easy to understand, highly portable, and reliable (since it’s not sensitive to race conditions and small architectural changes); in short, it works in “real life”. Some advantages of this approach, compared to the “obvious” approaches, are that:

Future directions

My hope is that auto-DESTDIR will be a helpful step toward one-click installation of most programs directly from source code on typical Unix/Linux systems. There are lots of useful programs out there for Unix and Linux, and programs like toast help make them easy to install, but little awkwardnesses like failure to support DESTDIR make it difficult to automate installation. Hopefully this tool will make it easier to automate the whole process.

You might also be interested in the related user-union (a union filesystem for unprivileged users). I'm designing user-union so that it can work together with auto-destdir.

Downloads available

You may:

The older Version 1.0 is also available though for most people will want the current version.

You can also view my home page.