openscap-1.3.0_alpha1

This commit is contained in:
Jan Černý 2018-07-18 13:05:41 +02:00
parent 564f5d56d5
commit 8836f680ee
3 changed files with 37 additions and 129 deletions

1
.gitignore vendored
View File

@ -60,3 +60,4 @@ openscap-0.6.0.tar.gz
/openscap-1.2.15.tar.gz /openscap-1.2.15.tar.gz
/openscap-1.2.16.tar.gz /openscap-1.2.16.tar.gz
/openscap-1.2.17.tar.gz /openscap-1.2.17.tar.gz
/openscap-1.3.0_alpha1.tar.gz

View File

@ -1,26 +1,15 @@
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%if 0%{?fedora} <= 22 || (0%{?rhel} != 0 && 0%{?rhel} <= 7)
%global oscapdocker_pypkg %{__python2}
%global oscapdocker_pysitelib %{python_sitelib}
%else
%global oscapdocker_pypkg %{__python3}
%global oscapdocker_pysitelib %{python3_sitelib}
%endif
%define relabel_files() \
restorecon -R /usr/bin/oscap /usr/libexec/openscap; \
Name: openscap Name: openscap
Version: 1.2.17 Version: 1.3.0_alpha1
Release: 5%{?dist} Release: 1%{?dist}
Summary: Set of open source libraries enabling integration of the SCAP line of standards Summary: Set of open source libraries enabling integration of the SCAP line of standards
Group: System Environment/Libraries Group: System Environment/Libraries
License: LGPLv2+ License: LGPLv2+
URL: http://www.open-scap.org/ URL: http://www.open-scap.org/
Source0: http://fedorahosted.org/releases/o/p/openscap/%{name}-%{version}.tar.gz Source0: https://github.com/OpenSCAP/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz
BuildRequires: swig libxml2-devel libxslt-devel perl-generators, perl-XML-Parser BuildRequires: cmake >= 2.6
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: swig libxml2-devel libxslt-devel perl-generators perl-XML-Parser
BuildRequires: rpm-devel BuildRequires: rpm-devel
BuildRequires: libgcrypt-devel BuildRequires: libgcrypt-devel
BuildRequires: pcre-devel BuildRequires: pcre-devel
@ -28,6 +17,10 @@ BuildRequires: libacl-devel
BuildRequires: libselinux-devel libcap-devel BuildRequires: libselinux-devel libcap-devel
BuildRequires: libblkid-devel BuildRequires: libblkid-devel
BuildRequires: bzip2-devel BuildRequires: bzip2-devel
BuildRequires: asciidoctor
BuildRequires: openldap-devel
BuildRequires: GConf2-devel
BuildRequires: dbus-devel
%if %{?_with_check:1}%{!?_with_check:0} %if %{?_with_check:1}%{!?_with_check:0}
BuildRequires: perl-XML-XPath BuildRequires: perl-XML-XPath
BuildRequires: bzip2 BuildRequires: bzip2
@ -47,6 +40,7 @@ Group: Development/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: libxml2-devel Requires: libxml2-devel
Requires: pkgconfig Requires: pkgconfig
BuildRequires: doxygen
%description devel %description devel
The %{name}-devel package contains libraries and header files for The %{name}-devel package contains libraries and header files for
@ -115,38 +109,6 @@ The %{name}-utils package contains command-line tools build on top
of OpenSCAP library. Historically, openscap-utils included oscap of OpenSCAP library. Historically, openscap-utils included oscap
tool which is now separated to %{name}-scanner sub-package. tool which is now separated to %{name}-scanner sub-package.
%package content-sectool
Summary: Sectool content
Group: Applications/System
Requires: %{name} = %{version}-%{release}
Requires: %{name}-engine-sce
BuildArch: noarch
%description content-sectool
SCAP/SCE content that conforms to sectool checks.
%package extra-probes
Summary: SCAP probes
Group: Applications/System
Requires: %{name}%{?_isa} = %{version}-%{release}
BuildRequires: openldap-devel
BuildRequires: GConf2-devel
%description extra-probes
The %{name}-extra-probes package contains additional probes that are not
commonly used and require additional dependencies.
%package extra-probes-sql
Summary: SCAP probes for Database
Group: Applications/System
Requires: %{name}%{?_isa} = %{version}-%{release}
BuildRequires: opendbx-devel
%description extra-probes-sql
The %{name}-extra-probes-sql package contains additional OpenSCAP probes
for querying database objects. Users are advised to install appropriate
opendbx backend package along this one.
%package engine-sce %package engine-sce
Summary: Script Check Engine plug-in for OpenSCAP Summary: Script Check Engine plug-in for OpenSCAP
Group: Applications/System Group: Applications/System
@ -180,93 +142,43 @@ Tool for scanning Atomic containers.
%prep %prep
%setup -q %setup -q
mkdir build
%build %build
%ifarch sparc64 cd build
#sparc64 need big PIE %cmake -DENABLE_SCE=TRUE ..
export CFLAGS="$RPM_OPT_FLAGS -fPIE"
export LDFLAGS="-pie -Wl,-z,relro -Wl,-z,now"
%else
export CFLAGS="$RPM_OPT_FLAGS -fpie"
export LDFLAGS="-pie -Wl,-z,relro -Wl,-z,now"
%endif
%configure --enable-sce --enable-perl --enable-python3 preferred_python=%{oscapdocker_pypkg}
make %{?_smp_mflags} make %{?_smp_mflags}
# Remove shebang from bash-completion script
sed -i '/^#!.*bin/,+1 d' dist/bash_completion.d/oscap
%check %check
#to run make check use "--with check"
%if %{?_with_check:1}%{!?_with_check:0} %if %{?_with_check:1}%{!?_with_check:0}
make check ctest -V %{?_smp_mflags}
%endif %endif
%install %install
rm -rf $RPM_BUILD_ROOT cd build
%make_install
make install INSTALL='install -p' DESTDIR=$RPM_BUILD_ROOT
# remove content for another OS
rm $RPM_BUILD_ROOT/%{_datadir}/openscap/scap-rhel6-oval.xml
rm $RPM_BUILD_ROOT/%{_datadir}/openscap/scap-rhel6-xccdf.xml
rm $RPM_BUILD_ROOT/%{_datadir}/openscap/scap-fedora14-oval.xml
rm $RPM_BUILD_ROOT/%{_datadir}/openscap/scap-fedora14-xccdf.xml
# bash-completion script
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/bash_completion.d
install -pm 644 dist/bash_completion.d/oscap $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/oscap
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
# fix python shebangs
pathfix.py -i %{__python3} -p -n $RPM_BUILD_ROOT%{_bindir}/scap-as-rpm
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig %post -p /sbin/ldconfig
%postun -p /sbin/ldconfig %postun -p /sbin/ldconfig
%files %files
%doc AUTHORS ChangeLog NEWS README.md %doc AUTHORS NEWS README.md
%license COPYING %license COPYING
%{_libdir}/libopenscap.so.* %doc %{_pkgdocdir}/manual/
%{_libexecdir}/openscap/probe_dnscache
%{_libexecdir}/openscap/probe_environmentvariable
%{_libexecdir}/openscap/probe_environmentvariable58
%{_libexecdir}/openscap/probe_family
%{_libexecdir}/openscap/probe_file
%{_libexecdir}/openscap/probe_fileextendedattribute
%{_libexecdir}/openscap/probe_filehash
%{_libexecdir}/openscap/probe_filehash58
%{_libexecdir}/openscap/probe_iflisteners
%{_libexecdir}/openscap/probe_inetlisteningservers
%{_libexecdir}/openscap/probe_interface
%{_libexecdir}/openscap/probe_partition
%{_libexecdir}/openscap/probe_password
%{_libexecdir}/openscap/probe_process
%{_libexecdir}/openscap/probe_process58
%{_libexecdir}/openscap/probe_routingtable
%{_libexecdir}/openscap/probe_rpminfo
%{_libexecdir}/openscap/probe_rpmverify
%{_libexecdir}/openscap/probe_rpmverifyfile
%{_libexecdir}/openscap/probe_rpmverifypackage
%{_libexecdir}/openscap/probe_runlevel
%{_libexecdir}/openscap/probe_selinuxboolean
%{_libexecdir}/openscap/probe_selinuxsecuritycontext
%{_libexecdir}/openscap/probe_shadow
%{_libexecdir}/openscap/probe_symlink
%{_libexecdir}/openscap/probe_sysctl
%{_libexecdir}/openscap/probe_system_info
%{_libexecdir}/openscap/probe_systemdunitdependency
%{_libexecdir}/openscap/probe_systemdunitproperty
%{_libexecdir}/openscap/probe_textfilecontent
%{_libexecdir}/openscap/probe_textfilecontent54
%{_libexecdir}/openscap/probe_uname
%{_libexecdir}/openscap/probe_variable
%{_libexecdir}/openscap/probe_xinetd
%{_libexecdir}/openscap/probe_xmlfilecontent
%dir %{_datadir}/openscap %dir %{_datadir}/openscap
%dir %{_datadir}/openscap/schemas %dir %{_datadir}/openscap/schemas
%dir %{_datadir}/openscap/xsl %dir %{_datadir}/openscap/xsl
%dir %{_datadir}/openscap/cpe %dir %{_datadir}/openscap/cpe
%{_libdir}/libopenscap.so.*
%{_datadir}/openscap/schemas/* %{_datadir}/openscap/schemas/*
%{_datadir}/openscap/xsl/* %{_datadir}/openscap/xsl/*
%{_datadir}/openscap/cpe/* %{_datadir}/openscap/cpe/*
@ -282,7 +194,7 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
%{perl_vendorlib}/* %{perl_vendorlib}/*
%files devel %files devel
%doc docs/{html,examples}/ %doc %{_pkgdocdir}/html/
%{_libdir}/libopenscap.so %{_libdir}/libopenscap.so
%{_libdir}/pkgconfig/*.pc %{_libdir}/pkgconfig/*.pc
%{_includedir}/openscap %{_includedir}/openscap
@ -308,26 +220,21 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
%exclude %{_bindir}/oscap-docker %exclude %{_bindir}/oscap-docker
%exclude %{_bindir}/oscap-chroot %exclude %{_bindir}/oscap-chroot
%files content-sectool
%{_datadir}/openscap/sectool-sce
%files extra-probes
%{_libexecdir}/openscap/probe_ldap57
%{_libexecdir}/openscap/probe_gconf
%files extra-probes-sql
%{_libexecdir}/openscap/probe_sql
%{_libexecdir}/openscap/probe_sql57
%files engine-sce %files engine-sce
%{_libdir}/libopenscap_sce.so.* %{_libdir}/libopenscap_sce.so.*
%files containers %files containers
%{_bindir}/oscap-docker %{_bindir}/oscap-docker
%{_mandir}/man8/oscap-docker.8.gz %{_mandir}/man8/oscap-docker.8.gz
%{oscapdocker_pysitelib}/oscap_docker_python/* %{python3_sitelib}/oscap_docker_python/*
%changelog %changelog
* Wed Jul 18 2018 Jan Černý <jcerny@redhat.com> - 1.3.0_alpha1-1
- upgrade to the latest upstream release
- change specfile to use CMake
- dropped commands in the spec file that are no longer relevant
- dropped subpackages in the spec file that are no longer relevant
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.17-5 * Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.17-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (openscap-1.2.17.tar.gz) = 38b80215e4815c3a4a50e86376fbd680e58d2470b67dbc02dda052b11de5dd4af4b525d639c3ad5359ac70194c63276fbecbe7445df36009f5fe492a80a77a27 SHA512 (openscap-1.3.0_alpha1.tar.gz) = 29d7c3fa7c0fb05973cd5f587d31abee9c77af85141c9556532a02acd1ec936c51e26f631931ad3fbe99025910ecf64e613f8d0fcb2cca3e35e69238b865f7e7