how to build a package from 'this' directory ?

Stuart D Gathman stuart at bmsi.com
Fri Jun 29 01:04:34 UTC 2012


On Jun 28, Fulko Hew transmitted in part:

> This is basically my first attempt at RPM-ifying my apps
> (for internal coprporate distribution)...
> 
> I'm probably doing this all wrong, but what I want to do is
> create a spec file that allows me to build an RPM based on
> the files in 'this' directory.
> 
> ie.
> 
> # cd /home/me
> # ls
> myapp myapp.rc myapp.spec
> # rpmbuild -bb myapp.spec
> 
> I would expect to have something in the spec file that
> copies the masters from the current directory into
> the build directory (and its sub-directories as required)
> so that the build process can complete.
> Something like this:

Yep.  Your doing it all wrong.  :-)

First, make a source archive.  List that source archive as Source:
Extract it in %prep (and any additional sources and/or patches).
The current directory for %build and %install is
$RPM/BUILD/pkgname-version, and the %setup macro extracts archives there
by default in the common tarball convention.

First, see if your spec extracts the source correctly with 
rpmbuild -bp myapp.spec

Then see if it builds with
rpmbuild -bc myapp.spec

Then test the install with 
rpmbuild -bi myapp.spec
   (add --short-circuit to avoid recompiling when just testing install)

Then do the whole enchilada with 
rpmbuild -ba myapp.spec


More information about the Rpm-list mailing list