Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Add "service" components and their launchables #115

Merged
merged 1 commit into from Jun 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -29,6 +29,7 @@
<xi:include href="component.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="desktopapp.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="consoleapp.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="service.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="addon.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="font.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="codec.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
@@ -253,17 +253,55 @@
<term>&lt;launchable/&gt;</term>
<listitem>
<para>
This optional tag indicates a possible method to launch the software described in this component. At time, it only supports launching software by their desktop-id.
</para>
<para>
The <code>&lt;launchable/&gt;</code> tag has a essential <literal>type</literal> property indicating the system that is used to launch the application. At time, only
<code>desktop-id</code> is allowed as value, indicating that an application can be launched via a desktop file. The value of the tag is a
<ulink url="https://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#desktop-file-id">desktop-file id</ulink> in that case.
</para>
<para>
The <code>&lt;launchable/&gt;</code> tag is allowed to appear multiple times in the metainfo data. In case a software component has multiple launchable entries,
the software center might display a dialog to choose which entry to launch. If possible though, it should be avoided to add multiple <literal>launchable</literal> tags.
</para>
This optional tag indicates possible methods to launch the software described in this component.
It is allowed to appear multiple times in the metainfo data.
</para>

<para>
The <code>&lt;launchable/&gt;</code> tag has a essential <literal>type</literal> property indicating the system that is used to launch the component. The following types are allowed:
</para>
<variablelist>
<varlistentry>
<term>desktop-id</term>
<listitem>
<para>
The application can be launched via a desktop file. The value of the tag is a
<ulink url="https://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#desktop-file-id">desktop-file id</ulink>.
</para>
<para>
In case a software component has multiple launchable entries,
the software center might display a dialog to choose which entry to launch.
If possible though, it should be avoided to add multiple <literal>launchable</literal> tags of type <literal>desktop-id</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>service</term>
<listitem>
<para>
The software can be started, stopped, and monitored by the OS "init"
facility, such as systemd. The value of the tag is a name that can be
used with that facility, such as a systemd unit name.
</para>
<para>
Multiple <literal>launchable</literal> tags of type <literal>service</literal> are not
alternatives to start the same service, but the
component does contain multiple services that might all need to be
started.
</para>
<para>
Only those services should be listed as launchables that the user is
actually expected to start and stop manually. Services that are
started/stopped indirectly via dependencies of other services should
not be listed.
</para>
<para>
For systemd units, the services listed as launchables are expected to
support enabling and disabling.
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
Example:
</para>
@@ -0,0 +1,110 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "AppStream.ent">
%BOOK_ENTITIES;
]>

<section id="sect-Metadata-Service">
<title>Services</title>

<section id="spec-service-introduction">
<title>Introduction</title>
<para>
A service component is any software that is started and supervised by
the Operating Systems "init" facility, such as systemd.
</para>
<para>
The metadata described in this document is built upon the generic component metadata with fields specific for services (see <xref linkend="sect-Metadata-GenericComponent"/>).
All tags valid for a generic component are valid for a <literal>service</literal> component as well.
</para>
<para>
In order to enhance the available metadata about their services, projects shipping a service can ship one or more metainfo files
in <filename>/usr/share/metainfo/%{id}.metainfo.xml</filename>.
</para>

</section>

<section id="spec-service-filespec">
<title>File specification</title>

<para>
The basic structure for a generic component as described at <xref linkend="spec-component-filespec"/> applies.
Note that the XML root must have the <literal>type</literal> property set to <code>service</code>, while in a generic component this
property can be omitted. This clearly identified this metainfo document as describing a service.
</para>

<para>
The following list describes tags for <literal>service</literal> upstream metadata and provides some additional information about the values
the tags are expected to have.
If no information is given about a tag, refer to the respective tag in <xref linkend="sect-Metadata-GenericComponent"/>.
</para>

<variablelist>
<varlistentry id="tag-id-service-app">
<term>&lt;id/&gt;</term>
<listitem>
<para>
For services, the <code>&lt;id/&gt;</code> tag value must follow the AppStream ID naming conventions (it should be a reverse-DNS name).
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>&lt;metadata_license/&gt;</term>
<listitem>
<para>
The <code>&lt;metadata_license/&gt;</code> tag as described in <xref linkend="tag-metadata_license"/> must be present.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>&lt;name/&gt;</term>
<listitem>
<para>
A <literal>name</literal> must be present for services. See <xref linkend="tag-name"/> for a detailed description of this tag.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>&lt;summary/&gt;</term>
<listitem>
<para>
A <literal>summary</literal> must be present for services. See <xref linkend="tag-summary"/> for a detailed description of this tag.
</para>
</listitem>
</varlistentry>

<varlistentry id="tag-service-provides">
<term>&lt;provides/&gt; ↪ &lt;service/&gt;</term>
<listitem>
<para>
This tag is described in detail for generic components at <xref linkend="tag-provides"/>.
</para>
</listitem>
</varlistentry>

<varlistentry id="tag-service-launchable">
<term>&lt;launchable/&gt;</term>
<listitem>
<para>
This tag is described in detail for generic components at <xref linkend="tag-launchable"/>.
</para>
<para>
At least one launchable element with type "service" must be present.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make that "service" a <literal>service</literal>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not relevant anymore since the text has been removed.

The value is a name that can be used with the OS init facility to
start/stop and monitor the service.
</para>
</listitem>
</varlistentry>

</variablelist>

<para>
For a component of type <literal>service</literal>, the following tags are required and must always be present: <xref linkend="tag-id-service-app"/>,
<xref linkend="tag-metadata_license"/>, <xref linkend="tag-name"/>, <xref linkend="tag-summary"/>, <xref linkend="tag-service-provides"/>.
</para>

</section>
</section>