On 25/04/2017 13:13, Greg Freemyer wrote:
As in
$ grep suse_version /usr/lib/rpm/suse_macros %suse_version 1315
On 42.2: grep sle_version /usr/lib/rpm/suse_macros %sle_version 120200
But be very careful with it too. 1315 is for Leap 42.1. 1320 was openSUSE 13.2
I no longer use %suse_version for Leap only the above %sle_version && is_opensuse
spec file logic can be quite convoluted due to one-off decisions in setting the macros.
openSUSE - the pathological distro. Can't decide if it is coming or going!
As I read Richard's comments:
We screwed up the rpm macros for packagers when we released Leap. But it doesn't seem fair to keep that pain for only the packagers, so we are going to do a back jump for non-packagers as well. ===
You have suse_version, sle_version, and leap_version. To figure out what release you are in, you have to know which one to check:
openSUSE Factory %if 0%{?suse_version} > 1320 openSUSE Leap 42.3 %if 0%{?leap_version} == 420300 openSUSE Leap 42.2 %if 0%{?leap_version} == 420200 openSUSE Leap 42.1 %if 0%{?sle_version} == 120100 openSUSE Leap 42.x %if 0%{?suse_version} == 1315 openSUSE 13.2 %if 0%{?suse_version} == 1320 openSUSE 13.1 %if 0%{?suse_version} == 1310
fyi: the logic was pretty sane before Leap came out
Greg
%leap_version only exists in the actual obs project configuration. I'm relieved I never used %leap_version and only used macros that exist locally as well. Some people use source rpms I think.
Dave P