1+ # gconf is a legacy system not used any more, and it blocks testing of oscap-anaconda-addon
2+ # as gconf is no longer part of the installation medium
3+ %bcond_with gconf
4+
5+ # By default do not build perl swig bindings
6+ %bcond_with perl
7+
18# This spec file is not synchronized to the Fedora downstream.
29# It serves as Fedora CI configuration and as support for downstream updates.
310Name: openscap
@@ -16,22 +23,46 @@ BuildRequires: pkg-config
1623BuildRequires: systemd-rpm-macros
1724BuildRequires: gcc
1825BuildRequires: gcc-c++
19- BuildRequires: swig libxml2-devel libxslt-devel perl-generators perl-XML-Parser
20- BuildRequires: rpm-devel
21- BuildRequires: libgcrypt-devel
22- BuildRequires: pcre-devel
23- BuildRequires: libacl-devel
24- BuildRequires: libselinux-devel
25- BuildRequires: libcap-devel
26- BuildRequires: libblkid-devel
27- BuildRequires: bzip2-devel
26+
27+ # Try to follow CMakeLists.txt order
28+ BuildRequires: pkgconfig(libacl)
29+ BuildRequires: pkgconfig(blkid)
30+ BuildRequires: pkgconfig(libcap)
31+ BuildRequires: pkgconfig(libcurl)
32+ BuildRequires: pkgconfig(dbus-1)
33+ BuildRequires: doxygen
34+ %if %{with gconf }
35+ BuildRequires: pkgconfig(glib-2.0)
36+ BuildRequires: pkgconfig(gobject-2.0)
37+ BuildRequires: pkgconfig(gconf-2.0)
38+ %endif
39+ BuildRequires: pkgconfig(ldap)
40+ BuildRequires: pkgconfig(opendbx)
41+ BuildRequires: pkgconfig(libpcre)
42+ %if %{with perl }
43+ BuildRequires: perl-devel
44+ # BuildRequires: perl-generators
45+ %endif
46+ BuildRequires: pkgconfig(popt)
47+ BuildRequires: pkgconfig(libsystemd)
48+ BuildRequires: pkgconfig(libprocps)
49+ BuildRequires: pkgconfig(python3)
50+ BuildRequires: pkgconfig(rpm)
51+ BuildRequires: pkgconfig(libselinux)
52+ BuildRequires: swig
53+ BuildRequires: pkgconfig(libxml-2.0)
54+ BuildRequires: pkgconfig(libxslt)
55+ BuildRequires: pkgconfig(xmlsec1)
56+ BuildRequires: pkgconfig(xmlsec1-openssl)
57+ BuildRequires: pkgconfig(openssl)
58+ BuildRequires: pkgconfig(bzip2)
59+ BuildRequires: pkgconfig(libgcrypt)
60+ BuildRequires: pkgconfig(yaml-0.1)
2861BuildRequires: asciidoc
29- BuildRequires: openldap-devel
30- BuildRequires: glib2-devel
31- BuildRequires: dbus-devel
32- BuildRequires: libyaml-devel
33- BuildRequires: xmlsec1-devel xmlsec1-openssl-devel
62+ BuildRequires: git
63+ BuildRequires: sed
3464BuildRequires: systemd
65+
3566%if %{with check }
3667BuildRequires: bzip2
3768BuildRequires: chkconfig
@@ -51,19 +82,6 @@ BuildRequires: rpm-build
5182BuildRequires: tar
5283BuildRequires: tcpdump
5384%endif
54- Requires: bash
55- Requires: bzip2-libs
56- Requires: dbus
57- Requires: glib2
58- Requires: libacl
59- Requires: libblkid
60- Requires: libcap
61- Requires: libselinux
62- Requires: openldap
63- Requires: popt
64- # Fedora has procps-ng, which provides procps
65- Requires: procps
66- Requires: xmlsec1 xmlsec1-openssl
6785
6886%description
6987OpenSCAP is a set of open source libraries providing an easier path
@@ -74,9 +92,6 @@ for the expression of Computer Network Defense related information.
7492%package devel
7593Summary: Development files for %{name }
7694Requires: %{name }%{?_isa } = %{epoch }:%{version }-%{release }
77- Requires: libxml2-devel
78- Requires: pkgconfig
79- BuildRequires: doxygen
8095
8196%description devel
8297The %{name }-devel package contains libraries and header files for
@@ -85,7 +100,6 @@ developing applications that use %{name}.
85100%package python3
86101Summary: Python 3 bindings for %{name }
87102Requires: %{name }%{?_isa } = %{epoch }:%{version }-%{release }
88- BuildRequires: python3-devel
89103
90104%description python3
91105The %{name }-python3 package contains the bindings so that %{name }
@@ -94,8 +108,6 @@ libraries can be used by python3.
94108%package scanner
95109Summary: OpenSCAP Scanner Tool (oscap)
96110Requires: %{name }%{?_isa } = %{epoch }:%{version }-%{release }
97- Requires: libcurl >= 7.12.0
98- BuildRequires: libcurl-devel >= 7.12.0
99111
100112%description scanner
101113The %{name }-scanner package contains oscap command-line tool. The oscap
@@ -105,6 +117,7 @@ compliance checking using SCAP content.
105117%package utils
106118Summary: OpenSCAP Utilities
107119Requires: %{name }%{?_isa } = %{epoch }:%{version }-%{release }
120+ # These not probed from: scap-as-rpm
108121Requires: rpmdevtools rpm-build
109122Requires: %{name }-scanner%{?_isa } = %{epoch }:%{version }-%{release }
110123
@@ -126,7 +139,6 @@ commands using a scripting language (Bash, Perl, Python, Ruby, ...).
126139Summary: Development files for %{name }-engine-sce
127140Requires: %{name }-devel%{?_isa } = %{epoch }:%{version }-%{release }
128141Requires: %{name }-engine-sce%{?_isa } = %{epoch }:%{version }-%{release }
129- Requires: pkgconfig
130142
131143%description engine-sce-devel
132144The %{name }-engine-sce-devel package contains libraries and header files
@@ -147,13 +159,15 @@ tar xvzf %{SOURCE1} --directory=yaml-filter --strip-components=1
147159
148160%build
149161%undefine __cmake_in_source_build
150- # gconf is a legacy system not used any more, and it blocks testing of oscap-anaconda-addon
151- # as gconf is no longer part of the installation medium
152162%cmake -G Ninja \
153- -DENABLE_PERL=OFF \
154163 -DENABLE_DOCS=ON \
164+ %if ! %{with gconf }
155165 -DOPENSCAP_PROBE_UNIX_GCONF=OFF \
156- -DGCONF_LIBRARY=
166+ -DGCONF_LIBRARY= \
167+ %endif
168+ %if ! %{with perl }
169+ -DENABLE_PERL=OFF \
170+ %endif
157171
158172%cmake_build
159173make docs
0 commit comments