Rpmbuild question.

Greg Swift gregswift at gmail.com
Fri May 4 20:04:43 UTC 2012

On Fri, May 4, 2012 at 2:39 PM, Jim Lynch <jim at fayettedigital.com> wrote:
> On 05/04/2012 11:32 AM, Jim Lynch wrote:
>> I am attempting to  generate an .rpm file from a spec file that works OK
>> on cents 4 and 5.  But fails miserably on 6.
> ...
> Thanks for all the advice.  I understand what's happening but it's a real
> pain to work around it.  I'm obviously going to have to add additional steps
> into my processes.  As is pretty obvious, I install to /usr/local/bin et al.
> Then test.  If all is well then do the build.  Now I'm going to have to
> install to /usr/local/bin test and copy to a build directory then build, or
> install to the build directory, copy to the system directory, test and then
> build or install to the build directory, build, install from the rpm and
> test (Ugh).
> I have a number of different applications all interconnected and somewhat
> dependent.  I attempted to put everything in a single directory tree, but
> rpmbuild doesn't like that.  If I accept the default tree structure then
> each time I change version/revision I'll be starting a new tree branch and
> have to come up with some way to weed out the old branches.
> I must say this complicates things a bunch.

That does sound very complicated.  Here is the standard workflow I use
on projects, which I copied from most of the open source projects I've

1: Store project in VCS
2: Along with the code for the project I store a build/install script
(what this is depends on language... ./configure, setup.py, etc) and a
3: To do non-packaged software tests use 'make build && make install'
(adjust as needed, such as not needing 'make build' for python, etc)
4: Makefile build sources distribution (tarball) which can be used as
Source0 in RPM spec via 'make sdist' - but I don't normally need to
call this directly.. its used by #6 below
5: The RPM spec file then utilizes the make script to deploy the
software into the build environment instead of doing it differently:
make install prefix=%{buildroot}/
6: To build RPM use 'make rpm'
7: Optional but recommended: have a 'make uninstall' to clean up any
manual installations

This process makes building new RPMs so easy I practically stopped
testing without RPMs.

More information about the Rpm-list mailing list