automake: DESTDIR
1
1 2.2.10 Building Binary Packages Using DESTDIR
1 ---------------------------------------------
1
1 The GNU Build System’s ‘make install’ and ‘make uninstall’ interface
1 does not exactly fit the needs of a system administrator who has to
1 deploy and upgrade packages on lots of hosts. In other words, the GNU
1 Build System does not replace a package manager.
1
1 Such package managers usually need to know which files have been
1 installed by a package, so a mere ‘make install’ is inappropriate.
1
1 The ‘DESTDIR’ variable can be used to perform a staged installation.
1 The package should be configured as if it was going to be installed in
1 its final location (e.g., ‘--prefix /usr’), but when running ‘make
1 install’, the ‘DESTDIR’ should be set to the absolute name of a
1 directory into which the installation will be diverted. From this
1 directory it is easy to review which files are being installed where,
1 and finally copy them to their final location by some means.
1
1 For instance here is how we could create a binary package containing
1 a snapshot of all the files to be installed.
1
1 ~/amhello-1.0 % ./configure --prefix /usr
1 ...
1 ~/amhello-1.0 % make
1 ...
1 ~/amhello-1.0 % make DESTDIR=$HOME/inst install
1 ...
1 ~/amhello-1.0 % cd ~/inst
1 ~/inst % find . -type f -print > ../files.lst
1 ~/inst % tar zcvf ~/amhello-1.0-i686.tar.gz `cat ../files.lst`
1 ./usr/bin/hello
1 ./usr/share/doc/amhello/README
1
1 After this example, ‘amhello-1.0-i686.tar.gz’ is ready to be
1 uncompressed in ‘/’ on many hosts. (Using ‘`cat ../files.lst`’ instead
1 of ‘.’ as argument for ‘tar’ avoids entries for each subdirectory in the
1 archive: we would not like ‘tar’ to restore the modification time of
1 ‘/’, ‘/usr/’, etc.)
1
1 Note that when building packages for several architectures, it might
1 Two-Part Install::) to gather architecture-independent files in a single
1 package.
1
1 ⇒Install, for more information.
1