Mailinglist Archive: opensuse-buildservice (232 mails)

< Previous Next >
Re: [opensuse-buildservice] Is there a macro for the release?
On Mon, Apr 23, 2012 at 05:23:54PM -0400, 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
%endif
%if 0%{?suse_version}
BuildRequires: openSUSE-release
%endif

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?

From our Samba spec file:

%if 0%{?ul_version} >= 1
%define VENDOR UL
%else
%if "%{_vendor}" == "suse" || "%{_vendor}" == "redhat"
%define VENDOR SUSE
%else
%define VENDOR %_vendor
%endif
%endif

...

if test "%{VENDOR}" != "UL"; then
if test 0%{?sles_version} -gt 0; then
product_suffix="-SLES%{sles_version}"
elif test 0%{?suse_version} -gt 0; then
product_suffix="-SL${product_version}"
else
product_suffix="-OBS"
fi
case "%{?suse_version}" in
1010|1110) product_suffix="-CODE${major_version}" ;;
esac
fi

I'm sure this is not the most elegant solution. But tioll now it worked
quite well.

By this smbclient on openSUSE reports:

lmuelle@hip:~> smbclient -V
Version 3.6.4-98.2-2784-SUSE-SL12.1-x86_64

While on SLE Server 11 SP 1:

larsm@kobenhaven:~> smbclient -V
Version 3.6.3-0.18.3-2749-SUSE-CODE11-x86_64

Ok, the SL suffix might no longer fit as well as many years back.

Is oS like openSUSE ok or is this an abbreviation which might offend
people?

Cheers,

Lars
--
Lars Müller [ˈlaː(r)z ˈmʏlɐ]
Samba Team + SUSE Labs
SUSE Linux, Maxfeldstraße 5, 90409 Nürnberg, Germany
< Previous Next >
References