From 073336824e500d6c5e3ef5b96b5e62e7e0be1ec8 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Wed, 3 Nov 2021 15:13:40 -0400 Subject: [PATCH] import scap-workbench-1.2.1-11.el9 --- .gitignore | 1 + .scap-workbench.metadata | 1 + ...bench-1.2.2-fix-qt-deprecated-pr-259.patch | 64 +++++ ...scap-workbench-1.2.2-no-rpath-pr-285.patch | 42 +++ ...solete-Qstring-SkipEmptyParts-pr-266.patch | 50 ++++ SOURCES/scap-workbench-gcc11.patch | 13 + SPECS/scap-workbench.spec | 247 ++++++++++++++++++ 7 files changed, 418 insertions(+) create mode 100644 .gitignore create mode 100644 .scap-workbench.metadata create mode 100644 SOURCES/scap-workbench-1.2.2-fix-qt-deprecated-pr-259.patch create mode 100644 SOURCES/scap-workbench-1.2.2-no-rpath-pr-285.patch create mode 100644 SOURCES/scap-workbench-1.2.2-replace-obsolete-Qstring-SkipEmptyParts-pr-266.patch create mode 100644 SOURCES/scap-workbench-gcc11.patch create mode 100644 SPECS/scap-workbench.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e1acd45 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/scap-workbench-1.2.1.tar.bz2 diff --git a/.scap-workbench.metadata b/.scap-workbench.metadata new file mode 100644 index 0000000..625ce48 --- /dev/null +++ b/.scap-workbench.metadata @@ -0,0 +1 @@ +59180c64eedef2c3047f7b420b9cfb8ed60a6dca SOURCES/scap-workbench-1.2.1.tar.bz2 diff --git a/SOURCES/scap-workbench-1.2.2-fix-qt-deprecated-pr-259.patch b/SOURCES/scap-workbench-1.2.2-fix-qt-deprecated-pr-259.patch new file mode 100644 index 0000000..9aad04d --- /dev/null +++ b/SOURCES/scap-workbench-1.2.2-fix-qt-deprecated-pr-259.patch @@ -0,0 +1,64 @@ +From 806be588a70349b1705a687d38b90bfa6702d010 Mon Sep 17 00:00:00 2001 +From: Carlos Matos +Date: Fri, 29 May 2020 13:59:32 -0400 +Subject: [PATCH] Use QT provided macro function to version check - deprecation + errors + +--- + src/SaveAsRPMDialog.cpp | 7 ++++++- + src/TailoringWindow.cpp | 14 ++++++++++++-- + 2 files changed, 18 insertions(+), 3 deletions(-) + +diff --git a/src/SaveAsRPMDialog.cpp b/src/SaveAsRPMDialog.cpp +index 611d15f..854396b 100644 +--- a/src/SaveAsRPMDialog.cpp ++++ b/src/SaveAsRPMDialog.cpp +@@ -86,7 +86,12 @@ void SaveAsRPMDialog::slotFinished(int result) + closure.remove(mScanningSession->getOpenedFilePath()); + QList closureOrdered; + closureOrdered.append(mScanningSession->getOpenedFilePath()); +- closureOrdered.append(closure.toList()); ++ #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) ++ closureOrdered.append(closure.values()); ++ #else ++ // support older versions where deprecation warning is not fatal ++ closureOrdered.append(closure.toList()); ++ #endif + + const QDir cwd = ScanningSession::getCommonAncestorDirectory(closure); + +diff --git a/src/TailoringWindow.cpp b/src/TailoringWindow.cpp +index ceced3e..e4081cf 100644 +--- a/src/TailoringWindow.cpp ++++ b/src/TailoringWindow.cpp +@@ -645,7 +645,12 @@ QString TailoringWindow::getQSettingsKey() const + void TailoringWindow::deserializeCollapsedItems() + { + const QStringList list = mQSettings->value(getQSettingsKey()).toStringList(); +- mCollapsedItemIds = QSet::fromList(list); ++ #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) ++ mCollapsedItemIds = QSet(list.begin(), list.end()); ++ #else ++ // support older versions where deprecation warning is not fatal ++ mCollapsedItemIds = QSet::fromList(list); ++ #endif + } + + void TailoringWindow::serializeCollapsedItems() +@@ -657,7 +662,12 @@ void TailoringWindow::serializeCollapsedItems() + } + else + { +- mQSettings->setValue(getQSettingsKey(), QVariant(mCollapsedItemIds.toList())); ++ #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) ++ mQSettings->setValue(getQSettingsKey(), QVariant(mCollapsedItemIds.values())); ++ #else ++ // support older versions where deprecation warning is not fatal ++ mQSettings->setValue(getQSettingsKey(), QVariant(mCollapsedItemIds.toList())); ++ #endif + mQSettings->setValue(getQSettingsKey() + "_lastUsed", QVariant(QDateTime::currentDateTime())); + } + } +-- +2.26.2 + diff --git a/SOURCES/scap-workbench-1.2.2-no-rpath-pr-285.patch b/SOURCES/scap-workbench-1.2.2-no-rpath-pr-285.patch new file mode 100644 index 0000000..e52d2a9 --- /dev/null +++ b/SOURCES/scap-workbench-1.2.2-no-rpath-pr-285.patch @@ -0,0 +1,42 @@ +From 99a496dd49d0e0035b12db43e09aa3ab144bbfbc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= +Date: Tue, 27 Jul 2021 11:14:23 +0200 +Subject: [PATCH] Do not set rpath + +See: https://fedoraproject.org/wiki/Changes/Broken_RPATH_will_fail_rpmbuild +Similar to: https://github.com/OpenSCAP/openscap/pull/1765 +--- + CMakeLists.txt | 17 ----------------- + 1 file changed, 17 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index fe33466..77bb3ae 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -128,23 +128,6 @@ set(SCAP_WORKBENCH_LINK_LIBRARIES + Qt5::Widgets Qt5::XmlPatterns + ${OPENSCAP_LIBRARIES}) + +-# ---------- RPATHS for linking +- +-# see https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling +- +-# when building, use the install RPATH +-# (but later on when installing) +-set(CMAKE_BUILD_WITH_INSTALL_RPATH ON) +- +-set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}) +- +-# add the automatically determined parts of the RPATH +-# which point to directories outside the build tree to the install RPATH +-set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) +- +-# Turn on RPATH for OSX +-set(CMAKE_MACOSX_RPATH ON) +- + configure_file("include/Config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/Config.h") + # It is not trivial to make the resulting file executable :-( + # People will have to `bash runwrapper.sh ...` in the meantime. +-- +2.31.1 + diff --git a/SOURCES/scap-workbench-1.2.2-replace-obsolete-Qstring-SkipEmptyParts-pr-266.patch b/SOURCES/scap-workbench-1.2.2-replace-obsolete-Qstring-SkipEmptyParts-pr-266.patch new file mode 100644 index 0000000..0d9582f --- /dev/null +++ b/SOURCES/scap-workbench-1.2.2-replace-obsolete-Qstring-SkipEmptyParts-pr-266.patch @@ -0,0 +1,50 @@ +From c4a7616b9c61acee077359e71db2b3ab4db8098b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= +Date: Wed, 7 Oct 2020 08:54:22 +0200 +Subject: [PATCH] Replace obsolete QString::SkipEmptyParts + +Starting from Qt 5.15, the enum QString::SplitBehavior is obsolete +and Qt::SplitBehavior should be used instead. +See: +https://doc.qt.io/qt-5.15/qstring-obsolete.html#SplitBehavior-enum +https://doc.qt.io/qt-5/qt.html#SplitBehaviorFlags-enum +--- + src/OscapCapabilities.cpp | 4 ++++ + src/RPMOpenHelper.cpp | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/src/OscapCapabilities.cpp b/src/OscapCapabilities.cpp +index 03099fb..83d75f7 100644 +--- a/src/OscapCapabilities.cpp ++++ b/src/OscapCapabilities.cpp +@@ -86,7 +86,11 @@ void OscapCapabilities::parse(const QString& mmv) + if (lines.size() < 1) + return; // TODO: Throw exception? + ++#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) ++ const QStringList firstLine = lines[0].split(' ', Qt::SkipEmptyParts); ++#else + const QStringList firstLine = lines[0].split(' ', QString::SkipEmptyParts); ++#endif + const QString& versionCandidate = firstLine.last(); + + if (!versionCandidate.contains(QRegExp("^([0-9]+\\.){2,}[0-9]+$"))) +diff --git a/src/RPMOpenHelper.cpp b/src/RPMOpenHelper.cpp +index b12f109..180571b 100644 +--- a/src/RPMOpenHelper.cpp ++++ b/src/RPMOpenHelper.cpp +@@ -54,7 +54,11 @@ RPMOpenHelper::RPMOpenHelper(const QString& path) + static QRegExp tailoringRE("^\\.\\/usr\\/share\\/xml\\/scap\\/[^\\/]+\\/tailoring-xccdf\\.xml+$"); + static QRegExp inputRE("^\\.\\/usr\\/share\\/xml\\/scap\\/[^\\/]+\\/[^\\/]+\\-(xccdf|ds)\\.xml+$"); + ++#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) ++ QStringList lines = proc.getStdErrContents().split('\n', Qt::SkipEmptyParts); ++#else + QStringList lines = proc.getStdErrContents().split('\n', QString::SkipEmptyParts); ++#endif + for (QStringList::const_iterator it = lines.constBegin(); it != lines.constEnd(); ++it) + { + const QString& line = *it; +-- +2.26.2 + diff --git a/SOURCES/scap-workbench-gcc11.patch b/SOURCES/scap-workbench-gcc11.patch new file mode 100644 index 0000000..5027c13 --- /dev/null +++ b/SOURCES/scap-workbench-gcc11.patch @@ -0,0 +1,13 @@ +diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp +index c9a0937..e811e83 100644 +--- a/src/MainWindow.cpp ++++ b/src/MainWindow.cpp +@@ -409,7 +409,7 @@ void MainWindow::openFile(const QString& path, bool reload) + + // Refill mFSWatch after opening file + mFSWatch->removePaths(mFSWatch->files()); +- for (const QString path : mScanningSession->getOriginalClosure()) ++ for (const QString &path : mScanningSession->getOriginalClosure()) + { + mFSWatch->addPath(path); + } diff --git a/SPECS/scap-workbench.spec b/SPECS/scap-workbench.spec new file mode 100644 index 0000000..c27687f --- /dev/null +++ b/SPECS/scap-workbench.spec @@ -0,0 +1,247 @@ +%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} + +Name: scap-workbench +Version: 1.2.1 +Release: 11%{?dist} +Summary: Scanning, tailoring, editing and validation tool for SCAP content + +License: GPLv3+ +URL: http://www.open-scap.org/tools/scap-workbench +Source0: https://github.com/OpenSCAP/scap-workbench/releases/download/%{version}/scap-workbench-%{version}.tar.bz2 +Patch1: scap-workbench-1.2.2-fix-qt-deprecated-pr-259.patch +Patch2: scap-workbench-1.2.2-replace-obsolete-Qstring-SkipEmptyParts-pr-266.patch +Patch3: %{name}-gcc11.patch +Patch4: scap-workbench-1.2.2-no-rpath-pr-285.patch + +BuildRequires: cmake >= 2.6 +BuildRequires: qt5-qtbase-devel >= 5.0.0 +BuildRequires: qt5-qtxmlpatterns-devel >= 5.0.0 +# Although releases usually contain compiled docs, builds from source via Packit need to generate those. +BuildRequires: asciidoc + +BuildRequires: openscap-devel >= 1.2.11 +BuildRequires: openscap-utils >= 1.2.11 +Requires: openscap-utils >= 1.2.11 +# ssh to scan remote machines +BuildRequires: openssh-clients +Requires: openssh-clients +Requires: openssh-askpass +# because of 'setsid' which we use to force ssh to use GUI askpass +BuildRequires: util-linux +Requires: util-linux +# for privileged local scanning +Requires: polkit +# default content +Requires: scap-security-guide +# fonts, see https://bugzilla.redhat.com/show_bug.cgi?id=1134418 +Requires: font(:lang=en) + +%description +scap-workbench is GUI tool that provides scanning functionality for SCAP +content. The tool is based on OpenSCAP library. + +%prep +%autosetup -p1 + +%build +%cmake +%cmake_build + +%install +%cmake_install + +%files +%{_bindir}/scap-workbench +%{_datadir}/applications/scap-workbench.desktop +%{_datadir}/scap-workbench/*.png +%{_datadir}/scap-workbench/translations/* +%{_libexecdir}/scap-workbench-oscap.sh +%{_libexecdir}/scap-workbench-pkexec-oscap.sh +%{_libexecdir}/scap-workbench-rpm-extract.sh +%{_datadir}/polkit-1/actions/scap-workbench-oscap.policy +%{_datadir}/pixmaps/scap-workbench.png +%{_datadir}/pixmaps/scap-workbench.svg +%{_datadir}/appdata/scap-workbench.appdata.xml +%doc %{_mandir}/man8/scap-workbench.8.gz +%doc %{_pkgdocdir}/user_manual.html +%doc %{_pkgdocdir}/COPYING +%doc %{_pkgdocdir}/README.md + +%changelog +* Tue Aug 10 2021 Mohan Boddu - 1.2.1-11 +- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags + Related: rhbz#1991688 + +* Tue Jul 27 2021 Jan Černý - 1.2.1-10 +- Do not set rpath (rhbz#1986352) + +* Fri Apr 16 2021 Mohan Boddu - 1.2.1-9 +- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 + +* Wed Jan 27 2021 Fedora Release Engineering - 1.2.1-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Fri Oct 16 2020 Jeff Law - 1.2.1-7 +- Use reference to avoid range-loop-construct diagnostic + +* Wed Oct 07 2020 Jan Černý - 1.2.1-6 +- Replace obsolete QString::SkipEmptyParts + +* Tue Aug 04 2020 Jan Černý - 1.2.1-5 +- Remove qt5-devel from "Requires" section + https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/WO625MVYEAAJNHNRLEEJDVZTIWMQOBRR/ +- Update for new CMake out of source builds + https://fedoraproject.org/wiki/Changes/CMake_to_do_out-of-source_builds +- Fix Qt5 deprecated symbols +- Fix FTBS in Rawhide/F33 (RHBZ#1865462) + +* Sat Aug 01 2020 Fedora Release Engineering - 1.2.1-4 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 1.2.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Thu Jan 30 2020 Fedora Release Engineering - 1.2.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Mon Jan 27 2020 Jan Černý - 1.2.1-1 +- Upgrade to the latest upstream release + +* Fri Jan 03 2020 Matěj Týč - 1.2.0-4 +- Added asciidoc as build-time dependency for Packit. + +* Fri Jul 26 2019 Fedora Release Engineering - 1.2.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sat Feb 02 2019 Fedora Release Engineering - 1.2.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Wed Jul 18 2018 Martin Preisler 1.2.0-1 +- Updated to new upstream release 1.2.0 +- Now using Qt5 + +* Sat Jul 14 2018 Fedora Release Engineering - 1.1.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Fri Feb 09 2018 Fedora Release Engineering - 1.1.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Fri Nov 10 2017 Martin Preisler 1.1.6-1 +- Updated to new upstream release 1.1.6 + +* Thu Aug 03 2017 Fedora Release Engineering - 1.1.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 1.1.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Mon Jun 19 2017 Martin Preisler 1.1.5-1 +- Updated to new upstream release 1.1.5 + +* Sat Feb 11 2017 Fedora Release Engineering - 1.1.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Tue Jan 17 2017 Martin Preisler - 1.1.4-2 +- Rebuilt for OpenSCAP 1.2.13 + +* Mon Jan 02 2017 Martin Preisler 1.1.4-1 +- Updated to new upstream release 1.1.4 + +* Mon Dec 12 2016 Martin Preisler 1.1.3-1 +- Updated to new upstream release 1.1.3 +- Bumped openscap requirement to 1.2.11 because of the remote resource warning + +* Mon Jun 20 2016 Martin Preisler 1.1.2-1 +- Updated to new upstream release 1.1.2 +- Removed SCL related bits + +* Thu Feb 04 2016 Fedora Release Engineering - 1.1.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Mon Nov 02 2015 Martin Preisler 1.1.1-2 +- Require English fonts (bz#1134418) +- Updated with latest upstream URLs +- Reorganized the spec a little + +* Tue Sep 29 2015 Martin Preisler 1.1.1-1 +- Updated to new upstream release 1.1.1-1 + +* Wed Jul 29 2015 Martin Preisler 1.1.0-4 +- Make BuildRequires more explicit by requiring qt >= 4.0.0 and cmake >= 2.6 + +* Fri Jun 19 2015 Fedora Release Engineering - 1.1.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat May 02 2015 Kalev Lember - 1.1.0-2 +- Rebuilt for GCC 5 C++11 ABI change + +* Tue Mar 24 2015 Martin Preisler 1.1.0-1 +- Updated to new upstream release 1.1.0 +- Added openssh-clients and util-linux to BuildRequires, workbench checks those + at configure time now +- Added scap-security-guide to Requires + +* Fri Jan 09 2015 Martin Preisler 1.0.3-1 +- Updated to new upstream release 1.0.3 + +* Thu Oct 30 2014 Martin Preisler 1.0.2-2 +- Fix RPM open functionality, see rhbz#1154039 + +* Wed Sep 24 2014 Martin Preisler 1.0.2-1 +- Updated to new upstream release 1.0.2 + +* Fri Sep 05 2014 Martin Preisler 1.0.1-1 +- Updated to new upstream release 1.0.1 + +* Mon Aug 18 2014 Fedora Release Engineering - 1.0.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Fri Jun 27 2014 Martin Preisler 1.0.0-1 +- Updated to new version + +* Tue Jun 10 2014 Martin Preisler 0.8.9-1 +- Updated to new version +- appdata is now available + +* Sun Jun 08 2014 Fedora Release Engineering - 0.8.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Wed Mar 26 2014 Martin Preisler 0.8.8-1 +- Updated to new version + +* Wed Feb 19 2014 Martin Preisler 0.8.7-1 +- Updated to new version + +* Thu Jan 30 2014 Martin Preisler 0.8.6-1 +- Updated to new version +- Require polkit + +* Mon Jan 20 2014 Martin Preisler 0.8.5-2 +- Require openssh-askpass for GUI openssh challenge responses + +* Fri Jan 10 2014 Martin Preisler 0.8.5-1 +- Updated to new version + +* Mon Dec 09 2013 Martin Preisler 0.8.4-1 +- Updated to new version + +* Fri Nov 29 2013 Martin Preisler 0.8.3-1 +- Updated to new version +- Added measures to deal with unversioned pkgdocdir in Fedora 20+ + +* Mon Nov 18 2013 Martin Preisler 0.8.2-2 +- Removed the openscap detection workaround, it is no longer needed with openscap 0.9.13 + +* Wed Oct 30 2013 Martin Preisler 0.8.2-1 +- Updated to new version +- Added a workaround to the cmake invocation because of faulty openscap .pc file + +* Fri Sep 20 2013 Martin Preisler 0.8.1-1 +- Updated to new version + +* Sun Aug 04 2013 Fedora Release Engineering - 0.8.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Jul 04 2013 Martin Preisler 0.8.0-1 +- Initial release of the rewritten workbench