[Gllug] Getting a rpm file list

Dave Cridland dave at cridland.net
Wed Oct 31 12:33:16 UTC 2001


On Wed, 2001-10-31 at 11:40, Bruce Richardson wrote:
> > Can anyone point me to a utility/how-to that will let me generate a
> > files list for rpm from the old configure,make ,make install process.
> 
> If it's gnu make (should be) it has an -n option, which prints out the 
> commands but doesn't execute them.  So
> 
> make -n install

Or alternatively, if you're using a build root (which you should be,
really), then build the RPM, with an empty file list, then do something
like:

find <build root>

You'll get a list of everything that was created.

Now, anywhere that make install created a brand new directory for, just
put in the directory (all files within get added automatically, unless
you stop it). Anywhere where extra files were added to preexisting
directories, put in the filename.

You could probably knock together a shell script to handle this really
easily, and dump out the %files section of the SPEC file, which you can
then import in from within the SPEC itself, although you'd probably need
a specific RPM build machine to handle this neatly.

That should get you everything you want.

You probably want to add %doc or %docdir macros for the documentation
which is left in the BUILD_DIR as well. Note that RPM pulls this out of
the BUILD_DIR, not the BUILD_ROOT.

The only other gotcha is where the make install process changes a
preexisting file, but I leave that as an excercise to the reader.

Generally, this is a matter for doing some custom stuff in the %post and
%preun.

Dave.


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list