Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
283dcfac52
!7 Fix build error caused by gcc update to 12.3.1
From: @starlet-dx 
Reviewed-by: @wk333 
Signed-off-by: @wk333
2023-07-17 11:16:15 +00:00
starlet-dx
3d32a5e9fb Fix build error caused by gcc update to 12.3.1 2023-07-17 18:07:11 +08:00
openeuler-ci-bot
e71b48bb71
!6 [sync] PR-5: [sync] PR-4: update to 1.2.1
From: @openeuler-sync-bot 
Reviewed-by: @zhujianwei001 
Signed-off-by: @zhujianwei001
2022-04-07 06:32:15 +00:00
chen-jan
1dc4e443ba update to 1.2.1
(cherry picked from commit 35814e29b1d266d7bee5c9d23d63b3ea2130a90a)
(cherry picked from commit 6c135fa040ab027301d993c62c9a1135bf84c31a)
2022-04-06 20:15:09 +08:00
openeuler-ci-bot
e1354cb389 !3 add scap-workbench.yaml
Merge pull request !3 from 成子晗/master
2020-05-08 10:22:18 +08:00
chengzihan2
9653f3aeff add scap-workbench.yaml 2020-05-07 09:48:47 +08:00
chengzihan2
ee8c27f387 add scap-workbench.yaml 2020-05-06 16:38:31 +08:00
openeuler-ci-bot
2d7d7cea6d !1 Architecture select
Merge pull request !1 from 严志华/master
2019-12-28 11:55:22 +08:00
yanzh_h
723efbea24 Architecture select 2019-12-28 11:35:52 +08:00
dogsheng
de257493c1 Package init 2019-12-14 21:39:24 +08:00
10 changed files with 253 additions and 75 deletions

42
Do-not-set-rpath.patch Normal file
View File

@ -0,0 +1,42 @@
From 99a496dd49d0e0035b12db43e09aa3ab144bbfbc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= <jcerny@redhat.com>
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.30.0

View File

@ -1,36 +0,0 @@
# scap-workbench
#### Description
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
#### Software Architecture
Software architecture description
#### Installation
1. xxxx
2. xxxx
3. xxxx
#### Instructions
1. xxxx
2. xxxx
3. xxxx
#### Contribution
1. Fork the repository
2. Create Feat_xxx branch
3. Commit your code
4. Create Pull Request
#### Gitee Feature
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
4. The most valuable open source project [GVP](https://gitee.com/gvp)
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

View File

@ -1,39 +0,0 @@
# scap-workbench
#### 介绍
{**以下是码云平台说明,您可以替换此简介**
码云是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN。专为开发者提供稳定、高效、安全的云端软件开发协作平台
无论是个人、团队、或是企业,都能够用码云实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
#### 软件架构
软件架构说明
#### 安装教程
1. xxxx
2. xxxx
3. xxxx
#### 使用说明
1. xxxx
2. xxxx
3. xxxx
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
#### 码云特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

View File

@ -0,0 +1,50 @@
From c4a7616b9c61acee077359e71db2b3ab4db8098b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= <jcerny@redhat.com>
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.30.0

View File

@ -0,0 +1,64 @@
From 806be588a70349b1705a687d38b90bfa6702d010 Mon Sep 17 00:00:00 2001
From: Carlos Matos <cmatos@redhat.com>
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<QString> 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<QString>::fromList(list);
+ #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
+ mCollapsedItemIds = QSet<QString>(list.begin(), list.end());
+ #else
+ // support older versions where deprecation warning is not fatal
+ mCollapsedItemIds = QSet<QString>::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.30.0

View File

@ -0,0 +1,25 @@
From 51c0b300b0b1a0194628c4b84bb35885b21663ab Mon Sep 17 00:00:00 2001
From: Jeff Law <law@redhat.com>
Date: Tue, 23 Mar 2021 20:35:37 -0400
Subject: [PATCH] Use reference to avoid range-loop-construct diagnostic
Pulled from scap-workbench-1.2.1-7 in Fedora Rawhide.
Signed-off-by: Alexander Scheel <alex.scheel@canonical.com>
---
src/MainWindow.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
index 496e1724..bea7e754 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);
}

6
_constraints Normal file
View File

@ -0,0 +1,6 @@
<constraints>
<linux><version>
<min>4.0</min>
</version></linux>
</constraints>

Binary file not shown.

62
scap-workbench.spec Normal file
View File

@ -0,0 +1,62 @@
Name: scap-workbench
Version: 1.2.1
Release: 2
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: Use-QT-provided-macro-function-to-version-check-depr.patch
Patch2: Replace-obsolete-QString-SkipEmptyParts.patch
Patch3: Do-not-set-rpath.patch
# https://github.com/OpenSCAP/scap-workbench/commit/51c0b300b0b1a0194628c4b84bb35885b21663ab
Patch4: Use-reference-to-avoid-range-loop-construct-diagnostic.patch
BuildRequires: cmake >= 2.6 qt5-devel >= 5.0.0 openscap-devel >= 1.2.11 qt5-qtbase-devel >= 5.0.0 qt5-qtxmlpatterns-devel >= 5.0.0
BuildRequires: openscap-utils >= 1.2.11 openssh-clients util-linux asciidoc
Requires: openscap-utils >= 1.2.11 openssh-clients openssh-askpass
Requires: util-linux polkit scap-security-guide font(:lang=en)
%description
SCAP Workbench is a GUI tool that provides scanning, tailoring and
validation functionality for SCAP content. It uses openscap library
to access SCAP functionalities.
%package_help
%prep
%autosetup -n %{name}-%{version} -p1
%build
%cmake -D CMAKE_INSTALL_DOCDIR=%{_pkgdocdir} .
%make_build
%install
%make_install
%files
%defattr(-,root,root)
%license COPYING win32-LICENSE.rtf
%{_bindir}/scap-workbench
%{_libexecdir}/*.sh
%{_datadir}/pixmaps/*
%{_datadir}/scap-workbench/*
%{_datadir}/appdata/scap-workbench.appdata.xml
%{_datadir}/applications/scap-workbench.desktop
%{_datadir}/polkit-1/actions/scap-workbench-oscap.policy
%exclude %{_pkgdocdir}/COPYING
%files help
%defattr(-,root,root)
%doc %{_pkgdocdir}/README.md
%doc %{_pkgdocdir}/user_manual.html
%{_mandir}/man8/scap-workbench.8.gz
%changelog
* Mon Jul 17 2023 yaoxin <yao_xin001@hoperun.com> - 1.2.1-2
- Fix build error caused by gcc update to 12.3.1
* Wed Feb 16 2022 chenchen <chen_aka_jan@163.com> - 1.2.1-1
- Update to 1.2.1
* Mon Nov 25 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.2.0-2
- Package init

4
scap-workbench.yaml Normal file
View File

@ -0,0 +1,4 @@
version_control: github
src_repo: OpenSCAP/scap-workbench
tag_prefix: ^
seperator: .