1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-02-26 20:54:22 +01:00

Merge pull request #5892 from ximion/master

Make metainfo and .desktop files spec compliant
This commit is contained in:
Martino Facchin 2017-02-08 12:47:07 +01:00 committed by GitHub
commit 0b549ef3c9
2 changed files with 40 additions and 9 deletions

View File

@ -1,8 +1,13 @@
<?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>
<developer_name>Arduino LLC</developer_name>
<name>Arduino IDE</name>
<summary>Open-source electronics prototyping platform</summary>
<description>
<p>
Arduino is an open-source electronics prototyping platform based
@ -15,10 +20,23 @@
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>
<screenshot type="default">
<image>https://mavit.fedorapeople.org/appdata/arduino-screenshot.png</image>
<caption>The Arduino IDE showing a simple example program</caption>
</screenshot>
<screenshot>
<image>https://mavit.fedorapeople.org/appdata/arduino-photo.jpg</image>
<caption>Arduino hardware being connected to a breadboard</caption>
</screenshot>
</screenshots>
<url type="homepage">http://www.arduino.cc/</url>
<updatecontact>arduino.appdata.xml@mavit.org.uk</updatecontact>
</application>
<url type="help">https://www.arduino.cc/en/Guide/HomePage</url>
<url type="bugtracker">https://github.com/arduino/Arduino/issues</url>
<url type="translate">https://github.com/arduino/Arduino/tree/master/arduino-core/src/processing/app/i18n</url>
<url type="donation">https://www.arduino.cc/en/Main/Contribute</url>
<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