Add support for automatic appdata() provides

Appdata files contain application information used by the AppStream
project. We generate two provides: appdata() to support enumeration
of all application packages and appdata(filenname) to make it easy
to link installed packages with appdata files.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
This commit is contained in:
Michael Schroeder 2013-10-02 15:11:33 +02:00 committed by Panu Matilainen
parent 4775f07b51
commit e6cadc6d5a
4 changed files with 24 additions and 3 deletions

View File

@ -5,7 +5,8 @@ include $(top_srcdir)/rpm.am
fattrsdir = $(rpmconfigdir)/fileattrs
fattrs_DATA = \
desktop.attr elf.attr font.attr libtool.attr perl.attr perllib.attr \
pkgconfig.attr python.attr ocaml.attr script.attr mono.attr
appdata.attr desktop.attr elf.attr font.attr libtool.attr perl.attr \
perllib.attr pkgconfig.attr python.attr ocaml.attr script.attr \
mono.attr
EXTRA_DIST = $(fattrs_DATA)

2
fileattrs/appdata.attr Normal file
View File

@ -0,0 +1,2 @@
%__appdata_provides %{_rpmconfigdir}/appdata.prov
%__appdata_path ^%{_datadir}/appdata/.*\\.appdata\\.xml$

View File

@ -18,7 +18,7 @@ EXTRA_DIST = \
find-php-provides find-php-requires \
mono-find-requires mono-find-provides \
ocaml-find-requires.sh ocaml-find-provides.sh \
pkgconfigdeps.sh libtooldeps.sh \
pkgconfigdeps.sh libtooldeps.sh appdata.prov \
fontconfig.prov desktop-file.prov script.req \
macros.perl macros.php macros.python

18
scripts/appdata.prov Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
#
# Transform appdata xml file into RPM appdata(filename) provides
#
# Author: Michael Schroeder <mls@suse.de>
# Based on other provides scripts from RPM
OLD_IFS="$IFS"
while read instfile ; do
case "$instfile" in
*.appdata.xml)
echo "appdata()"
echo "appdata(${instfile##*/appdata/})"
;;
esac
done
IFS=$OLD_IFS