Mailinglist Archive: opensuse-buildservice (219 mails)

< Previous Next >
Re: [opensuse-buildservice] How to detect distribution with %if block in .spec file ??
  • From: "Ladislav Michnovič" <ladislav.michnovic@xxxxxxxxx>
  • Date: Fri, 1 Feb 2008 15:55:37 +0100
  • Message-id: <202bcdd90802010655t424af88bpfa04a5b4dcbeaafe@xxxxxxxxxxxxxx>
On Jan 29, 2008 4:45 PM, G. Massera <gmassera@xxxxxxxxxxx> wrote:
I want to put into the .spec file some block distribution-dependent...
so, it would very nice if is it possible to use the %if syntax to detect
the distribution and run the corrisponding block only on some distributions.
Of course, I can create name-Distro.spec file for each Distro... but
sometimes is more useful the %if syntax because there are somethings
that changes between Suse and Fedora ... but remains the same on all
Fedora (6,7,8)... so, instead of creating three .spec identically for
each version of Fedora, it would more easy to add just one block to
detect if is a Suse or Fedora distro.

I think you're looking for this:

%if %{defined suse_version}
%if %{undefined suse_version}
%if 0%{?fedora_version} < 5
%if 0%{?mandriva_version} > 2006

More information is on the wiki page

Regards Ladislav.
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages