From e34ec4480d0dda4bf355b4f755f3d819c6770ffc82ed6b85479ede5b12e601f9 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Fri, 20 Jan 2023 09:25:38 +0000 Subject: [PATCH] Accepting request 1059914 from home:msmeissn:branches:security - 0001-Use-correct-includes.patch: fixed build with rpm 4.18 OBS-URL: https://build.opensuse.org/request/show/1059914 OBS-URL: https://build.opensuse.org/package/show/security/openscap?expand=0&rev=277 --- 0001-Use-correct-includes.patch | 61 +++++++++++++++++++++++++++++++++ openscap.changes | 5 +++ openscap.spec | 3 +- 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 0001-Use-correct-includes.patch diff --git a/0001-Use-correct-includes.patch b/0001-Use-correct-includes.patch new file mode 100644 index 0000000..dddc9fe --- /dev/null +++ b/0001-Use-correct-includes.patch @@ -0,0 +1,61 @@ +From 8dec1bb5e9546e75ae6e7b7cf94cf00197ce3e5d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= +Date: Tue, 24 May 2022 12:15:44 +0200 +Subject: [PATCH] Use correct includes + +rpmvercmp is defined in rpm/rpmver.h +risdigit is defined in rpm/rpmstring.h + +Resolves: rhbz#2080210 +--- + cmake/FindRPM.cmake | 3 +++ + config.h.in | 1 + + src/OVAL/results/oval_cmp_evr_string.c | 5 +++++ + 3 files changed, 9 insertions(+) + +diff --git a/cmake/FindRPM.cmake b/cmake/FindRPM.cmake +index a666942ea..369d153fc 100644 +--- a/cmake/FindRPM.cmake ++++ b/cmake/FindRPM.cmake +@@ -30,6 +30,9 @@ set(RPM_VERSION ${RPM_PKGCONF_VERSION}) + if(RPM_VERSION) + string(COMPARE GREATER "4.6" ${RPM_VERSION} RPM46_FOUND) + string(COMPARE GREATER "4.7" ${RPM_VERSION} RPM47_FOUND) ++ if(NOT (RPM_VERSION VERSION_LESS "4.18")) ++ set(RPM418_FOUND 1) ++ endif() + endif() + + # Set the include dir variables and the libraries and let libfind_process do the rest. +diff --git a/config.h.in b/config.h.in +index 1b7285582..bb1428afc 100644 +--- a/config.h.in ++++ b/config.h.in +@@ -44,6 +44,7 @@ + #cmakedefine HAVE_RPMVERCMP + #cmakedefine RPM46_FOUND + #cmakedefine RPM47_FOUND ++#cmakedefine RPM418_FOUND + + #cmakedefine BZIP2_FOUND + +diff --git a/src/OVAL/results/oval_cmp_evr_string.c b/src/OVAL/results/oval_cmp_evr_string.c +index 3bfc8ce5f..3ba0fa0cb 100644 +--- a/src/OVAL/results/oval_cmp_evr_string.c ++++ b/src/OVAL/results/oval_cmp_evr_string.c +@@ -37,7 +37,12 @@ + #include "common/_error.h" + + #ifdef HAVE_RPMVERCMP ++#ifdef RPM418_FOUND ++#include ++#include ++#else + #include ++#endif + #else + #ifdef OS_WINDOWS + #include +-- +2.35.3 + diff --git a/openscap.changes b/openscap.changes index 432c6d9..3cb1253 100644 --- a/openscap.changes +++ b/openscap.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jan 19 15:55:11 UTC 2023 - Marcus Meissner + +- 0001-Use-correct-includes.patch: fixed build with rpm 4.18 + ------------------------------------------------------------------- Wed Sep 21 07:41:07 UTC 2022 - Dirk Müller diff --git a/openscap.spec b/openscap.spec index 5067468..7459e52 100644 --- a/openscap.spec +++ b/openscap.spec @@ -1,7 +1,7 @@ # # spec file for package openscap # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -44,6 +44,7 @@ Patch3: openscap-docker-add-suse.patch %if 0%{?suse_version} != 1599 Patch4: oscap-remediate.service.in.patch %endif +Patch5: 0001-Use-correct-includes.patch BuildRequires: asciidoc # Use package name cause of "have choice for perl(XML::Parser): brp-check-suse perl-XML-Parser" BuildRequires: cmake