[opensuse-buildservice] conditions in prjconf meta
Hi BS hackers, I have two issues which I tried to solve with prjconf updates in a 'downstream' project (so not on distribution level). One is for some additional Substitutes of names between openSUSE and others (which often have it similiar, due to equal roots). So I tried to do something like: %if 0%{?fedora_version} || 0%{?rhel_version} || 0{?centos_version} Substitute: openSUSEName OtherName %endif this construct seems never to evaluate true if the fedora_version is not set (so || seems not to be evaluated correctly). The second issue I had was with Macros: I tried to make Macros based on the distribution, so something like: Macros: %if 0%{?fedora_version} %define simplemode 1 %endif But this results in %if can't be defined or other strange errors. also this did not work: %if 0%{?fedora_version} Macros: %define simplemode 1 %endif A usecase here was that I wanted to %define %py_requires for Fedora and other's that don't know about it. Looking forward for pointers! Dominique -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Gah! Why doesn't the list set reply-to headers?
On Thu, Jun 10, 2010 at 6:39 PM, Dominique Leuenberger
Hi BS hackers,
I have two issues which I tried to solve with prjconf updates in a 'downstream' project (so not on distribution level). One is for some additional Substitutes of names between openSUSE and others (which often have it similiar, due to equal roots).
So I tried to do something like:
%if 0%{?fedora_version} || 0%{?rhel_version} || 0{?centos_version} Substitute: openSUSEName OtherName %endif
this construct seems never to evaluate true if the fedora_version is not set (so || seems not to be evaluated correctly).
I've never bothered with the || - just concatenating a bunch of macros works fine %if 0%{?fedora}%{?rhel_version}%{?centos_version} Substitute: susename redhatname %endif
The second issue I had was with Macros: I tried to make Macros based on the distribution, so something like:
Macros:
%if 0%{?fedora_version} %define simplemode 1 %endif
Yeah, %if doesn't seem to work in Macros section. I ended up once with things like %define simplemode %{?fedora:1}%{!?fedora:0} or nastier, %define what_is_this %{?suse_version:its_suse}%{!?suse_version:%{?fedora:its_fedora}%{!?fedora:its_something_else}}
A usecase here was that I wanted to %define %py_requires for Fedora and other's that don't know about it.
Maybe %define py_requires %{!?suse_version:whatever the py_requires needs to be} -- Iain. -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (2)
-
Dominique Leuenberger
-
Iain Arnell