Bug 1187320

Summary: RPM macro 'sle_version' missing in 15.3
Product: [openSUSE] openSUSE Distribution Reporter: Alex Honeywell <alex.honeywell>
Component: DevelopmentAssignee: Michael Schröder <mls>
Status: RESOLVED DUPLICATE QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: andreas.rogge
Version: Leap 15.3   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Alex Honeywell 2021-06-14 18:47:30 UTC
Accoring to https://en.opensuse.org/openSUSE:Packaging_for_Leap#RPM_Distro_Version_Macros this macro should be defined as `150300` however it is not present in `/usr/lib/rpm/suse/macros` provided by `rpm-config-SUSE-1-3.61`:`suse_macros.in` for Leap 15.3

```
...
%supplements_kernel_module() \
    %{expand:%(if ! rpm -q kernel-syms > /dev/null; then echo "%fail Please add the kernel-syms package to BuildRequires"; fi)}

%suse_version @suse_version@
%sles_version @sles_version@
%ul_version @ul_version@
%is_opensuse @is_opensuse@

%do_profiling
...```

contrast to `/usr/lib/rpm/suse_macros` provided by `rpm-4.14.1-lp152.17.5`:`rpm-suse_macros`

```
...

%supplements_kernel_module() \
    %{expand:%(if ! rpm -q kernel-syms > /dev/null; then echo "%fail Please add the kernel-syms package to BuildRequires"; fi)}

%suse_version @suse_version@
%sles_version @sles_version@
%ul_version @ul_version@
%is_opensuse @is_opensuse@
%sle_version @sle_version@
%leap_version @leap_version@

%do_profiling 1
...
```

Result:

```
lp152:~ # rpm --eval '0%{?sle_version}'
0150200

---

lp153:~ # rpm --eval '0%{?sle_version}'
0
```
Comment 1 Alex Honeywell 2021-06-14 18:52:41 UTC
Oh, and `is_opensuse` also seems to be gone but still recommended by the document:

"leap_version is deprecated, use is_opensuse and sle_version instead"
Comment 2 Andreas Rogge 2021-07-01 08:50:34 UTC
We were just hit by that one, too.
Our builds fail on Leap 15.3. Manually setting the macros fixes our problem.

AFAICT the SPEC looks allright, maybe the macros were not set when it was built.

We'd really appreciate a fix.
Comment 3 Michael Schröder 2021-07-02 12:23:58 UTC
This is a duplicate of bug 1187214.

*** This bug has been marked as a duplicate of bug 1187214 ***
Comment 4 Andreas Rogge 2021-07-02 12:34:47 UTC
While this may indeed be a duplicate, but Bugzilla states that
" You are not authorized to access bug #1187214. "

Could you please make the other Bug public before marking this one as a duplicate, so people can actually follow along?

Thank you!
Comment 5 Michael Schröder 2021-07-02 12:54:11 UTC
Hmm, bugzilla asked if it should add the reporter to the CC list, but it ignored you. sorry. I'll try to make the other bug public.
Comment 6 Michael Schröder 2021-07-02 12:57:44 UTC
closing again.

*** This bug has been marked as a duplicate of bug 1187214 ***