Article:
  Excerpt from Linux Cookbook, Part 1
Subject:   Some Corrections
Date:   2004-12-26 02:57:38
From:   trb
Response to: Some Corrections

In most cases 'make install DESTDIR=/some/dir' is really the best way to do this. Once you make your list (find /some/dir | sed 's!^/some/dir!!' > file-list), you just 'make install' again and everything goes where it's really supposed to. No muss, no fuss.


In cases where that doesn't work I can think of all kinds of suboptimal-but-still-better ways to do it besides finding and grepping (twice!) the whole file system, including using a union mount to direct all the newly-installed files to a scratch filesystem or doing one build with './configure --prefix' set to a scratch directory to make your list and then building the package again without the (or with a different) --prefix option.


There are so many ways of doing this that are quicker, easier, and work better, that I think "brain dead" is a pretty good label in this case.


Ultimately, of course, if your OS uses package management, it's smarter to just build your own packages and let the helper scripts/apps worry about making a file list. Package management eases system maintenance and upgrading by a huge margin, especially when you have to manage multiple systems.


Plus in the case of distros like Gentoo and Red Hat (and just about everything else), where you have things like .spec and .ebuild files that script your build process, you're essentially documenting how to build the package while you're actually doing it, forcing you to take a step you should be taking anyway to make upgrading to future versions of the same software as painless as possible.