MetaInfo/Components: Difference between revisions

From KDE TechBase
No edit summary
Line 42: Line 42:
=== Component type ===
=== Component type ===
The ''type'' property of the '''<component/>''' root node can be empty. If the component provides a special software-product, such as a graphical application, font, codec or input-method, you may set the property accordingly. See also [[MetaInfo/DesktopApps| the DesktopApp metadata]].
The ''type'' property of the '''<component/>''' root node can be empty. If the component provides a special software-product, such as a graphical application, font, codec or input-method, you may set the property accordingly. See also [[MetaInfo/DesktopApps| the DesktopApp metadata]].
=== <id/> ===
A unique identifier for the component you want to publish. After you have set an identifier, please do not change it in future releases! In some cases, a good choice is the project's name, prefixed with "kde-".
=== <metadata_license/> ===
The '''<metadata_license>''' tag is indicating the content licence that you are releasing the one metadata XML file as. This is not typically the same as the project license.
It is a good idea to choose a permissive license for your metadata, so distributions can easily bundle it with metadata from other projects.
For more information, see the definition of the '''<project_license/>''' tag in the [http://www.freedesktop.org/software/appstream/docs/chap-AppStreamData.html#sect-AppStream-ASXML AppStream docs].
=== <project_license/> ===
The license your project is licensed under. This tag is the same as the tag defined in the [http://www.freedesktop.org/software/appstream/docs/chap-AppStreamData.html#sect-AppStream-ASXML AppStream docs], and the same rules for license names apply.
=== <name/> ===
A human-readable name of the published component.
=== <summary/> ===
A short summary of what your component is good for.

Revision as of 22:31, 17 April 2014

 
Under Construction
This is a new page, currently under construction!

Introduction

Every project which provides interfaces for external projects to use can publish them in a metadata document. A software-center might show these components as "technical items", but more importantly, by specifying this information other tools gain the ability to install for example missing libraries without knowing their exact package name. It is also possible for developers to specify just the component names their project depends on and having a distribution-independent tool installing all missing packages, to greatly simplify building software for the first time. The component metadata is also used to match upstream projects with distribution packages, so even if your project does not provide public interfaces, you may consider adding this metadata to your project.

The AppStream project provides a metadata XML specification for projects to specify all necessary data.

Projects wanting to make use of the metadata file should ship one or more XML files in /usr/share/appdata/%{id}.metainfo.xml.

File Specification

Sample File

The file should contain something like this:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2014 First Lastname <[email protected]> -->
<component>
  <id>ThreadWeaver</id>
  <metadata_license>CC0</metadata_license>
  <project_license>LGPL-2.1+</project_license>
  <name>ThreadWeaver</name>
  <summary>ThreadWeaver Library for the KDE Platform</summary>
  <description>
    <p>
      ThreadWeaver is a helper for multithreaded programming.
      It uses a job-based interface to queue tasks and execute them in an efficient way.
      You simply divide the workload into jobs, state the dependencies between the jobs and ThreadWeaver
      will work out the most efficient way of dividing the work between threads
      within a set of resource limits. 
    </p>
  </description>
  <url type="homepage">http://kde.org/</url>
  <url type="bugtracker">https://bugs.kde.org/buglist.cgi?product=frameworks-threadweaver&amp;component=general</url>
  <project_group>KDE</project_group>
  <provides>
    <library>libthreadweaver.so.4</library>
  </provides>
</component>

Component type

The type property of the <component/> root node can be empty. If the component provides a special software-product, such as a graphical application, font, codec or input-method, you may set the property accordingly. See also the DesktopApp metadata.

<id/>

A unique identifier for the component you want to publish. After you have set an identifier, please do not change it in future releases! In some cases, a good choice is the project's name, prefixed with "kde-".

<metadata_license/>

The <metadata_license> tag is indicating the content licence that you are releasing the one metadata XML file as. This is not typically the same as the project license. It is a good idea to choose a permissive license for your metadata, so distributions can easily bundle it with metadata from other projects. For more information, see the definition of the <project_license/> tag in the AppStream docs.

<project_license/>

The license your project is licensed under. This tag is the same as the tag defined in the AppStream docs, and the same rules for license names apply.

<name/>

A human-readable name of the published component.

<summary/>

A short summary of what your component is good for.