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

Re: rpmbuild command line override spec file %define



Jos Vos wrote :

> On Mon, May 22, 2006 at 10:09:57AM +0200, Christian Joensson wrote:
> 
> > darn, I was afraid that that was the case...  just to conclude, I
> > would have needed it, but I guess that's the rpm ideal, everything in
> > the spec file, not much command line or environment settings that
> > override the spec file. is this perception of mine
> 
> You can not override the spec file, but you can still replace
> 
>    %define build_ada 1
> 
> in the spec file by something like
> 
>    %define build_ada %{?my_build_ada}%{?!my_build_ada:1}
> 
> (untested), which would mean that "1" is taken when you don't
> define "my_build_ada", or the value of %{my_build_ada} when you
> define it on the command line with
> 
>    --define 'my_build_ada 0'
> 
> As said, it's untested, as I'm not sure about whether the
> evaluation of %{?!my_build_ada:...} actually works when the
> value is zero.

The cleanest is probably :

%define build_ada 0%{!?_without_ada:1}

Which will evaluate to 01 if you don't have _without_ada and to zero if
you do have it defined.

To disable ada you then just pass "--without ada" to rpmbuild, and ada
being enabled still is the default.

Matthias

-- 
Clean custom Red Hat Linux rpm packages : http://freshrpms.net/
Fedora Core release 5.89 (Rawhide) - Linux kernel 2.6.16-1.2208_FC6
Load : 2.15 2.14 1.73


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