-
Notifications
You must be signed in to change notification settings - Fork 118
/
Copy pathmetainfo-component.xml
1718 lines (1626 loc) · 80.6 KB
/
metainfo-component.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?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-GenericComponent">
<title>Generic Component</title>
<section id="spec-component-introduction">
<title>Introduction</title>
<para>
For a distribution, it is good to know more about the content of a package. Which public interfaces (libraries? Python modules?) does it provide? Does it contain codecs? Does it
contain firmware? Fonts? An application?
All of this information can be used to automatically install missing software or to offer users a choice on what they want to install from a software center.
</para>
<para>
To provide this information, we created the <emphasis role="italic">metainfo</emphasis> files, which allow <emphasis role="bold">upstream projects</emphasis> to describe the content of their software package.
If a metainfo file contains a <literal><provides/></literal> tag, distributors must also ensure that the package providing the file contains all items referenced
by that statement, or is installed by a metapackage depending on packages which provide these items. This gives upstream projects a (very light) way to influence distributor packaging.
More information about that can be found below.
</para>
<para>
Several specialized component-metainfo files exist, for example for applications or fonts. These are all based on this generic component XML specification, and are described in the
following chapters.
</para>
</section>
<section id="spec-component-location">
<title>Filesystem locations</title>
<para>
Upstream projects can ship one or more metainfo files in <filename>/usr/share/metainfo/%{id}.metainfo.xml</filename>, where <literal>id</literal> is a unique
identifier of this specific component.
</para>
<note>
<para>
Component metadata of type <literal>desktop-application</literal> as described in <xref linkend="sect-Metadata-Application"/> can be installed
with an <filename>.appdata.xml</filename> extension as well for historical reasons.
AppStream implementations will read the XML files as long as they end up in the right location on the filesystem.
</para>
</note>
<important>
<title>Legacy Path</title>
<para>
AppStream tools scan the <filename>/usr/share/appdata/</filename> path for legacy compatibility as well. It should not be used
anymore by new software though, even on older Linux distributions (like RHEL 7 and Ubuntu 16.04 LTS) the metainfo path is well
supported.
Support for the legacy path will likely be dropped completely with a future AppStream 1.0 release.
</para>
</important>
</section>
<section id="spec-component-filespec">
<title>XML Specification</title>
<para>
The XML for a generic component definition starts with a <code><component></code> tag as the root element.
The <code><component></code> element must at least have an <literal>id</literal>, <literal>name</literal> and <literal>summary</literal> tag;
a <literal>provides</literal> tag with appropriate children is highly recommended.
</para>
<para>
In addition to the <literal>type</literal> attribute denoting the component type in case the component is not a <code>generic</code> component,
the <literal>component</literal> tag may also have a <literal>date_eol</literal> attribute that sets a date when the component stops to
be supported entirely (this may be the case for superseded legacy software like <code>org.python.python2</code>). The attribute value can be any
complete date or time in <ulink url="https://en.wikipedia.org/wiki/ISO_8601">ISO 8601</ulink>.
</para>
<para>
All possible tags which can be used with components of all types are:
</para>
<variablelist>
<varlistentry id="tag-id-generic">
<term><id/></term>
<listitem>
<para>
The <literal>id</literal> tag is a unique identifier for this component. It must contain only alphanumeric ASCII characters, dots, hyphens and underscores. Spaces are
not allowed. While hyphens are allowed for legacy compatibility, their usage is strongly discouraged to ensure interoperability of the AppStream ID with other tools such
as D-Bus (and thereby making the ID more generic and useful). For the same reason it is also strongly discouraged to start any segment of the ID with a digit.
Additionally, even though uppercase letters are permitted in a component-ID, it is strongly encouraged to only use lowercase letters for the ID.
</para>
<para>
The ID must follow a reverse-DNS scheme, consisting of <literal>{tld}.{vendor}.{product}</literal>, for example <code>org.kde.gwenview</code>
or <code>com.hugski.colorhug2</code>. Ownership of <literal>{vendor}.{tld}</literal> in the domain name system guarantees uniqueness of IDs.
</para>
<para>
To increase the uniqueness and to distinguish between different pieces of a software suite, it is suggested to append the type name to the component-id in these cases.
For example, one can use <code>com.hugski.colorhug2</code> for the client tools to control hardware, and <code>com.hugski.colorhug2.firmware</code> for the runtime firmware files.
</para>
<para>
Note that the value of this tag must be <emphasis>unique</emphasis> across all distributions and software deployment platforms.
In case it is not unique, distributors are expected to reject the conflicting components from inclusion into their metadata and notify the upstream projects about this issue.
</para>
<important>
<title>Escaping characters in the component ID</title>
<para>
To ensures the greatest possible compatibility of an AppStream ID, it is recommended to replace any hyphens in the ID in all but the last segment of it with underscores,
and prefix every leading digit of a segment with an underscore as well. Since the underscore is not a valid character in domain names, the uniqueness of the ID is kept.
For example, the ID <code>org.7-zip.7-zip</code> could become <code>org._7_zip._7-zip</code>.
</para>
</important>
</listitem>
</varlistentry>
<varlistentry id="tag-metadata_license">
<term><metadata_license/></term>
<listitem>
<para>
The <code><metadata_license/></code> tag indicates the content license that you are releasing the one
metainfo XML file under. This is typically not the same as the project license. Omitting the license value will
result in the metainfo data not being incorporated into metadata collections as used by Linux distributions.
This tag is required for all metainfo files.
</para>
<para>
The value of this tag has to be one of the recognized SPDX license IDs for <code><metadata_license/></code> tags, or a simple SPDX expression
(only <code>AND</code> and <code>OR</code> operators allowed) allowing the use of the metadata file under one of the recognized licenses.
</para>
<para>
We do recognize a set of <ulink url="https://en.wikipedia.org/wiki/Permissive_software_licence">permissive</ulink> licenses that have been vetted
for mutual compatibility. This is important in order to allow the metainfo metadata to be combined with arbitrary other data in one file.
While copyleft licenses like the GPL are great for code, it is not feasible to test every copyleft license for mutual compatibility and compliance
when combining metainfo metadata with other data into one larger assembly fully automatically.
</para>
<para>
Currently, the following licenses have been reviewed and can be used as metadata licenses:
</para>
<itemizedlist>
<listitem>
<para><literal>FSFAP</literal></para>
</listitem>
<listitem>
<para><literal>MIT</literal></para>
</listitem>
<listitem>
<para><literal>0BSD</literal></para>
</listitem>
<listitem>
<para><literal>CC0-1.0</literal></para>
</listitem>
<listitem>
<para><literal>CC-BY-3.0</literal></para>
</listitem>
<listitem>
<para><literal>CC-BY-4.0</literal></para>
</listitem>
<listitem>
<para><literal>CC-BY-SA-3.0</literal></para>
</listitem>
<listitem>
<para><literal>CC-BY-SA-4.0</literal></para>
</listitem>
<listitem>
<para><literal>GFDL-1.1</literal></para>
</listitem>
<listitem>
<para><literal>GFDL-1.2</literal></para>
</listitem>
<listitem>
<para><literal>GFDL-1.3</literal></para>
</listitem>
<listitem>
<para><literal>BSL-1.0</literal></para>
</listitem>
<listitem>
<para><literal>FTL</literal></para>
</listitem>
<listitem>
<para><literal>FSFUL</literal></para>
</listitem>
</itemizedlist>
<para>
The license codes correspond to the identifiers found at the <ulink url="https://spdx.org/licenses/">SPDX OpenSource License Registry</ulink>.
For instance, <literal>CC-BY-SA-3.0</literal> corresponds to the license at
<ulink url="https://creativecommons.org/licenses/by-sa/3.0/">creativecommons.org/licenses/by-sa/3.0</ulink>.
If you are looking for the simplest license to use for your metadata, using the <code>FSFAP</code> license is suggested.
</para>
</listitem>
</varlistentry>
<varlistentry id="tag-name">
<term><name/></term>
<listitem>
<para>
A human-readable name for this software component. For example, if the component ID was "libc", its name might be "GNU Standard C Library".
</para>
</listitem>
</varlistentry>
<varlistentry id="tag-summary">
<term><summary/></term>
<listitem>
<para>
A short summary of what this component does. If the component is "PackageKit", the summary could be "Provides a package-management abstraction layer".
This element is translatable.
</para>
</listitem>
</varlistentry>
<varlistentry id="tag-icon">
<term><icon/></term>
<listitem>
<para>
The <code><icon/></code> tag describes the component icon. It is mostly used for GUI applications (component-type <literal>desktop-application</literal>).
It can be of type <literal>stock</literal>, <literal>local</literal> or <literal>remote</literal>.
</para>
<para>
<literal>stock</literal> icons are loaded from the icon stock (the current or hicolor/locolor fallback themes).
The icon name must not include any file-extension or path.
</para>
<para>
<literal>local</literal> icons are loaded from a file in the filesystem.
They should specify a full file path.
This icon type may have <literal>width</literal> and <literal>height</literal>
properties. If targeting a hi-DPI screen, this icon type may have a <literal>scale</literal> property.
</para>
<para>
<literal>remote</literal> icons loaded from a remote URL. Currently, only HTTP/HTTPS urls are supported.
This icon type should have <literal>width</literal> and <literal>height</literal> properties.
If targeting a hi-DPI screen, this icon type may have a <literal>scale</literal> property.
</para>
<para>
The semantics of each property in the <code><icon/></code> tag are the same as for the <code><icon/></code> tag
for catalog metadata. See <xref linkend="tag-ct-icon"/>.
</para>
</listitem>
</varlistentry>
<varlistentry id="tag-description">
<term><description/></term>
<listitem>
<para>
A long description of this component. Some markup can be used.
</para>
<para>
Do not assume the format is HTML. This list contains all currently supported formatting options:
</para>
<itemizedlist>
<listitem>
<para>Paragraph (<literal>p</literal>)</para>
</listitem>
<listitem>
<para>Ordered list (<literal>ol</literal>), with list items (<literal>li</literal>)</para>
</listitem>
<listitem>
<para>Unordered list (<literal>ul</literal>), with list items (<literal>li</literal>)</para>
</listitem>
<listitem>
<para>
Within paragraphs and list items, emphasis (<literal>em</literal>) and inline code (<literal>code</literal>) text styles are supported.
The emphasis is commonly rendered in italic, while inline code is shown in a monospaced font.
</para>
</listitem>
<listitem>
<para>Nested lists are not supported</para>
</listitem>
</itemizedlist>
<para>
In MetaInfo files, this tag should be translated by-paragraph. For enumerations, items are translated individually as well, and not the
whole enumeration block. This means that in a translated file, only <literal><p/></literal> and <literal><li/></literal>
elements may carry an <literal>xml:lang</literal> property.
</para>
</listitem>
</varlistentry>
<varlistentry id="tag-categories">
<term><categories/></term>
<listitem>
<para>
This tag can contain one or more <code><category></code> entries, describing the categories this software component
is associated with.
This tag is usually applied to components of type <literal>desktop-application</literal>, but can be used with any component.
A list of valid category names can be found in the
<ulink url="https://specifications.freedesktop.org/menu-spec/latest/category-registry.html">Freedesktop menu specification</ulink>.
Example:
</para>
<programlisting language="XML"><![CDATA[<categories>
<category>Game</category>
<category>ArcadeGame</category>
</categories>]]></programlisting>
</listitem>
</varlistentry>
<varlistentry id="tag-keywords">
<term><keywords/></term>
<listitem>
<para>
This tag can contain one or more <code><keyword></code> children, describing keywords for the component,
to make it easier to find in a software center.
For translated keywords in metainfo files, the individual <literal>keyword</literal> tags should be translated.
</para>
<para>
Example:
</para>
<programlisting language="XML"><![CDATA[<keywords>
<keyword translate="no">IDE</keyword>
<keyword>development</keyword>
<keyword>programming</keyword>
<keyword xml:lang="de">entwicklung</keyword>
<keyword xml:lang="de">programmierung</keyword>
</keywords>]]></programlisting>
</listitem>
</varlistentry>
<varlistentry id="tag-url">
<term><url/></term>
<listitem>
<para>
Defines web URLs for this component. There are several different URL types allowed:
</para>
<variablelist>
<varlistentry>
<term>homepage</term>
<listitem>
<para>
Should be a link to the upstream homepage for the component.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>bugtracker</term>
<listitem>
<para>
Should point to the software's bug tracking system, for users to report new bugs.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>faq</term>
<listitem>
<para>
Should link a FAQ page for this software, to answer some of the most-asked questions in
detail, something which you cannot do in the component's description.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>help</term>
<listitem>
<para>
Should provide a web link to an online user's reference, a software manual or help page.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>donation</term>
<listitem>
<para>
URLs of this type should point to a webpage showing information on how to donate to
the described software project.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>translate</term>
<listitem>
<para>
URLs of this type should point to a webpage where users can submit or
modify translations of the upstream project.
</para>
<para>
Typically this should be a link to the project page in Weblate, Transifex or Zanata, but could also be a
link to an upstream-hosted wiki page describing how to send translations upstream.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>contact</term>
<listitem>
<para>
URLs of this type should allow the user to contact the developer.
</para>
<para>
This could for example be an HTTPS URL to an online form or a page describing how to contact the developer.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>vcs-browser</term>
<listitem>
<para>
URLs of this type should point to a webpage on which the user can browse the sourcecode.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>contribute</term>
<listitem>
<para>
URLs of this type should point to a webpage showing information on how to contribute to
the described software project.
</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry id="tag-launchable">
<term><launchable/></term>
<listitem>
<para>
This tag indicates possible methods to launch the software described in this component.
It is allowed to appear multiple times in MetaInfo data.
</para>
<para>
The <code><launchable/></code> tag has a required <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://specifications.freedesktop.org/desktop-entry-spec/latest/file-naming.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>
<varlistentry>
<term>cockpit-manifest</term>
<listitem>
<para>
The software can be launched from the menus of
the <ulink url="https://cockpit-project.org">Cockpit</ulink> admin interface.
The value of the tag is the name of a <ulink
url="https://cockpit-project.org/guide/latest/packages.html">Cockpit
package</ulink>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>url</term>
<listitem>
<para>
The application is a web site that is viewed through a browser.
The value of the tag is a direct HTTP/HTTPS URL that the browser must navigate to.
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
Example:
</para>
<programlisting language="XML"><![CDATA[<launchable type="desktop-id">org.gnome.sysprof2.desktop</launchable>]]></programlisting>
</listitem>
</varlistentry>
<varlistentry id="tag-releases">
<term><releases/></term>
<listitem>
<para>
The <code><![CDATA[<releases>]]></code> tag contains multiple <literal>release</literal> children that
themselves contain metadata about releases made for this software component.
The release information XML is described in-depth in <xref linkend="sect-Metadata-Releases"/>,
examples for a valid <literal>releases</literal> tag with artifacts are also provided there.
</para>
<para>
Release information can be embedded in the component's metainfo file, following the XML
description outlined in <xref linkend="sect-Metadata-Releases"/>. Alternatively, it can also
be split into its own metadata file as described in that section. In case of external metadata,
a <literal>releases</literal> tag must still be present in the component's metainfo file, and
must have a <literal>type</literal> property set to value <code>external</code> (if the <literal>type</literal>
property is missing, a value of <code>embedded</code> is implicitly assumed for it).
</para>
<para>
In case of external metadata, the <literal>releases</literal> tag may also have an <literal>url</literal>
property linking to a web location where the release XML can be found and updated separately from the
main component metadata. An <literal>url</literal> property must not be present without <literal>type</literal>
set to <code>external</code>.
</para>
<para>
Only HTTPS links are allowed for the web URL, and any <literal>artifact</literal> defined in a
release description from an external website should not be trusted without further verification, as external
release information can currently not be signed.
</para>
<para>
AppStream catalog metadata generators may choose to update the locally provided release information with the data from
the web location provided by the URL in <literal>url</literal>.
This allow projects to complete release localization after a release was made, or include further information that was
not yet available directly at release time.
The generated catalog XML data must be complete and must not contain references to external release information.
</para>
<para>
Example for a <literal>releases</literal> block that points to an external metadata file:
</para>
<programlisting language="XML"><![CDATA[<releases type="external" url="https://example.org/releases/org.example.myapp.releases.xml" />]]></programlisting>
<important>
<title>Local Release Data</title>
<para>
Please note that even if release data is external and also provided on a remote location, it also <emphasis>must</emphasis> be
available locally, installed as a file into <filename>/usr/share/metainfo/releases/%{cid}.releases.xml</filename>.
The local file may not contain all information (for example it may not have a complete release description or all translations),
but basic data such as the released versions and their release dates should be present.
</para>
<para>
It is an error to reference an external release data file, but not provide a local copy of it.
</para>
</important>
</listitem>
</varlistentry>
<varlistentry id="tag-provides">
<term><provides/></term>
<listitem>
<para>
The <literal>provides</literal> tag and its children describe the public interfaces this application provides.
A public interface can be anything which other applications, which are not part of the upstream project, can access or reference.
This includes binaries and libraries. Private interfaces should never be added to a <literal>provides</literal> tag.
</para>
<para>
A <literal>provides</literal> tag contains a number of children describing the type and name of the provided public interface items.
It is suggested that the build system auto-generates this tag and its children.
Currently allowed item types are listed below. If you miss something,
<ulink url="https://github.com/ximion/appstream/issues/new">file a bug against AppStream</ulink> so we can add the new type.
</para>
<variablelist>
<varlistentry>
<term><mediatype/></term>
<listitem>
<para>
Describes the media types (also known as MIME types) this software supports, meaning it can open, edit or otherwise handle them.
This tag is especially useful for generic components and addon-type components. For applications, the metadata may automatically
be fetched from their <filename>.desktop</filename> files by the distribution's metadata generator if a desktop-entry file is set
as <xref linkend="tag-launchable"/>.
Example:
</para>
<programlisting language="XML">
<![CDATA[<provides>
<mediatype>text/html</mediatype>
<mediatype>image/jpeg</mediatype>
<mediatype>application/rss+xml</mediatype>
</provides>]]></programlisting>
</listitem>
</varlistentry>
<varlistentry>
<term><library/></term>
<listitem>
<para>
Contains the name of a shared library placed in a publicly accessible library path, such as <filename>/usr/lib</filename>, <filename>/usr/lib/<triplet></filename>
or <filename>/lib</filename>.
For example, for the <literal>libappstream</literal> library, the value for <literal>library</literal> would be <code>libappstream.so.1</code>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><binary/></term>
<listitem>
<para>
Name of a binary installed into a location in <envar>PATH</envar>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><font/></term>
<listitem>
<para>
Full name of a font provided by this component. See <xref linkend="sect-Metadata-Fonts"/> for more information.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><modalias/></term>
<listitem>
<para>
A modalias glob representing the hardware types (for example USB, PCI, ACPI, DMI) this component handles.
Useful for installing printer drivers or other USB protocol drivers for smartphones, firmware, and
out of tree kernel drivers.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><firmware/></term>
<listitem>
<para>
This provided element is described in detail for the <literal>firmware</literal> component type, where it is mandatory.
Please see <xref linkend="tag-firmware-provides"/> for more information.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><python3/></term>
<listitem>
<para>
Name of a Python 3 module this component provides.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><dbus/></term>
<listitem>
<para>
Contains the well-known name of a D-Bus service as its value. The type of the service must be specified using the <literal>type</literal> property
of this tag. Allowed values are <code>user</code> and <code>system</code>.
</para>
<para>
Example:
</para>
<programlisting language="XML"><![CDATA[<provides>
<dbus type="system">org.freedesktop.packagekit</dbus>
</provides>]]></programlisting>
</listitem>
</varlistentry>
<varlistentry>
<term><id/></term>
<listitem>
<para>
Contains the component-ID of another software component. The presence of this tag indicates that the software component containing it is able to
provide all functionality of the one referenced in the <code><provides/> ↪ <id/></code> tag.
</para>
<para>
This is useful in case a component-id had to be renamed in the past, e.g. because its domain-name changed.
</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry id="tag-relations">
<term><requires/>, <recommends/> & <supports/></term>
<listitem>
<para>
The <literal>requires</literal> tag denotes an <emphasis>absolute</emphasis> requirement on a different entity.
For example, a component can require certain hardware to be present, require a specific minimum kernel version,
or another component to be installed first. If a requirement specified in a <literal>requires</literal> tag
is not met, AppStream clients should prevent the installation of the particular software component.
</para>
<para>
If it is not essential that a certain requirement is met by the system, but just recommended to be available, a
<literal>recommends</literal> tag should be used. In this case, AppStream clients should allow the installation of the software
component, but may display a warning before allowing the installation.
It is permissible, but not required, to prevent installation of software which does not have all items specified as
<literal>recommends</literal> met on the system that it is installed to.
</para>
<para>
Components may also set a <literal>supports</literal> tag. This is an even weaker relation than <literal>recommends</literal>,
and means the particular component can make use of certain hardware capabilities or other software if it is available, but will
also be usable if it is not.
</para>
<para>
A <literal>requires</literal>, <literal>recommends</literal> or <literal>supports</literal> tag contains children describing the type,
value and version relation of the required item.
Each child can have a <literal>version</literal> and a <literal>compare</literal> property, to allow depending on a certain minimal
version of the respective item.
The <literal>version</literal> property contains the version to be compared against, while the <literal>compare</literal> property contains
a two-letter code denoting how to compare the version of a present item with the version listed in the property.
If no <literal>compare</literal> property is given, but a <literal>version</literal> property is found, AppStream implementations should
implicitly assume a value of <code>ge</code> for comparison of the versions. The installed version is on the left side of the required version
when comparing them. See <xref linkend="sect-AppStream-Misc-VerCmp"/> for a description of the version comparison algorithm.
</para>
<para>
Possible two-letter codes for version comparisons are:
</para>
<itemizedlist>
<listitem><para><code>eq</code> - Equal to</para></listitem>
<listitem><para><code>ne</code> - Not equal to</para></listitem>
<listitem><para><code>lt</code> - Less than</para></listitem>
<listitem><para><code>gt</code> - Greater than</para></listitem>
<listitem><para><code>le</code> - Less than or equal to</para></listitem>
<listitem><para><code>ge</code> - Greater than or equal to</para></listitem>
</itemizedlist>
<para>
Please note that not all item types are valid for all relation types.
Generally valid item types are listed below, with information as for which relation kins they are valid.
</para>
<variablelist>
<varlistentry id="tag-relations-id">
<term><id/></term>
<listitem>
<para>
A relation to another software component. The value should be another component-ID. Example:
</para>
<programlisting language="XML"><![CDATA[<requires>
<id version="1.0" compare="ge">org.example.my_software</id>
</requires>]]></programlisting>
<para>Valid for: <literal>requires</literal>, <literal>recommends</literal>, <literal>supports</literal></para>
</listitem>
</varlistentry>
<varlistentry id="tag-relations-modalias">
<term><modalias/></term>
<listitem>
<para>
Check for specific hardware to be present via its modalias. The modalias may contain a wildcard expression.
Example:
</para>
<programlisting language="XML"><![CDATA[<recommends>
<modalias>usb:v1130p0202d*</modalias>
</recommends>]]></programlisting>
<para>Valid for: <literal>requires</literal>, <literal>recommends</literal>, <literal>supports</literal></para>
</listitem>
</varlistentry>
<varlistentry id="tag-relations-kernel">
<term><kernel/></term>
<listitem>
<para>
Check for a specific kernel to be running on the system. The kernel name is the output of <command>uname -s</command>.
Example:
</para>
<programlisting language="XML"><![CDATA[<requires>
<kernel version="4.14" compare="ge">Linux</kernel>
</requires>]]></programlisting>
<para>Valid for: <literal>requires</literal>, <literal>recommends</literal></para>
</listitem>
</varlistentry>
<varlistentry id="tag-relations-memory">
<term><memory/></term>
<listitem>
<para>
Set a relation to the amount of physical memory (RAM) the system should have to run the software component.
The memory size is set in MiB. You usually only want to use this with the <literal>recommends</literal> tag,
because users might want to install the software on systems even if they have a lesser amount of memory
compared to what would be ideal.
Example:
</para>
<programlisting language="XML"><![CDATA[<recommends>
<memory>2048</memory> <!-- recommend at least 2GiB of memory -->
</recommends>]]></programlisting>
<para>Valid for: <literal>requires</literal>, <literal>recommends</literal></para>
</listitem>
</varlistentry>
<varlistentry id="tag-relations-firmware">
<term><firmware/></term>
<listitem>
<para>
Depend on a specific device firmware. The value of this tag should either be a name like <literal>bootloader</literal>, be
empty to reference the firmware itself described by the <literal>firmware</literal>-type component this tag is contained in,
or contain a GUID.
This tag is commonly used and interpreted by the <ulink url="https://fwupd.org/">LVFS</ulink>.
Example:
</para>
<programlisting language="XML"><![CDATA[<requires>
<firmware compare="ge" version="0.1.2">6de5d951-d755-576b-bd09-c5cf66b27234</firmware>
<firmware compare="ge" version="0.1.2"/>
<firmware compare="ge" version="0.3.4">bootloader</firmware>
</requires>]]></programlisting>
<para>Valid for: <literal>requires</literal>, <literal>recommends</literal></para>
</listitem>
</varlistentry>
<varlistentry id="tag-relations-hardware">
<term><hardware/></term>
<listitem>
<para>
Require, recommend or support a specific system hardware configuration. The value of this item is a
<ulink url="https://docs.microsoft.com/en-us/windows-hardware/drivers/dashboard/using-chids">Computer Hardware ID (CHID)</ulink>
without any surrounding braces.
</para>
<para>
On Linux systems, the CHIDs of the system can be queried using the <command>sudo fwupdtool hwids</command> command.
</para>
<para>
This tag is commonly used and interpreted by the <ulink url="https://fwupd.org/">LVFS</ulink> and fwupd tool.
Example:
</para>
<programlisting language="XML"><![CDATA[<requires>
<hardware>be6ab11f-af5f-572e-be18-84301d880764</hardware>
</requires>]]></programlisting>
<para>Valid for: <literal>requires</literal>, <literal>recommends</literal>, <literal>supports</literal></para>
</listitem>
</varlistentry>
<varlistentry id="tag-relations-control">
<term><control/></term>
<listitem>
<para>
This item type can be used to indicate support for or require certain ways a user can control the software. This usually maps to certain methods
of input. If multiples <literal>control</literal> tags with different values are found within a requires/supports block, only one of them needs
to be satisfied on the system to mark an application as compatible. This means if <literal>touch</literal> and <literal>pointing</literal> are both
supported as controls for an application-type component, a system that only has a mouse and no touchscreen will still be considered able to run
the application. Valid values for this tag are:
</para>
<itemizedlist>
<listitem><para><code>pointing</code> - Input via mouse/cursors/other pointing devices is possible</para></listitem>
<listitem><para><code>keyboard</code> - Keyboard input is possible</para></listitem>
<listitem><para><code>console</code> - Control via a console / command-line interface</para></listitem>
<listitem><para><code>tablet</code> - Graphics tablet input</para></listitem>
<listitem><para><code>touch</code> - Input by touching a surface with fingers is possible</para></listitem>
<listitem><para><code>gamepad</code> - The component supports gamepads (any game controller with wheels/buttons/joysticks)</para></listitem>
<listitem><para><code>tv-remote</code> - Input via a TV remote (with arrow keys, number pad, other basic inputs) is supported.</para></listitem>
<listitem><para><code>voice</code> - The software can be controlled via voice recognition/activation</para></listitem>
<listitem><para><code>vision</code> - The software can be controlled by computer vision / visual object and sign detection</para></listitem>
</itemizedlist>
<para>
If a control type is <emphasis>supported</emphasis> (= in a <literal>supports</literal> block), it means the software supports the given method of user
input. As long as one of the input methods is available on the system, the software can be used. Installation on systems without the given control may
still be permitted, but the software may not be easily usable.
</para>
<para>
If a control type is <emphasis>recommended</emphasis> (= in a <literal>recommends</literal> block), it means the software prefers the given method of
user input. The software may still be installed if the input control method is not available, but functionality may be severely degraded.
</para>
<para>
If a control type is <emphasis>required</emphasis> (= in a <literal>requires</literal> block), the same applies, but the software installer should refuse
to install the software on devices which do not have at least one of the input methods. It is therefore advised to only use the <code>control</code> tag
in <code>supports</code> and possibly <code>recommends</code> blocks, and avoid to use it in <code>requires</code>.
</para>
<para>
For certain component types, some permitted controls are implicitly assumed: For <link linkend="sect-Metadata-Application">desktop-application</link>
and <link linkend="sect-Metadata-WebApplication">web-application</link> components, <literal>pointing</literal> and <literal>keyboard</literal> controls
are assumed supported, unless explicit support is defined by the metadata author.
For <link linkend="sect-Metadata-ConsoleApplication">console-application</link>, control via <literal>console</literal> is assumed.
</para>
<para>
For any other, non-application-like component types, the <literal>control</literal> relation item is currently considered unsupported.
</para>
<para>
Example control support block:
</para>
<programlisting language="XML"><![CDATA[<supports>
<control>pointing</control>
<control>keyboard</control>
<control>touch</control>
</supports>]]></programlisting>
<para>Valid for: <literal>requires</literal>, <literal>recommends</literal>, <literal>supports</literal></para>
</listitem>
</varlistentry>
<varlistentry id="tag-relations-display_length">
<term><display_length/></term>
<listitem>
<para>
Set a relation to the display length defined as an integer value in <emphasis>logical pixels</emphasis> (device pixels divided by scaling factor,
roughly equivalent to 0.26mm (1/96in), also known as device-independent pixels).
Setting the <literal>side</literal> property to either <code>shortest</code> or <code>longest</code> will apply the selected size constraint to
either the shortest or longest side of the display rectangle, with <code>shortest</code> being implicitly assumed if no value is set.
</para>
<note>
<title>About Pixel Dimensions</title>
<para>
One logical pixel (= device independent pixel) roughly corresponds to the visual angle of one pixel on a device with a pixel density of
96dpi and a distance from the observer of about 52cm, making the physical pixel about 0.26mm in size.
When using logical pixels as unit, they might not always map to exact physical lengths as their exact size is defined by the device providing
the display.
They do however accurately depict the maximum amount of pixels that can be drawn in the depicted direction on the device's display space.
</para>
</note>
<para>
Relations for the display length can be defined using a <literal>compare</literal> property as described in <xref linkend="tag-relations"/>.
If this property is not present, a value of <code>ge</code> (greater-or-equal) is implicitly assumed.
</para>
<note>
<title>Determining Device Types</title>
<para>
Please note that a display with a lot of vertical space may not be a television screen, but could also be a large gaming monitor.
Similar logic applies to the smaller screen sizes. Therefore, to indicate that an application runs well on a certain <emphasis>device</emphasis>
and not just on a certain <emphasis>display</emphasis>, additional metadata is needed, like the application's supported
input controls as defined via <xref linkend="tag-relations-control"/>.
</para>
</note>
<note>
<title>Sizes for Reference</title>
<para>
The sizes below are for reference if you do not know the exact dimensions your application will fit into,
and just need a rough guideline as to what device type you can expect at a given size:
</para>
<itemizedlist>
<listitem><para>Very small screens, as used in watches, wearables and other small-display devices: about <= 360px</para></listitem>
<listitem><para>Small screens often used in handheld devices, such as phone screens, small phablets: about < 768px</para></listitem>
<listitem><para>Screens in laptops, tablets: about >= 768px</para></listitem>
<listitem><para>Bigger computer monitors: about >= 1024px</para></listitem>
<listitem><para>Television screens, large projected images: about >= 3840px</para></listitem>
</itemizedlist>
</note>
<para>
This tag may appear up to four times to set a minimum and maximum dimension required.
If multiple displays are connected to a device, it is acceptable to test against either the largest screen attached to the device, or the combined
amount of display space (depending on what makes the most sense for the respective device / setup).
A software center application may test for the maximum possible resolution of an attached display, and not the currently set display resolution in case
it wants to check against hardware capability and not be influenced by user configuration.
</para>
<para>
If used in a <literal>requires</literal> block, this relation can be used to restrict an application to only be installable on systems which have a minimum
usable display length available for it. If used in a <literal>recommends</literal> block, the application will still be
installable, but the user may be shown a warning.
</para>
<para>
If no <literal>display_length</literal> relation is present, a minimum required display (<code>ge</code>) relation
of <code>768px</code> is implicitly assumed to preserve backwards compatibility (so applications capable of running on smaller screens
need to make their support for that configuration explicit).
</para>
<para>
Examples:
</para>
<programlisting language="XML"><![CDATA[<!-- recommend at least 600 logical pixels of space -->
<recommends>
<display_length compare="ge">600</display_length>
</recommends>
<!-- ensure this application is not run on a very large screen, or
very small screen (no tiny handhelds or television screens) -->
<requires>
<display_length compare="lt">3840</display_length>
<display_length compare="gt">360</display_length>
</requires>]]></programlisting>
<para>Valid for: <literal>requires</literal>, <literal>recommends</literal></para>
</listitem>
</varlistentry>
<varlistentry id="tag-relations-internet">
<term><internet/></term>
<listitem>
<para>
Require, recommend or support connectivity to the internet. The value of this item one of the following:
</para>
<itemizedlist>
<listitem><para>
<code>always</code> - Needs internet connectivity to work. If used in a <literal>recommends</literal> element,
then this indicates that the app can work without internet, but the experience will be degraded.
</para></listitem>
<listitem><para>
<code>offline-only</code> - Never uses the internet, even if it’s available.
</para></listitem>
<listitem><para>
<code>first-run</code> - Uses the internet the first time the application is run, but not normally afterwards.
</para></listitem>
</itemizedlist>
<para>
If the value of <literal><internet/></literal> is not <literal>offline-only</literal>, the <literal>bandwidth_mbitps</literal> attribute can be
set to a bandwidth (in Mbit/s) which is the minimum internet bandwidth needed for the application to be usable. If this attribute is not set, it’s
assumed that the application is usable with all internet connections.
</para>
<para>
Examples:
</para>
<programlisting language="XML"><![CDATA[<!-- always needs the internet -->
<requires>
<internet>always</internet>
</requires>
<!-- always needs the internet and has a degraded experience if it’s not at least 2Mbit/s -->
<requires>
<internet bandwidth_mbitps="2">always</internet>
</requires>
<!-- never uses the internet, even if available -->
<requires>
<internet>offline-only</internet>
</requires>