[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Newbie Question



On Thu, Jul 11, 2002 at 09:09:37AM -0700, David Keyes wrote:
> Hi,
> 
> I am trying to build my first rpm. Could someone explain how the
> %files section of a spec file relates to the files that are extracted
> in the %prep section. 
> 
> i.e. after the source files (which are all scripts) are tarred & ziped
> and put in /usr/src/redhat/SOURCES do you have to list each file
> within the tarred file ?

I think you have the wrong idea about what is going on here.

A source rpm (srpm) contains the spec file and some tar'ed or bzip'ed
source files and (possibly) some patch files.

Then, as part of building the binary rpm, the %prep phase untars the
pristine sources and applies the patches. The %build phase builds
everything. The %install phase then does a pseudo-install of everything
with a prefix of ${_buildroot} (usually /var/tmp/<something>).

Finally, the %files list is examined to see which files to extract from
under the build root to put into the binary rpm (with the build root
prefix stripped off them -- so things that %install put into
/var/tmp/foo/usr will end up in /usr in the final install, etc).

So the files in the %files section relate the finally installed files
after the package is built and are not directly related to the files in
the source tarballs or patches.

Hope this clarifies some things.

Cheers,
Malcolm





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []