On Thu, 2018-11-08 at 13:14 +0200, Mikhail Kasimov wrote:
Hello!
Now I have "positive" construction:
%if ( 0%{?sles_version} > 120200 && !0%{?is_opensuse} ) || ( 0%{?sles_version} > 120200 && 0%{?is_opensuse} ) || 0%{?rhel_version}
600 || 0%{?centos_version} > 600 || 0%{?scientificlinux_version} > 600 %doc README.md %license LICENSE LICENSE.GPL2 %else %doc LICENSE LICENSE.GPL2 README.md %endif
or even
%if ( 0%{?sles_version} >= 120300 && !0%{?is_opensuse} ) || ( 0%{?sles_version} >= 120300 && 0%{?is_opensuse} ) || 0%{?rhel_version}
= 700 || 0%{?centos_version} >= 700 || 0%{?scientificlinux_version} >= 700 %doc README.md %license LICENSE LICENSE.GPL2 %else %doc LICENSE LICENSE.GPL2 README.md %endif
And... these all also don't work: on openSUSE 42.3 LICENSE LICENSE.GPL2 files are still in /usr/share/doc/ instead of /usr/share/licenses/ . o_O
Any ideas, please? If construction is OK ("positive"), OS detection is OK (due to guidelines) -- why this doesn't work correctly... вт, 6 нояб. 2018 г. в 11:19, Andreas Schwab <schwab@suse.de>:
On Nov 06 2018, Mikhail Kasimov <mikhail.kasimov@gmail.com> wrote:
%if ( 0%{?sles_version} < 120300 && !0%{?is_opensuse} ) || ( 0%{?sles_version} < 120300 && 0%{?is_opensuse} ) || 0%{?rhel_version} < 700 || 0%{?centos_version} < 700 || 0%{?scientificlinux_version} < 700
This condition is true if any of the version macros is undefined. It is generally better to formulate positive conditions on version macros. I.e., instead of checking for 0%{?foo_version} < x, reverse the condition and check for 0%{?foo_version} > y.
I'm pretty sure you meant to use sle_version - not sles_version; sle_version is the variable shared between the SLE* and Leap releases Basically, this condition is never true: 0%{?sles_version} >= 120300 && 0%{?is_opensuse} if it's openSUSE, there is never a sles_version > 0 defined (but there is sle_versio 120300, asyou'd expect) Cheers Dominique