Fix appdata, .desktop and icons in accordance with the Freedesktop specs

Resolves: rhbz#2021212
This commit is contained in:
Evgeny Kolesnikov 2021-11-08 18:44:35 +01:00
parent d4a5c8bee5
commit b27a19d40e
3 changed files with 163 additions and 4 deletions

View File

@ -0,0 +1,73 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 77bb3ae9..5c42e733 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -263,14 +263,14 @@ install(FILES "man/scap-workbench.8"
install(DIRECTORY "share/scap-workbench"
DESTINATION "${CMAKE_INSTALL_DATADIR}")
-install(FILES "scap-workbench.desktop"
+install(FILES "scap_workbench.desktop"
DESTINATION "${CMAKE_INSTALL_DATADIR}/applications")
install(FILES "share/pixmaps/scap-workbench.png"
DESTINATION "${CMAKE_INSTALL_DATADIR}/pixmaps")
install(FILES "share/pixmaps/scap-workbench.svg"
DESTINATION "${CMAKE_INSTALL_DATADIR}/pixmaps")
-install(FILES "scap-workbench.appdata.xml"
- DESTINATION "${CMAKE_INSTALL_DATADIR}/appdata")
+install(FILES "org.open-scap.scap-workbench.appdata.xml"
+ DESTINATION "${CMAKE_INSTALL_DATADIR}/metainfo")
if (ASCIIDOC_EXECUTABLE)
file(GLOB USER_MANUAL_SCREENSHOTS "${CMAKE_CURRENT_SOURCE_DIR}/doc/user_manual/*.png")
diff --git a/scap-workbench.appdata.xml b/org.open-scap.scap-workbench.appdata.xml
similarity index 65%
rename from scap-workbench.appdata.xml
rename to org.open-scap.scap-workbench.appdata.xml
index d4288f3d..bed9b05c 100644
--- a/scap-workbench.appdata.xml
+++ b/org.open-scap.scap-workbench.appdata.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<application>
- <id type="desktop">scap-workbench.desktop</id>
+<component type="desktop">
+ <id>org.openscap.scap_workbench.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0+</project_license>
<name>SCAP Workbench</name>
@@ -23,10 +23,16 @@
</ul>
</description>
<screenshots>
- <screenshot type="default" width="1280" height="720">https://github.com/OpenSCAP/scap-workbench/raw/v1-1/doc/user_manual/default_content_opened.png</screenshot>
- <screenshot width="1280" height="720">https://github.com/OpenSCAP/scap-workbench/raw/v1-1/doc/user_manual/intro_screenshot.png</screenshot>
- <screenshot width="1280" height="720">https://github.com/OpenSCAP/scap-workbench/raw/v1-1/doc/user_manual/tailoring_undo_history.png</screenshot>
+ <screenshot type="default">
+ <image type="source" width="1280" height="720">https://github.com/OpenSCAP/scap-workbench/raw/v1-1/doc/user_manual/default_content_opened.png</image>
+ </screenshot>
+ <screenshot>
+ <image type="source" width="1280" height="720">https://github.com/OpenSCAP/scap-workbench/raw/v1-1/doc/user_manual/intro_screenshot.png</image>
+ </screenshot>
+ <screenshot>
+ <image type="source" width="1280" height="720">https://github.com/OpenSCAP/scap-workbench/raw/v1-1/doc/user_manual/tailoring_undo_history.png</image>
+ </screenshot>
</screenshots>
<url type="homepage">https://www.open-scap.org/tools/scap-workbench</url>
- <updatecontact>open-scap-list@redhat.com</updatecontact>
-</application>
+ <update_contact>open-scap-list@redhat.com</update_contact>
+</component>
diff --git a/scap-workbench.desktop b/scap_workbench.desktop
similarity index 95%
rename from scap-workbench.desktop
rename to scap_workbench.desktop
index 60b67e49..5b4bb899 100644
--- a/scap-workbench.desktop
+++ b/scap_workbench.desktop
@@ -7,4 +7,5 @@ TryExec=scap-workbench
Exec=scap-workbench
Icon=scap-workbench
Categories=System;
+Keywords=scap;
X-Desktop-File-Install-Version=0.3

View File

@ -0,0 +1,81 @@
From 408019f129027c120b71db3c029d5291e3275ea2 Mon Sep 17 00:00:00 2001
From: Evgeny Kolesnikov <ekolesni@redhat.com>
Date: Tue, 16 Nov 2021 00:08:32 +0100
Subject: [PATCH] Fix appdata, desktop and icons for Linux (Freedesktop)
Satisfy:
https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html#install_icons
https://freedesktop.org/software/appstream/docs/chap-Quickstart.html
---
CMakeLists.txt | 6 +++---
...ppdata.xml => org.open_scap.scap_workbench.appdata.xml | 5 +++--
...kbench.desktop => org.open_scap.scap_workbench.desktop | 8 ++++----
3 files changed, 10 insertions(+), 9 deletions(-)
rename org.open-scap.scap-workbench.appdata.xml => org.open_scap.scap_workbench.appdata.xml (92%)
rename scap_workbench.desktop => org.open_scap.scap_workbench.desktop (67%)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5c42e733..55eed972 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -263,13 +263,13 @@ install(FILES "man/scap-workbench.8"
install(DIRECTORY "share/scap-workbench"
DESTINATION "${CMAKE_INSTALL_DATADIR}")
-install(FILES "scap_workbench.desktop"
+install(FILES "org.open_scap.scap_workbench.desktop"
DESTINATION "${CMAKE_INSTALL_DATADIR}/applications")
install(FILES "share/pixmaps/scap-workbench.png"
DESTINATION "${CMAKE_INSTALL_DATADIR}/pixmaps")
install(FILES "share/pixmaps/scap-workbench.svg"
- DESTINATION "${CMAKE_INSTALL_DATADIR}/pixmaps")
-install(FILES "org.open-scap.scap-workbench.appdata.xml"
+ DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps")
+install(FILES "org.open_scap.scap_workbench.appdata.xml"
DESTINATION "${CMAKE_INSTALL_DATADIR}/metainfo")
if (ASCIIDOC_EXECUTABLE)
diff --git a/org.open-scap.scap-workbench.appdata.xml b/org.open_scap.scap_workbench.appdata.xml
similarity index 92%
rename from org.open-scap.scap-workbench.appdata.xml
rename to org.open_scap.scap_workbench.appdata.xml
index bed9b05c..191796b2 100644
--- a/org.open-scap.scap-workbench.appdata.xml
+++ b/org.open_scap.scap_workbench.appdata.xml
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
-<component type="desktop">
- <id>org.openscap.scap_workbench.desktop</id>
+<component type="desktop-application">
+ <id>org.open_scap.scap_workbench</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0+</project_license>
<name>SCAP Workbench</name>
<summary>A GUI tool that serves as an SCAP scanner and provides tailoring functionality for SCAP content</summary>
+ <launchable type="desktop-id">org.open_scap.scap_workbench.desktop</launchable>
<description>
<p>
The main goal of this application is to lower the initial barrier of using SCAP.
diff --git a/scap_workbench.desktop b/org.open_scap.scap_workbench.desktop
similarity index 67%
rename from scap_workbench.desktop
rename to org.open_scap.scap_workbench.desktop
index 5b4bb899..0d568b1d 100644
--- a/scap_workbench.desktop
+++ b/org.open_scap.scap_workbench.desktop
@@ -1,11 +1,11 @@
[Desktop Entry]
+Version=1.0
Type=Application
Name=SCAP Workbench
GenericName=SCAP Scanner and Profile Editor
-Comment=GUI tool that allows scanning both local and remote computers using SCAP content of your choice.
+Comment=GUI tool that allows scanning both local and remote computers using SCAP content of your choice
TryExec=scap-workbench
Exec=scap-workbench
Icon=scap-workbench
-Categories=System;
-Keywords=scap;
-X-Desktop-File-Install-Version=0.3
+Categories=System;Security;
+Keywords=SCAP;

View File

@ -2,7 +2,7 @@
Name: scap-workbench
Version: 1.2.1
Release: 11%{?dist}
Release: 12%{?dist}
Summary: Scanning, tailoring, editing and validation tool for SCAP content
License: GPLv3+
@ -12,6 +12,8 @@ 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
Patch5: scap-workbench-1.2.2-fix-appdata-pr-288.diff
Patch6: scap-workbench-1.2.2-fix-appdata-pr-295.patch
BuildRequires: cmake >= 2.6
BuildRequires: qt5-qtbase-devel >= 5.0.0
@ -52,7 +54,7 @@ content. The tool is based on OpenSCAP library.
%files
%{_bindir}/scap-workbench
%{_datadir}/applications/scap-workbench.desktop
%{_datadir}/applications/org.open_scap.scap_workbench.desktop
%{_datadir}/scap-workbench/*.png
%{_datadir}/scap-workbench/translations/*
%{_libexecdir}/scap-workbench-oscap.sh
@ -60,14 +62,17 @@ content. The tool is based on OpenSCAP library.
%{_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
%{_datadir}/icons/hicolor/scalable/apps/scap-workbench.svg
%{_datadir}/metainfo/org.open_scap.scap_workbench.appdata.xml
%doc %{_mandir}/man8/scap-workbench.8.gz
%doc %{_pkgdocdir}/user_manual.html
%doc %{_pkgdocdir}/COPYING
%doc %{_pkgdocdir}/README.md
%changelog
* Mon Nov 08 2021 Evgenii Kolesnikov <ekolesni@redhat.com> - 1.2.1-12
- Fix appdata (rhbz#2021212)
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1.2.1-11
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688