Discussion:
how to determine the file list for a spec file
Fulko Hew
2007-10-31 18:58:09 UTC
Permalink
I have a generic question...

If I have a project that I've inherited, and when I
run it's make install it scatters files all over the filesystem...

Is there an easy way of finding out what files went where,
in order to come up with the list of files to put into the %files section?

The project uses 'configure' and I thought I could adjust
the -prefix option to 'install' the project into a 'jail' directory
that I could just then scan, but the -prefix value tends
to be used inside the applications to 'know where they
were installed'. So after I've done my RPM packaging excercise
and installed the RPM, it still thinks its running in my jail
directory rather than the 'installed' directory.

There has to be an easy way!
How does everyone else do it?

TIA
Fulko
Bob Proulx
2007-10-31 19:06:27 UTC
Permalink
Post by Fulko Hew
If I have a project that I've inherited, and when I
run it's make install it scatters files all over the filesystem...
Oh fun...
Post by Fulko Hew
Is there an easy way of finding out what files went where,
in order to come up with the list of files to put into the %files section?
Look into 'checkinstall'. I have not personally used it but many
people report it as a good tool for this application.

http://www.asic-linux.com.mx/~izto/checkinstall/

I usually create two chroots, install in one, diff between the two
chroots, and determine what happened based upon that process. Of
course that works pretty well but may be more work than some people
want to put into things. I assume checkinstall makes this easier.
Post by Fulko Hew
The project uses 'configure' and I thought I could adjust
the -prefix option to 'install' the project into a 'jail' directory
that I could just then scan, but the -prefix value tends
to be used inside the applications to 'know where they
were installed'.
One: If it is a reasonable set of autotools then setting DESTDIR will
override the installation root. Look to see if that is available. If
so then that is definitely the better of the two things to set.

Two: There is configure time, build time, and install time. You can
probably configure normally but then at installation time override
prefix with 'make install prefix=/var/tmp/imagedir' and since
everything is already compiled and configured and only installation is
happening it should install into the prefix directory with everything
configured for the runtime directory.
Post by Fulko Hew
There has to be an easy way!
How does everyone else do it?
I always use %makeinstall in rpm spec files and ensure that the
system's %configure and %makeinstall are reasonable.

Outside of spec files I always use DESTDIR when possible.

Bob
Fulko Hew
2007-11-10 05:25:21 UTC
Permalink
Post by Bob Proulx
Post by Fulko Hew
If I have a project that I've inherited, and when I
run it's make install it scatters files all over the filesystem...
Oh fun...
Post by Fulko Hew
Is there an easy way of finding out what files went where,
in order to come up with the list of files to put into the %files
section?
... snip ...
Post by Bob Proulx
Post by Fulko Hew
The project uses 'configure' and I thought I could adjust
the -prefix option to 'install' the project into a 'jail' directory
that I could just then scan, but the -prefix value tends
to be used inside the applications to 'know where they
were installed'.
One: If it is a reasonable set of autotools then setting DESTDIR will
override the installation root. Look to see if that is available. If
so then that is definitely the better of the two things to set.
... snip ...

Thanks! That was the soulution I was looking for,
and what I thought I had with --prefix.

'--prefix' is the wrong answer to my problem,
and DESTDIR is the right answer.

Loading...