Make metainfo and .desktop files spec compliant

This resolves bug #5890
This commit is contained in:
Matthias Klumpp 2017-01-20 23:54:31 +01:00
parent 44c0c7300e
commit 5af7165b40
2 changed files with 27 additions and 7 deletions

View File

@ -1,8 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- See https://wiki.gnome.org/GnomeGoals/AppDataGnomeSoftware -->
<application>
<id type="desktop">arduino.desktop</id>
<licence>CC-BY-SA</licence>
<!-- See https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html -->
<component type="desktop-application">
<id>cc.arduino.arduinoide.desktop</id>
<metadata_license>CC-BY-SA-3.0</metadata_license>
<name>Arduino IDE</name>
<summary>Open-source electronics prototyping platform</summary>
<description>
<p>
Arduino is an open-source electronics prototyping platform based
@ -15,10 +19,13 @@
to develop and upload code to compatible microcontrollers.
</p>
</description>
<screenshots>
<screenshot type="default" width="624" height="351">http://mavit.fedorapeople.org/appdata/arduino-screenshot.png</screenshot>
<screenshot width="704" height="396">http://mavit.fedorapeople.org/appdata/arduino-photo.jpg</screenshot>
</screenshots>
<url type="homepage">http://www.arduino.cc/</url>
<updatecontact>arduino.appdata.xml@mavit.org.uk</updatecontact>
</application>
<update_contact>arduino.appdata.xml@mavit.org.uk</update_contact>
</component>

View File

@ -6,7 +6,7 @@
# If called with the "-u" option, it will undo the changes.
# Resource name to use (including vendor prefix)
RESOURCE_NAME=arduino-arduinoide
RESOURCE_NAME=cc.arduino.arduinoide
# Get absolute path from which this script file was executed
# (Could be changed to "pwd -P" to resolve symlinks to their target)
@ -85,6 +85,9 @@ simple_install_f() {
mkdir -p "${HOME}/.local/share/applications"
cp "${TMP_DIR}/${RESOURCE_NAME}.desktop" "${HOME}/.local/share/applications/"
mkdir -p "${HOME}/.local/share/metainfo"
cp "${SCRIPT_PATH}/lib/appdata.xml" "${HOME}/.local/share/metainfo/${RESOURCE_NAME}.appdata.xml"
# Copy desktop icon if desktop dir exists (was found)
if [ -d "${XDG_DESKTOP_DIR}" ]; then
cp "${TMP_DIR}/${RESOURCE_NAME}.desktop" "${XDG_DESKTOP_DIR}/"
@ -137,14 +140,24 @@ xdg_uninstall_f() {
# Uninstall by simply removing desktop files (fallback), incl. old one
simple_uninstall_f() {
# delete legacy cruft .desktop file
if [ -f "${HOME}/.local/share/applications/arduino.desktop" ]; then
rm "${HOME}/.local/share/applications/arduino.desktop"
fi
# delete another legacy .desktop file
if [ -f "${HOME}/.local/share/applications/arduino-arduinoide.desktop" ]; then
rm "${HOME}/.local/share/applications/arduino-arduinoide.desktop"
fi
if [ -f "${HOME}/.local/share/applications/${RESOURCE_NAME}.desktop" ]; then
rm "${HOME}/.local/share/applications/${RESOURCE_NAME}.desktop"
fi
if [ -f "${HOME}/.local/share/metainfo/${RESOURCE_NAME}.appdata.xml" ]; then
rm "${HOME}/.local/share/metainfo/${RESOURCE_NAME}.appdata.xml"
fi
if [ -f "${XDG_DESKTOP_DIR}/arduino.desktop" ]; then
rm "${XDG_DESKTOP_DIR}/arduino.desktop"
fi