• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

client/H07-Sep-2020-5,6924,708

contrib/H07-Sep-2020-196163

data/H07-Sep-2020-2,4512,159

docs/H07-Sep-2020-262216

libappstream-builder/H07-Sep-2020-8,9406,259

libappstream-glib/H03-May-2022-42,84228,384

po/H07-Sep-2020-34,00127,443

.travis.ymlH A D07-Sep-2020484 1511

AUTHORSH A D07-Sep-202080 32

COMMITMENTH A D07-Sep-20202 KiB4636

COPYINGH A D07-Sep-202025.9 KiB503418

MAINTAINERSH A D07-Sep-202037 21

NEWSH A D07-Sep-202065.1 KiB1,5001,282

README.mdH A D07-Sep-20208.5 KiB212168

RELEASEH A D07-Sep-2020939 4125

meson.buildH A D07-Sep-20204.4 KiB163139

zanata.xmlH A D07-Sep-2020431 1710

README.md

1AppStream-Glib
2==============
3
4This library provides GObjects and helper methods to make it easy to read and
5write AppStream metadata. It also provides a simple DOM implementation that
6makes it easy to edit nodes and convert to and from the standardized XML
7representation. It also supports reading of Debian-style DEP-11 metadata.
8
9What this library allows you to do:
10
11 * Read and write compressed AppStream XML files
12 * Read compressed Debian YAML files
13 * Add and search for applications in an application store
14 * Get screenshot image data and release announcements
15 * Easily retrieve the best application data for the current locale
16 * Efficiently interface with more heavy-weight parsers like expat
17
18For more information about what AppStream is, please see the wiki here:
19http://www.freedesktop.org/wiki/Distributions/AppStream/
20
21Getting Started
22---------------
23
24To install the libappstream-glib library you either need to install the
25`libappstream-glib` package from your distributor, or you can build a local
26copy. To do the latter just do:
27
28    dnf install docbook-utils gettext-devel glib-devel \
29                gobject-introspection-devel gperf gtk-doc gtk3-devel \
30                json-glib-devel libarchive-devel libsoup-devel \
31                libstemmer-devel libuuid-devel libyaml-devel \
32                meson rpm-devel
33    mkdir build && cd build
34    meson .. --prefix=/opt -Dbuilder=false
35    ninja
36
37Hacking
38-------
39
40If you want a new feature, or have found a bug or a way to crash this library,
41please report as much information as you can to the issue tracker:
42https://github.com/hughsie/appstream-glib/issues -- patches very welcome.
43
44New functionality or crash fixes should include a test in `libappstream-builder/
45as-self-test.c`
46to ensure we don't regress in the future. New functionality should also be
47thread safe and also not leak *any* memory for success or failure cases.
48
49Translations
50------------
51
52Translations of the natural language strings are managed through a
53third party translation interface, transifex.com.
54Newly added strings will be periodically uploaded there for translation,
55and any new translations will be merged back to the project source code.
56
57Please use [https://www.transifex.com/projects/p/appstream-glib/](https://www.transifex.com/projects/p/appstream-glib/) to contribute translations,
58rather than sending pull requests.
59
60AppStream-Builder
61=================
62
63appstream-builder is a tool that allows us to create AppStream metadata from a
64directory of packages.
65It is typically used when generating distribution metadata, usually at the same
66time as modifyrepo or createrepo.
67
68What this tool does:
69
70 * Searches a directory of packages and reads just the RPM header of each.
71 * If a package contains an interesting file, just the relevant files are
72   decompressed from the package archive.
73 * A set of plugins are run on the extracted files, and if these match certain
74   criteria `AsbApplication` objects are created.
75 * Any screenshots referenced are downloaded to a local cache.
76   This is optional and can be disabled with `--nonet`.
77 * When all the packages are processed, some of the `AsbApplication` objects are
78   merged into single applications. This is how fonts are collected.
79 * The `AsbApplication` objects are serialized to XML and written to a
80   compressed archive.
81 * Any application icons or screenshots referenced are written to a .tar archive.
82
83Getting Started
84---------------
85
86To run appstream-builder you either need to install the package containing the
87binary and data files, or you can build a local copy. To do the latter just do:
88
89    dnf install docbook-utils gettext-devel glib-devel \
90                gobject-introspection-devel gperf gtk-doc gtk3-devel \
91                libarchive-devel libsoup-devel \
92                libstemmer-devel libuuid-devel libyaml-devel \
93                meson rpm-devel rpm-devel
94    mkdir build && cd build
95    meson .. --prefix=/opt -Dbuilder=true
96    ninja
97
98To actually run the extractor you can do:
99
100    ./client/appstream-builder --verbose   \
101                      --max-threads=8 \
102                      --log-dir=/tmp/logs \
103                      --packages-dir=/mnt/archive/Megarpms/21/Packages \
104                      --temp-dir=/mnt/ssd/AppStream/tmp \
105                      --output-dir=./repodata \
106                      --screenshot-url=http://megarpms.org/screenshots/ \
107                      --basename="megarpms-21"
108
109Note: it is possible to use "globs" like `/mnt/archive/Megarpms/21/Packages*` to
110 match multiple directories or packages.
111
112This will output a lot of progress text. Now, go and make a cup of tea and wait
113patiently if you have a lot of packages to process. After this is complete
114you should finally see:
115
116    Writing ./repodata/megarpms-21.xml.gz
117    Writing ./repodata/megarpms-21-failed.xml.gz
118    Writing ./repodata/megarpms-21-ignore.xml.gz
119    Writing ./repodata/megarpms-21-icons.tar
120    Done!
121
122You now have two choices what to do with these files. You can either upload
123them with the rest of the metadata you ship (e.g. in the same directory as
124`repomd.xml` and `primary.sqlite.bz2`) which will work with Fedora 22 and later:
125
126    modifyrepo_c \
127        --no-compress \
128        /tmp/asb-md/appstream.xml.gz \
129        /path/to/repodata/
130    modifyrepo_c \
131        --no-compress \
132        /tmp/asb-md/appstream-icons.tar.gz \
133        /path/to/repodata/
134
135You can then do something like this in the megarpms-release.spec file:
136
137    Source1:   http://www.megarpms.org/temp/megarpms-20.xml.gz
138    Source2:   http://www.megarpms.org/temp/megarpms-20-icons.tar.gz
139
140    %install
141    DESTDIR=%{buildroot} appstream-util install %{SOURCE1} %{SOURCE2}
142
143This ensures that gnome-software can access both data files when starting up.
144
145What is an application
146----------------------
147
148Applications are defined in the context of AppStream as such:
149
150 * Installs a desktop file and would be visible in a desktop
151 * Has an metadata extractor (e.g. libappstream-builder/plugins/asb-plugin-gstre
152amer.c)
153   and includes an AppData file
154
155Guidelines for applications
156---------------------------
157
158These guidelines explain how we filter applications from a package set.
159
160First, some key words:
161 * **SHOULD**: The application should do this if possible
162 * **MUST**: The application or addon must do this to be included
163 * **CANNOT**: the application or addon must not do this
164
165The current rules of inclusion are thus:
166
167 * Icons **MUST** be installed in `/usr/share/pixmaps/*`, `/usr/share/icons/*`,
168   `/usr/share/icons/hicolor/*/apps/*`, or `/usr/share/${app_name}/icons/*`
169 * Desktop files **MUST** be installed in `/usr/share/applications/`
170   or `/usr/share/applications/kde4/`
171 * Desktop files **MUST** have `Name`, `Comment` and `Icon` entries
172 * Valid applications with `NoDisplay=true` **MUST** have an AppData file.
173 * Applications with `Categories=Settings`, `Categories=ConsoleOnly` or
174   `Categories=DesktopSettings` **MUST** have an AppData file.
175 * Applications **MUST** have had an upstream release in the last 5 years or
176   have an AppData file.
177 * Application icon **MUST** be available in 48x48 or larger
178 * Applications must have at least one main or additional category listed
179   in the desktop file or supply an AppData file.
180   See http://standards.freedesktop.org/menu-spec/latest/apa.html and
181   http://standards.freedesktop.org/menu-spec/latest/apas02.html for the
182   full `Categories` list.
183 * Codecs **MUST** have an AppData file
184 * Input methods **MUST** have an AppData file
185 * If included, AppData files **MUST** be valid XML
186 * AppData files **MUST** be installed into `/usr/share/metainfo`
187 * Application icons **CANNOT** use XPM or ICO format
188 * Applications **CANNOT** use obsolete toolkits such as GTK+-1.2 or QT3
189 * Applications that ship a desktop file **SHOULD** include an AppData file.
190 * Screenshots **SHOULD** be in 16:9 aspect ratio
191 * Application icons **SHOULD** have an alpha channel
192 * Applications **SHOULD** ship a 256x256 PNG format icon or scalable SVG
193 * Applications **SHOULD** ship a matching High Contrast icon
194 * Applications **SHOULD** not depend on other applications
195 * AppData files **SHOULD** include translations
196 * Desktop files **SHOULD** include translations
197
198Guidelines for fonts
199--------------------
200
201 * Fonts **MUST** have a valid MetaInfo file installed to /usr/share/appdata
202 * Fonts packaged in multiple packages **SHOULD** have multiple MetaInfo files
203 * Fonts families **SHOULD** only have one description section
204 * Fonts of different styles or weights of the same family **SHOULD** use `<exte
205nds>`
206 * MetaInfo files **SHOULD** include translations where possible
207
208License
209-------
210
211LGPLv2+
212