Skip to content

add missing BuildRequires: systemd-rpm-macros for SLES 15#99

Draft
corporate-gadfly wants to merge 1 commit into
OpenVoxProject:mainfrom
corporate-gadfly:sles-rpm-preinst
Draft

add missing BuildRequires: systemd-rpm-macros for SLES 15#99
corporate-gadfly wants to merge 1 commit into
OpenVoxProject:mainfrom
corporate-gadfly:sles-rpm-preinst

Conversation

@corporate-gadfly
Copy link
Copy Markdown
Contributor

On SLES, the package uses %service_del_preun and %service_del_postun macros but doesn't declare systemd-rpm-macros as a build dependency.

This causes the macros to be incorrectly expanded or missing, resulting in scriptlet failures during package removal on SLES15:

error: %preun(openvox-server) scriptlet failed, exit status 1
/var/tmp/rpm-tmp.XXX: line 1: fg: no job control

Adding the BuildRequires ensures the macros are properly defined during package build.

On SLES, the package uses %service_del_preun and %service_del_postun macros
but doesn't declare systemd-rpm-macros as a build dependency.

This causes the macros to be incorrectly expanded or missing,
resulting in scriptlet failures during package removal on SLES15:

  error: %preun(openvox-server) scriptlet failed, exit status 1
  /var/tmp/rpm-tmp.XXX: line 1: fg: no job control

Adding the BuildRequires ensures the macros are properly defined
during package build.

Signed-off-by: Corporate Gadfly <haroon.rafique@gmail.com>
@bastelfreak bastelfreak added the bug Something isn't working label May 18, 2026
@corporate-gadfly corporate-gadfly marked this pull request as draft May 18, 2026 13:58
@corporate-gadfly
Copy link
Copy Markdown
Contributor Author

@nmburgan Thoughts on using following diff in Dockerfile in openvox-server:

diff --git a/Dockerfile b/Dockerfile
index 74b2df1cd1..7634b50a6a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -4,8 +4,14 @@ RUN apt-get update && \
     apt-get install -y --no-install-recommends \
       openjdk-17-jdk-headless \
       rpm \
+      cpio \
     && rm -rf /var/lib/apt/lists/*
 
+# Extract the RPM macros to resolve the expansion of macros on SLES
+RUN wget -q https://rpmfind.net/linux/opensuse/distribution/leap/16.0/repo/oss/noarch/systemd-rpm-macros-26-160000.2.2.noarch.rpm -O /tmp/suse-macros.rpm && \
+    rpm2cpio /tmp/suse-macros.rpm | cpio -idmv -D / && \
+    rm /tmp/suse-macros.rpm
+
 RUN wget -q https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein -O /usr/local/bin/lein && \
     chmod a+x /usr/local/bin/lein

@corporate-gadfly
Copy link
Copy Markdown
Contributor Author

@corporate-gadfly corporate-gadfly changed the title add missing BuildRequires: systemd-rpm-macros add missing BuildRequires: systemd-rpm-macros for SLES 15 May 20, 2026
@bastelfreak
Copy link
Copy Markdown
Contributor

@corporate-gadfly when/where is systemd-rpm-macros required? Do we need it inside the container, before the package for for SLES is build? And if it's present, do we need to change any of the fpm parameters?

@corporate-gadfly
Copy link
Copy Markdown
Contributor Author

@corporate-gadfly when/where is systemd-rpm-macros required? Do we need it inside the container, before the package for for SLES is build? And if it's present, do we need to change any of the fpm parameters?

@bastelfreak systemd-rpm-macros is required at the time of package build for SLES. Since it is not a native SLES docker image, I am resorting to finding an RPM and extracting the macros, so that hopefully rpm-build is able to find them when building the RPM.

fpm parameters were added as part of this PR to add to the header of the RPM .spec file.

The hope is that rpm-build won't fail after seeing the macros on the file system.

Running out of ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants