From fd6498712cdda8ecd9f1d89462300164dbe563bc Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Wed, 2 Oct 2013 15:11:33 +0200 Subject: [PATCH 3/3] 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. --- fileattrs/Makefile.am | 5 +++-- fileattrs/appdata.attr | 2 ++ scripts/Makefile.am | 2 +- scripts/appdata.prov | 18 ++++++++++++++++++ 4 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 fileattrs/appdata.attr create mode 100755 scripts/appdata.prov --- ./fileattrs/Makefile.am.orig 2013-10-02 16:21:01.966355169 +0000 +++ ./fileattrs/Makefile.am 2013-10-02 16:19:10.317355367 +0000 @@ -7,6 +7,7 @@ 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 \ - debuginfo.attr elflib.attr firmware.attr ksyms.attr sysvinit.attr + debuginfo.attr elflib.attr firmware.attr ksyms.attr sysvinit.attr \ + appdata.attr EXTRA_DIST = $(fattrs_DATA) --- ./fileattrs/appdata.attr.orig 2013-10-02 16:18:42.750355416 +0000 +++ ./fileattrs/appdata.attr 2013-10-02 16:18:42.750355416 +0000 @@ -0,0 +1,2 @@ +%__appdata_provides %{_rpmconfigdir}/appdata.prov +%__appdata_path ^%{_datadir}/appdata/.*\\.appdata\\.xml$ --- ./scripts/Makefile.am.orig 2013-10-02 16:18:21.679355453 +0000 +++ ./scripts/Makefile.am 2013-10-02 16:18:42.750355416 +0000 @@ -19,7 +19,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 \ sysvinitdeps.sh \ macros.perl macros.php macros.python --- ./scripts/appdata.prov.orig 2013-10-02 16:18:42.750355416 +0000 +++ ./scripts/appdata.prov 2013-10-02 16:18:42.750355416 +0000 @@ -0,0 +1,18 @@ +#!/bin/sh +# +# Transform appdata xml file into RPM appdata(filename) provides +# +# Author: Michael Schroeder +# 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 +