bilke/hooq — comment on commit 70e1db58ad624b976f39f352b976e6dea8ffa21f
File:  line 0
By artm:

**DESTDIR** is a convention used by various package builders (e.g. on a Mac [fink] / [macports], not sure if [homebrew] uses it). The idea is that the package builder does the usual build steps like (assuming /sw prefix like in fink):

```
./configure --prefix=/sw
make
```

So e.g. shared libraries know they are destined to end up in **/sw**. Knowing actual installation prefix at build time is important if binaries get linked to each other while uninstalled). But instead of normal `make install` it would supply a DESTDIR on make command line:

```
make install DESTDIR=/tmp/package-destination/
```

so the software gets temporarily installed under **_/tmp/package-destination_/sw** and the built binaries can easily be packaged in whatever package format the system uses, e.g. with a dumb archive format something like:

```
cd /tmp/package-destination/sw
tar czf package.tar.gz *
```

The installer then can easily put the files in the right place by reversing the last step:

```
cd /sw # <<< note the final destination
tar xzf package.tar.gz
```

For more theory, see short section on **DESTDIR** in the [GNU Makefile conventions][gnu].

[fink]: http://www.finkproject.org/
[macports]: http://www.macports.org/
[homebrew]: http://mxcl.github.com/homebrew/
[gnu]: http://www.gnu.org/prep/standards/html_node/DESTDIR.html