per package BuildRoot does not work

Jason Pyeron jpyeron at
Wed Jun 8 12:30:59 UTC 2011

> -----Original Message-----
> From: rpm-list-bounces at 
> [mailto:rpm-list-bounces at] On Behalf Of Marten Lehmann
> Sent: Tuesday, June 07, 2011 17:55
> To: General discussion about the RPM package manager
> Subject: per package BuildRoot does not work
> Hello,
> I created a spec file which generates two sub packages and no 
> main package, e.g. the specfile is called service.spec and 
> creates the packages service-standard and service-premium. 
> Only one of both packages may be installed at a time, I added 
> an according "conflicts" section in each package definition 
> and the files in their location in the file system are 
> identical, just compiled with different options.
> As really everything is identical in the spec file for those 
> two service options besides a single parameter change, I 
> don't want to build two different spec files. I want that 

Why? I sounds to me you are building 2 different packages. Are you concerned
with tracking the updates to both files, if so use scripts that are part of the

> both packages are created with one rpmbuild call without 
> passing any special parameters or ENV variables to rpmbuild.
> Well, everything works fine, except for one point: It seems 
> that I cannot specify a different BuildRoot for each package?!
> I know the basic usage of packages, e.g. for mysql where a 
> huge build creates lots of files and each of them later 
> belongs to one certain package like "libs", "server" or "devel".
> My case is different: In the buildroot there are sub 
> directories "standard" and "premium" which in turn contain 
> the identical structures and files, just compiled differently.
> Example:
> /var/tmp/buildroot/standard/etc/myservice.conf
> /var/tmp/buildroot/premium/etc/myservice.conf
> The files section just references the files wanted, ie.
> %files standard
> /etc/myservice.conf
> %files premium
> /etc/myservice.conf
> Now how do I tell rpmbuild to use the buildroot 
> /var/tmp/buildroot/standard for the standard package and 
> /var/tmp/buildroot/premium for the premium package?
> I tried to not specify a global "BuildRoot" but directly in 
> each %package section. But rpmbuild just takes the first 
> occurence and uses it globally and ignores the second. So I 
> get dozends of "error: File not found:" errors.
> How can I rewrite the %files macro to use a different buildroot?
> I'm using rpm-build-4.3.3-33_nonptl.el4_8.1 on RHEL4.8.
> Kind regards
> Marten
> _______________________________________________
> Rpm-list mailing list
> Rpm-list at

-                                                               -
- Jason Pyeron                      PD Inc. -
- Principal Consultant              10 West 24th Street #100    -
- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
-                                                               -
This message is copyright PD Inc, subject to license 20080407P00.


More information about the Rpm-list mailing list