From 42a09ad02e7f51707927230ecd124938462d18c0 Mon Sep 17 00:00:00 2001 From: Peter Eszlari Date: Sun, 6 Dec 2020 15:38:41 +0100 Subject: [PATCH] Linux: rename metadata according to spec https://www.freedesktop.org/software/appstream/docs/sect-Metadata-Application.html https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s02.html#desktop-file-id --- CMakeLists.txt | 18 +++++----- debian/wireshark-qt.install | 2 +- ...ge.xml => org.wireshark.Wireshark-mime.xml | 36 +++++++++---------- ...desktop => org.wireshark.Wireshark.desktop | 2 +- ...ml => org.wireshark.Wireshark.metainfo.xml | 2 +- packaging/rpm/wireshark.spec.in | 12 +++---- tools/update-appdata.py | 10 +++--- wiretap/file_access.c | 2 +- 8 files changed, 42 insertions(+), 42 deletions(-) rename wireshark-mime-package.xml => org.wireshark.Wireshark-mime.xml (84%) rename wireshark.desktop => org.wireshark.Wireshark.desktop (99%) rename wireshark.appdata.xml => org.wireshark.Wireshark.metainfo.xml (97%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c1ab0a9a8..20be41a92c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3150,7 +3150,7 @@ if(LINUXDEPLOYQT_EXECUTABLE AND APPIMAGETOOL_EXECUTABLE) # https://github.com/probonopd/linuxdeployqt/wiki/Custom-wrapper-script-instead-of-AppRun add_custom_target(appimage-prep COMMAND ${LINUXDEPLOYQT_EXECUTABLE} - "${_ai_appdir}/usr/share/applications/wireshark.desktop" + "${_ai_appdir}/usr/share/applications/org.wireshark.Wireshark.desktop" ${_exe_args} COMMAND rm -f "${_ai_appdir}/AppRun" COMMAND install @@ -3233,28 +3233,28 @@ install(FILES ${SHARK_PUBLIC_HEADERS} # Install icons and other desktop files for Freedesktop.org-compliant desktops. if((BUILD_wireshark AND QT_FOUND) AND NOT (WIN32 OR APPLE)) - install(FILES wireshark-mime-package.xml + install(FILES org.wireshark.Wireshark-mime.xml DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/mime/packages" - RENAME wireshark.xml + RENAME org.wireshark.Wireshark.xml ) - install(FILES wireshark.appdata.xml - DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/appdata" + install(FILES org.wireshark.Wireshark.metainfo.xml + DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo" ) if(BUILD_wireshark AND QT_FOUND) - install(FILES wireshark.desktop + install(FILES org.wireshark.Wireshark.desktop DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications") endif() foreach(size 16 24 32 48 64 128 256) install(FILES image/wsicon${size}.png DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${size}x${size}/apps" - RENAME wireshark.png) + RENAME org.wireshark.Wireshark.png) install(FILES image/WiresharkDoc-${size}.png DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${size}x${size}/mimetypes" - RENAME application-wireshark-doc.png) + RENAME org.wireshark.Wireshark-mimetype.png) endforeach() install(FILES image/wsicon.svg DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps" - RENAME wireshark.svg) + RENAME org.wireshark.Wireshark.svg) endif() install( diff --git a/debian/wireshark-qt.install b/debian/wireshark-qt.install index f7412692d2..a31db40ac9 100644 --- a/debian/wireshark-qt.install +++ b/debian/wireshark-qt.install @@ -1,2 +1,2 @@ usr/bin/wireshark -usr/share/applications/wireshark.desktop +usr/share/applications/org.wireshark.Wireshark.desktop diff --git a/wireshark-mime-package.xml b/org.wireshark.Wireshark-mime.xml similarity index 84% rename from wireshark-mime-package.xml rename to org.wireshark.Wireshark-mime.xml index 6011284204..e1a074d5ea 100644 --- a/wireshark-mime-package.xml +++ b/org.wireshark.Wireshark-mime.xml @@ -24,13 +24,13 @@ NOTE: if you do add a MIME type here, don't forget to add it to the list - of MIME types handled by Wireshark in wireshark.desktop. + of MIME types handled by Wireshark in org.wireshark.Wireshark.desktop. --> Packet Capture (PCAP) - + @@ -47,7 +47,7 @@ Packet Capture (PCAPNG) - + @@ -64,7 +64,7 @@ Packet Capture (Snoop) - + @@ -74,7 +74,7 @@ Packet Capture (AIX iptrace) - + @@ -83,7 +83,7 @@ Packet Capture (Novell LANalyzer) - + @@ -94,7 +94,7 @@ Packet Capture (HP-UX nettl) - + @@ -106,7 +106,7 @@ Packet Capture (Radcom WAN/LAN Analyzer) - + @@ -114,7 +114,7 @@ Packet Capture (Savvius/Etherpeek/Airopeek tagged/v9) - + @@ -130,7 +130,7 @@ Packet Capture (Visual Networks) - + @@ -138,7 +138,7 @@ Packet Capture (Network Instruments Observer) - + @@ -148,7 +148,7 @@ Packet Capture (Accellent/InfoVista 5view) - + @@ -158,7 +158,7 @@ Packet Capture (Tektronix rf5) - + @@ -168,7 +168,7 @@ Packet Capture (Micropross mplog) - + @@ -178,21 +178,21 @@ Packet Capture (macOS PacketLogger) - + Packet Capture (Endace ERF) - + Packet Capture (IPFIX) - + @@ -200,7 +200,7 @@ Packet Capture (Ixia IxVeriWave) - + diff --git a/wireshark.desktop b/org.wireshark.Wireshark.desktop similarity index 99% rename from wireshark.desktop rename to org.wireshark.Wireshark.desktop index b2dcf85ff4..a880a50a33 100644 --- a/wireshark.desktop +++ b/org.wireshark.Wireshark.desktop @@ -101,7 +101,7 @@ Comment[sl]=Preučevalnik omrežnega prometa Comment[tr]=Ağ trafiği çözümleyicisi Comment[vi]=Trình phân tích giao thông mạng Comment[uk]=Аналізатор мережевого трафіку -Icon=wireshark +Icon=org.wireshark.Wireshark TryExec=wireshark Exec=wireshark %f Terminal=false diff --git a/wireshark.appdata.xml b/org.wireshark.Wireshark.metainfo.xml similarity index 97% rename from wireshark.appdata.xml rename to org.wireshark.Wireshark.metainfo.xml index 2e351a7460..4b7d8ea47f 100644 --- a/wireshark.appdata.xml +++ b/org.wireshark.Wireshark.metainfo.xml @@ -2,7 +2,7 @@ - wireshark.desktop + org.wireshark.Wireshark Wireshark Wireshark is the world's foremost protocol analyzer diff --git a/packaging/rpm/wireshark.spec.in b/packaging/rpm/wireshark.spec.in index f3b9634794..97b210cc4d 100644 --- a/packaging/rpm/wireshark.spec.in +++ b/packaging/rpm/wireshark.spec.in @@ -205,7 +205,7 @@ Requires(pre): shadow-utils BuildRequires: rpm >= 4.7.0 %endif -# NOTE: the below description has been copied to wireshark.appdata.xml (in the +# NOTE: the below description has been copied to org.wireshark.Wireshark.metainfo.xml (in the # top-level directory). %description Wireshark allows you to examine protocol data stored in files or as it is @@ -426,12 +426,12 @@ cd - # SUSE's packaging conventions # (https://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros#.25suse_update_desktop_file) # require this: -install -Dm 0644 %{buildroot}/usr/local/share/applications/wireshark.desktop %{buildroot}/usr/share/applications/wireshark.desktop +install -Dm 0644 %{buildroot}/usr/local/share/applications/org.wireshark.Wireshark.desktop %{buildroot}/usr/share/applications/org.wireshark.Wireshark.desktop %suse_update_desktop_file %{name} %else # Fedora's packaging guidelines (https://fedoraproject.org/wiki/Packaging:Guidelines) # require this (at least if desktop-file-install was not used to install it). -desktop-file-validate %{buildroot}%{_datadir}/applications/wireshark.desktop +desktop-file-validate %{buildroot}%{_datadir}/applications/org.wireshark.Wireshark.desktop %endif %endif @@ -519,11 +519,11 @@ update-mime-database %{_datadir}/mime &> /dev/null || : %if %{with qt5} %files qt %defattr(-,root,root) -%{_datadir}/applications/wireshark.desktop +%{_datadir}/applications/org.wireshark.Wireshark.desktop %if 0%{?suse_version} -/usr/share/applications/wireshark.desktop +/usr/share/applications/org.wireshark.Wireshark.desktop %endif -%{_datadir}/appdata/wireshark.appdata.xml +%{_datadir}/appdata/org.wireshark.Wireshark.metainfo.xml %{_datadir}/icons/hicolor/*/apps/* %{_datadir}/icons/hicolor/*/mimetypes/* %{_datadir}/mime/packages/wireshark.xml diff --git a/tools/update-appdata.py b/tools/update-appdata.py index 6584d4c229..cdb2d5fc81 100755 --- a/tools/update-appdata.py +++ b/tools/update-appdata.py @@ -1,16 +1,16 @@ #!/usr/bin/env python3 # -# update-appdata.py - Update the section of wireshark.appdata.xml. +# update-appdata.py - Update the section of org.wireshark.Wireshark.metainfo.xml. # # Wireshark - Network traffic analyzer # By Gerald Combs # Copyright 1998 Gerald Combs # # SPDX-License-Identifier: GPL-2.0-or-later -'''Update the tag in wireshark.appdata.xml +'''Update the tag in org.wireshark.Wireshark.metainfo.xml According to https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html -the tag in wireshark.appdata.xml should contain release +the tag in org.wireshark.Wireshark.metainfo.xml should contain release information sorted newest to oldest. As part of our release process, when we create release tag x.y.z, we tag @@ -22,7 +22,7 @@ v3.0.1 2019-04-08 release tag v3.0.2rc0 2019-04-08 next commit after v3.0.1 Find a list of release versions based on our most recent rc0 tag and -update the section of wireshark.appdata.xml accordingly. +update the section of org.wireshark.Wireshark.metainfo.xml accordingly. Assume that the tag for the most recent release doesn't exist and use today's date for it. ''' @@ -41,7 +41,7 @@ def main(): sys.exit(2) this_dir = os.path.dirname(__file__) - appdata_xml = os.path.join(this_dir, '..', 'wireshark.appdata.xml') + appdata_xml = os.path.join(this_dir, '..', 'org.wireshark.Wireshark.metainfo.xml') try: tag_cp = subprocess.run( diff --git a/wiretap/file_access.c b/wiretap/file_access.c index 48d2ba9925..e886cd06a7 100644 --- a/wiretap/file_access.c +++ b/wiretap/file_access.c @@ -341,7 +341,7 @@ wtap_get_all_capture_file_extensions_list(void) * NOTE: when adding file formats to this list you may also want to add them * to the following files so that the various desktop environments will * know that Wireshark can open the file: - * 1) wireshark-mime-package.xml (for freedesktop.org environments) + * 1) org.wireshark.Wireshark-mime.xml (for freedesktop.org environments) * 2) packaging/macosx/Info.plist.in (for macOS) * 3) packaging/nsis/AdditionalTasksPage.ini, packaging/nsis/common.nsh, * and packaging/wix/ComponentGroups.wxi (for Windows)