Mailinglist Archive: opensuse-buildservice (232 mails)

< Previous Next >
Re: [opensuse-buildservice] Is there a macro for the release?
  • From: Antonio Cavallo <a.cavallo@xxxxxxxxxxxxx>
  • Date: Mon, 23 Apr 2012 22:38:31 +0100
  • Message-id: <6663389.pR7ZTvSrhh@master>
On Monday 23 Apr 2012 17:23:54 Robert Schweikert wrote:

Dealing with a source tree that has distribution dependence backed right
into the build setup. It looks for /etc/*-release.

Is there a way for me to have a requires that install the appropriate
release package?

When I add:

%if %sles_version >= 11
BuildRequires: sles-release
%if 0%{?suse_version}
BuildRequires: openSUSE-release

It obviously fails as SLE also returns true for suse_version and then of
course the openSUSE-release package cannot be found.

What's the best way to deal with this?


Try this while dealing with sles/opensuse (at the begin of your .spec):

# This define a opensuse_version tag to differentiate
# between suse and suse enterprise linux
%if 0%{?suse_version} && ! 0%{?sles_version}
%define opensuse_version %suse_version

Then later you can check as:

%if 0%{?opensuse_version} == 1120
Buildrequires: freetype2

To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-buildservice+owner@xxxxxxxxxxxx

< Previous Next >