How do I define a spec variable in the project conf?

Is this even possible?
I want to branch a certain package Mesa cough cough from Factory and change a variable in the spec file, but I also don’t want to edit the spec file with each new update. I already looked inside the documentation, but it didn’t really help me at all.
So the spec file looks something like this (note that the VAR_TO_BE_DEFINED is not defined inside the spec file)

%if 0%{?VAR_TO_BE_DEFINED}
%define another_var 1
%else
%define another_var 0
%endif

I tried these methods in my prjconf

Macros:
    %VAR_TO_BE_DEFINED 1
DistMacro: VAR_TO_BE_DEFINED 1
%define VAR_TO_BE_DEFINED 1

but all resulted in the same builds as the Factory build.

When I define the variable in the spec file, then it builds as I want it to, so I know what to look for in the build logs. I just can’t seem to change anything through the prjconf.

This shouts “SUSPICIOUS” in all languages and smells “ILLEGAL” likewise. And, goes against everything ethical in open source IMNSHO.

In your project config %define BUILD_ORIG 1 but if you don’t have all the supporting packages for a “BUILD_ORIG” then it won’t work… and you can’t do that on the Open Build Service…

Check the constraints file as well…

I found another project where they put this in the project config

Macros:
%VAR_TO_BE_DEFINED 1
:Macros

and tried it one more time, which succeeded for some reason. I was 99% sure I also tried it like this, but maybe I wasn’t patient enough and the build process got confused. Anyway, this is solved now, thanks for being good sports about it. :beers:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.