[opensuse-buildservice] Is there a macro for the release?
Hi, 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? Thanks, Robert -- Robert Schweikert MAY THE SOURCE BE WITH YOU SUSE-IBM Software Integration Center LINUX Tech Lead rjschwei@suse.com rschweik@ca.ibm.com 781-464-8147 -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
On Monday 23 Apr 2012 17:23:54 Robert Schweikert wrote:
Hi,
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?
Thanks, Robert
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 %endif Then later you can check as: %if 0%{?opensuse_version} == 1120 Buildrequires: freetype2 %endif Regards, Antonio -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
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
Am Montag, 23. April 2012, 17:23:54 schrieb Robert Schweikert:
Hi,
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?
Not using the -release package. Since this package depends on which product you have installed. But your package is building for the code stream that means it has to work for all products, also derivates and later forks. I dunno why you need it, so I can not recommend how to work differently. moin adrian -- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org
participants (4)
-
Adrian Schröter
-
Antonio Cavallo
-
Lars Müller
-
Robert Schweikert