[opensuse-packaging] RPM condition
Hello, can somebody help me in writing %if %{undefined rhel_version} && %{undefined centos_version} # code %else # code %endif in a way that the build in the OBS / SUSE_Linux_10.0 succeeds? I currently get a parser error. Thanks for your help. Bernhard --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 3/18/2008 at 17:45, Bernhard Walle <bwalle@suse.de> wrote: Hello,
can somebody help me in writing
%if %{undefined rhel_version} && %{undefined centos_version} # code %else # code %endif
in a way that the build in the OBS / SUSE_Linux_10.0 succeeds? I currently get a parser error. Thanks for your help.
you could simply use something like %if 0%{rhel_version}%{centos_version} == 0 #code %else #code %endif This should even work in OBS. But a suggestion for general coding practice: try not to negate questions like not RHEL and not Centos. why not asking if RHEL or Centos, then do something? Is normally much easier to achieve and to read later on. Dominique PS: no warranty on whatsoever.. I did not test this snipplet and I am not sure about the variables for rhel_version and centos_version (but they can easily be found in the obs projects config file normally). --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 2008-03-18 16:45:20 +0100, Bernhard Walle wrote:
can somebody help me in writing
%if %{undefined rhel_version} && %{undefined centos_version} # code %else # code %endif
in a way that the build in the OBS / SUSE_Linux_10.0 succeeds? I currently get a parser error. Thanks for your help.
if ! 0%{?rhel_version} || %{?rhel_version} darix -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
* Marcus Rueckert [2008-03-18 17:05]:
On 2008-03-18 16:45:20 +0100, Bernhard Walle wrote:
%if %{undefined rhel_version} && %{undefined centos_version} # code %else # code %endif
if ! 0%{?rhel_version} || %{?rhel_version}
%if 0%{?rhel_version} || 0%{?rhel_version} actually (for the archive...). Thanks for the hint! Bernhard --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
* Bernhard Walle [2008-03-18 19:33]:
* Marcus Rueckert [2008-03-18 17:05]:
On 2008-03-18 16:45:20 +0100, Bernhard Walle wrote:
%if %{undefined rhel_version} && %{undefined centos_version} # code %else # code %endif
if ! 0%{?rhel_version} || %{?rhel_version}
%if 0%{?rhel_version} || 0%{?rhel_version}
*arg* Also wrong of course... Not my day. Bernhard --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 2008-03-18 19:38:42 +0100, Bernhard Walle wrote:
*arg* Also wrong of course... Not my day.
yeah a centos_version somewhere might be good. =) -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Marcus Rueckert napsal(a):
On 2008-03-18 16:45:20 +0100, Bernhard Walle wrote:
can somebody help me in writing
%if %{undefined rhel_version} && %{undefined centos_version} # code %else # code %endif
in a way that the build in the OBS / SUSE_Linux_10.0 succeeds? I currently get a parser error. Thanks for your help.
if ! 0%{?rhel_version} || %{?rhel_version}
For the record: 10.0 had an old rpm version where the %defined() and %undefined() macros weren't available. Michal --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (4)
-
Bernhard Walle
-
Dominique Leuenberger
-
Marcus Rueckert
-
Michal Marek