Guidelines and HOWTOs/AppStream: Difference between revisions
(Random tweaks) |
No edit summary |
||
Line 5: | Line 5: | ||
Assuming your software is named "foo"... | Assuming your software is named "foo"... | ||
# Make sure your desktop file is reverse-domain-notation i.e. org.kde.foo | # Make sure your desktop file is reverse-domain-notation i.e. org.kde.foo | ||
## Your desktop file should be org.kde.foo.desktop. This is also your desktop-id, so | ## Your desktop file should be org.kde.foo.desktop. This is also your desktop-id, so whenever you may need that. It's basically your file name. | ||
## If you have a D-Bus service ... make sure that your D-Bus service name matches this or change your desktop file to match the service address (whichever seems more appropriate) | ## If you have a D-Bus service ... make sure that your D-Bus service name matches this or change your desktop file to match the service address (whichever seems more appropriate) | ||
## The name part 'foo' MUST be the name of your binary. If it should be different you need to either use [https://api.kde.org/frameworks/kcoreaddons/html/classKAboutData.html KAboutData::setDesktopFileName()] or, if not using KAboutData, [https://doc.qt.io/qt-5/qguiapplication.html#desktopFileName-prop QGuiApplication::setDesktopFileName()] to set the desktop file name you are using for the app's runtime metadata | ## The name part 'foo' MUST be the name of your binary. If it should be different you need to either use [https://api.kde.org/frameworks/kcoreaddons/html/classKAboutData.html KAboutData::setDesktopFileName()] or, if not using KAboutData, [https://doc.qt.io/qt-5/qguiapplication.html#desktopFileName-prop QGuiApplication::setDesktopFileName()] to set the desktop file name you are using for the app's runtime metadata | ||
Line 32: | Line 32: | ||
{{Input|<syntaxhighlight lang="xml"> | {{Input|<syntaxhighlight lang="xml"> | ||
<?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||
<component type="desktop"> | <component type="desktop-application"> | ||
<id>org.kde.$NAME | <id>org.kde.$NAME</id> | ||
<metadata_license> | <metadata_license>FSFAP</metadata_license> | ||
<project_license> see https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-metadata_license </project_license> | <project_license> see https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-metadata_license </project_license> | ||
<name>$NAME</name> | <name>$NAME</name> | ||
Line 50: | Line 50: | ||
<url type="bugtracker">https://bugs.kde.org/enter_bug.cgi?format=guided&product=$YOURPRODUCTNAME</url> | <url type="bugtracker">https://bugs.kde.org/enter_bug.cgi?format=guided&product=$YOURPRODUCTNAME</url> | ||
<url type="donation">https://www.kde.org/community/donations/?app=$YOURBINARYNAME</url> | <url type="donation">https://www.kde.org/community/donations/?app=$YOURBINARYNAME</url> | ||
<launchable type="desktop-id">org.kde.$NAME.desktop optional, see https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-launchable </launchable> | |||
<screenshots> | <screenshots> | ||
<screenshot type="default"> | <screenshot type="default"> |
Revision as of 13:59, 6 March 2018
Quick guide on how to AppStream your app. For a more in-depth overview hop on over to Techbase.
Checklist
Assuming your software is named "foo"...
- Make sure your desktop file is reverse-domain-notation i.e. org.kde.foo
- Your desktop file should be org.kde.foo.desktop. This is also your desktop-id, so whenever you may need that. It's basically your file name.
- If you have a D-Bus service ... make sure that your D-Bus service name matches this or change your desktop file to match the service address (whichever seems more appropriate)
- The name part 'foo' MUST be the name of your binary. If it should be different you need to either use KAboutData::setDesktopFileName() or, if not using KAboutData, QGuiApplication::setDesktopFileName() to set the desktop file name you are using for the app's runtime metadata
- Create a file org.kde.foo.appdata.xml in your source tree
- Paste the template you can find below (see section Template) into that file
- Make sure you replaced all place holders from the template
- Take some screenshots and put them in the git repo kde:websites/product-screenshots (note the README.md)
- Add the CDN links to your screenshots to the appdata.xml file.
- Install the file via CMake (KDE_INSTALL_METAINFODIR is defined by KDEInstallDirs from extra-cmake-modules)
install(FILES org.kde.foo.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
- Validate your appdata using the appstreamcli helper
appstreamcli validate org.kde.foo.appdata.xml
- Validate your installed tree using the helper in your build directory
make make install DESTDIR=root appstreamcli validate-tree root rm -r root
- If all looks good commit and push
- If you have any questions submit a review and make sure to subscribe sitter and mak
Template
Carefully review all fields and replace all $VARIABLES ($NAME with your application name as seen in the reverse domain notation). Where appropriate the fields have URLs of respective AppStream documentation to help you find out what to put there.
<?xml version="1.0" encoding="utf-8"?> <component type="desktop-application"> <id>org.kde.$NAME</id> <metadata_license>FSFAP</metadata_license> <project_license> see https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-metadata_license </project_license> <name>$NAME</name> <summary> see https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-summary </summary> <description> <p> see https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-description </p> <p>And see.</p> <p>And see:</p> <ul> <li>this</li> <li>that</li> </ul> </description> <url type="homepage">https://www.kde.org</url> <url type="bugtracker">https://bugs.kde.org/enter_bug.cgi?format=guided&product=$YOURPRODUCTNAME</url> <url type="donation">https://www.kde.org/community/donations/?app=$YOURBINARYNAME</url> <launchable type="desktop-id">org.kde.$NAME.desktop optional, see https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-launchable </launchable> <screenshots> <screenshot type="default"> <image> see https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-screenshots Central hosting for uploading at https://phabricator.kde.org/source/websites-product-screenshots/ Central URL to use here https://cdn.kde.org/screenshots/... </image> </screenshot> </screenshots> <provides> <binary>$YOURBINARYNAME</binary> </provides> <project_group>KDE</project_group> </component>