diff --git a/0001-Fix-compile-error-with-future-versions-of-gcc.patch b/0001-Fix-compile-error-with-future-versions-of-gcc.patch new file mode 100644 index 0000000000000000000000000000000000000000..5ba94c55a9a396253bc3f63c798c09c26e1737eb --- /dev/null +++ b/0001-Fix-compile-error-with-future-versions-of-gcc.patch @@ -0,0 +1,31 @@ +# include in rpm-helper.h +# Reported upstream in https://github.com/OpenSCAP/openscap/pull/1922 + +From 989901ef95e344b49e78238c89c59bd80951b876 Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Wed, 1 Feb 2023 06:38:40 +0000 +Subject: [PATCH] Fix compile error with future versions of gcc + +/builddir/build/BUILD/openscap-1.3.6/src/OVAL/probes/unix/linux/rpminfo_probe.c: In function 'rpminfo_probe_fini': +/builddir/build/BUILD/openscap-1.3.6/src/OVAL/probes/unix/linux/rpminfo_probe.c:307:9: error: implicit declaration of function 'rpmFreeCrypto' + 307 | rpmFreeCrypto(); + | ^~~~~~~~~~~~~ +--- + src/OVAL/probes/unix/linux/rpm-helper.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/OVAL/probes/unix/linux/rpm-helper.h b/src/OVAL/probes/unix/linux/rpm-helper.h +index eca9cde04..6f7cb71d7 100644 +--- a/src/OVAL/probes/unix/linux/rpm-helper.h ++++ b/src/OVAL/probes/unix/linux/rpm-helper.h +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + #include + + #include +-- +2.35.3 + diff --git a/1.3.7.tar.gz b/1.3.7.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..abe901b6a241aa69967944e25cdc08040a400523 Binary files /dev/null and b/1.3.7.tar.gz differ diff --git a/openscap.spec b/openscap.spec new file mode 100644 index 0000000000000000000000000000000000000000..ee04a871ef6dbcc247e6594e3f25ac9fd1ae3abc --- /dev/null +++ b/openscap.spec @@ -0,0 +1,237 @@ +%define anolis_release 1 + +Name: openscap +Version: 1.3.7 +Release: %{anolis_release}%{?dist} +Epoch: 1 +Summary: Set of open source libraries enabling integration of the SCAP line of standards +License: LGPLv2+ +URL: https://github.com/OpenSCAP/openscap +Source0: https://github.com/OpenSCAP/openscap/archive/refs/tags/%{version}.tar.gz + +Patch0: https://github.com/OpenSCAP/openscap/pull/1922.patch#/0001-Fix-compile-error-with-future-versions-of-gcc.patch + +BuildRequires: make +BuildRequires: cmake >= 2.6 +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: swig libxml2-devel libxslt-devel perl-generators perl-XML-Parser +BuildRequires: rpm-devel +BuildRequires: libgcrypt-devel +BuildRequires: pcre-devel +BuildRequires: libacl-devel +BuildRequires: libselinux-devel +BuildRequires: libcap-devel +BuildRequires: libblkid-devel +BuildRequires: bzip2-devel +BuildRequires: asciidoc +BuildRequires: openldap-devel +BuildRequires: glib2-devel +BuildRequires: dbus-devel +BuildRequires: libyaml-devel +BuildRequires: xmlsec1-devel xmlsec1-openssl-devel +BuildRequires: systemd +%if %{?_with_check:1}%{!?_with_check:0} +BuildRequires: perl-XML-XPath +BuildRequires: bzip2 +%endif +BuildRequires: systemd-rpm-macros +Requires: bash +Requires: bzip2-libs +Requires: dbus +Requires: glib2 +Requires: libacl +Requires: libblkid +Requires: libcap +Requires: libselinux +Requires: openldap +Requires: popt +# Fedora has procps-ng, which provides procps +Requires: procps +Requires: xmlsec1 xmlsec1-openssl + +%description +OpenSCAP is a set of open source libraries providing an easier path +for integration of the SCAP line of standards. SCAP is a line of standards +managed by NIST with the goal of providing a standard language +for the expression of Computer Network Defense related information. + +%package devel +Summary: Development files for %{name} +Requires: %{name} = %{epoch}:%{version}-%{release} +Requires: libxml2-devel +Requires: pkgconfig +BuildRequires: doxygen + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%package python3 +Summary: Python 3 bindings for %{name} +Requires: %{name} = %{epoch}:%{version}-%{release} +BuildRequires: python3-devel + +%description python3 +The %{name}-python3 package contains the bindings so that %{name} +libraries can be used by python3. + +%package scanner +Summary: OpenSCAP Scanner Tool (oscap) +Requires: %{name} = %{epoch}:%{version}-%{release} +Requires: libcurl >= 7.12.0 +BuildRequires: libcurl-devel >= 7.12.0 + +%description scanner +The %{name}-scanner package contains oscap command-line tool. The oscap +is configuration and vulnerability scanner, capable of performing +compliance checking using SCAP content. + +%package utils +Summary: OpenSCAP Utilities +Requires: %{name} = %{epoch}:%{version}-%{release} +Requires: rpmdevtools rpm-build +Requires: %{name}-scanner = %{epoch}:%{version}-%{release} + +%description utils +The %{name}-utils package contains command-line tools build on top +of OpenSCAP library. Historically, openscap-utils included oscap +tool which is now separated to %{name}-scanner sub-package. + +%package engine-sce +Summary: Script Check Engine plug-in for OpenSCAP +Requires: %{name} = %{epoch}:%{version}-%{release} + +%description engine-sce +The Script Check Engine is non-standard extension to SCAP protocol. This +engine allows content authors to avoid OVAL language and write their assessment +commands using a scripting language (Bash, Perl, Python, Ruby, ...). + +%package engine-sce-devel +Summary: Development files for %{name}-engine-sce +Requires: %{name}-devel = %{epoch}:%{version}-%{release} +Requires: %{name}-engine-sce = %{epoch}:%{version}-%{release} +Requires: pkgconfig + +%description engine-sce-devel +The %{name}-engine-sce-devel package contains libraries and header files +for developing applications that use %{name}-engine-sce. + +%package containers +Summary: Utils for scanning containers +Requires: %{name} = %{epoch}:%{version}-%{release} +Requires: %{name}-scanner +BuildArch: noarch + +%description containers +Tool for scanning Atomic containers. + +%package doc +Summary: Documentation files for %{name} +Requires: %{name} = %{EVR} +BuildArch: noarch + +%description doc +The %{name}-doc package contains documentation files for %{name}. + +%prep +%autosetup -n %{name}-%{version} -p1 + +%build +# gconf is a legacy system not used any more, and it blocks testing of oscap-anaconda-addon +# as gconf is no longer part of the installation medium +%cmake \ + -DENABLE_PERL=OFF \ + -DENABLE_DOCS=ON \ + -DOPENSCAP_PROBE_UNIX_GCONF=OFF \ + -DGCONF_LIBRARY= +%cmake_build +make docs + +%check +%if %{?_with_check:1}%{!?_with_check:0} +ctest -V %{?_smp_mflags} +%endif + +%install +%cmake_install + +# enable oscap-remediate.service here for now +# https://github.com/hughsie/PackageKit/issues/401 +mkdir -p %{buildroot}%{_unitdir}/system-update.target.wants/ +ln -sf ../oscap-remediate.service %{buildroot}%{_unitdir}/system-update.target.wants/oscap-remediate.service + +%generate_compatibility_deps + +%files +%license COPYING +%doc %{_pkgdocdir}/manual/ +%dir %{_datadir}/openscap +%dir %{_datadir}/openscap/schemas +%dir %{_datadir}/openscap/xsl +%dir %{_datadir}/openscap/cpe +%{_libdir}/libopenscap.so.* +%{_datadir}/openscap/schemas/* +%{_datadir}/openscap/xsl/* +%{_datadir}/openscap/cpe/* +%dir %{abidir} +%{abidir}/libopenscap.dump + +%files python3 +%{python3_sitearch}/* +%{abidir}/_openscap_py.dump + +%files devel +%doc %{_pkgdocdir}/html/ +%{_libdir}/libopenscap.so +%{_libdir}/pkgconfig/*.pc +%{_includedir}/openscap +%exclude %{_includedir}/openscap/sce_engine_api.h + +%files engine-sce-devel +%{_libdir}/libopenscap_sce.so +%{_includedir}/openscap/sce_engine_api.h +%{abidir}/libopenscap_sce.dump + +%files scanner +%{_mandir}/man8/oscap.8* +%{_bindir}/oscap +%{_bindir}/oscap-chroot +%{_sysconfdir}/bash_completion.d +%{_libexecdir}/oscap-remediate +%{_unitdir}/oscap-remediate.service +%{_unitdir}/system-update.target.wants/ +%{abidir}/oscap-option.list +%{abidir}/oscap-chroot-option.list + +%files utils +%doc docs/oscap-scan.cron +%{_mandir}/man8/* +%exclude %{_mandir}/man8/oscap.8* +%exclude %{_mandir}/man8/oscap-docker.8* +%{_bindir}/* +%exclude %{_bindir}/oscap +%exclude %{_bindir}/oscap-docker +%exclude %{_bindir}/oscap-chroot +%{abidir}/autotailor-option.list +%{abidir}/oscap-remediate-offline-option.list +%{abidir}/oscap-run-sce-script-option.list +%{abidir}/oscap-vm-option.list + +%files engine-sce +%{_libdir}/libopenscap_sce.so.* + +%files containers +%{_bindir}/oscap-docker +%{_mandir}/man8/oscap-docker.8* +%{python3_sitelib}/oscap_docker_python/* +%{_bindir}/oscap-podman +%{_mandir}/man8/oscap-podman.8* +%{abidir}/oscap-podman-option.list + +%files doc +%doc AUTHORS NEWS README.md + +%changelog +* Wed Mar 15 2023 happy_orange - 1:1.3.7-1 +- init package