diff --git a/InstallAppdata.sh b/InstallAppdata.sh new file mode 100644 index 0000000..4f93f4f --- /dev/null +++ b/InstallAppdata.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +# Copyright (c) 2014 Dominique Leuenberger, Amsterdam, The Netherlands + +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: + +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +RPMMD=/repodata/ +YAST2=/suse/setup/descr + +# Cleanup existing appdata found on the system +for list in $(find /usr/share/app-info/xmls/*.xml.gz); do + appdata=$(basename ${list} .xml.gz) + appstream-util uninstall "${appdata}" 2>&1 > /dev/null +done + +# Install new appdata files +while ([ "$1" = "-R" ]); do + case $4 in + rpm-md) + appstream-util install-origin "$2" $6$RPMMD/*appdata.xml.gz $6$RPMMD/*app-icons.tar.gz 2>&1 > /dev/null + ;; + yast2) + appstream-util install-origin "$2" "$6$YAST2/appdata.xml.gz" "$6$YAST2/app-icons.tar.gz" 2>&1 > /dev/null + ;; + *) + echo "unknown repo type - Appstream data not considered" + esac + shift 6 +done + diff --git a/gnome-software.changes b/gnome-software.changes index ad40660..d740008 100644 --- a/gnome-software.changes +++ b/gnome-software.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Thu Oct 2 14:37:21 UTC 2014 - dimstar@opensuse.org + +- Drop PackageKit-branding-upstream Requires: PK 1.0.0 got a major + rework and dropped the DesktopFile database. So the 'openSUSE' + branded package is good enough. +- Add InstallAppdata.sh: the script is executed by libzypp whenever + some repos are refreshed. The script extracts the appstream data + from the repo metadata and installs it into the 'well known' + location on the file system (/usr/share/app-info). + ------------------------------------------------------------------- Tue Sep 23 10:01:30 UTC 2014 - dimstar@opensuse.org diff --git a/gnome-software.spec b/gnome-software.spec index f5cc5af..069d889 100644 --- a/gnome-software.spec +++ b/gnome-software.spec @@ -25,6 +25,7 @@ License: GPL-2.0+ Group: System/GUI/GNOME Url: https://wiki.gnome.org/Design/Apps/Software Source: http://download.gnome.org/sources/gnome-software/3.14/%{name}-%{version}.tar.xz +Source1: InstallAppdata.sh # PATCH-FEATURE-OPENSUSE gnome-software-PK-updates.patch dimstar@opensuse.org -- Switch to PackageKit Update provider instead of systemd offline updates. Patch0: gnome-software-PK-updates.patch BuildRequires: intltool >= 0.35.0 @@ -39,8 +40,6 @@ BuildRequires: pkgconfig(libsoup-2.4) BuildRequires: pkgconfig(libxslt) BuildRequires: pkgconfig(packagekit-glib2) >= 1.0.0 BuildRequires: pkgconfig(sqlite3) -# gnome-software requires ScanDesktopFiles=true in PK.conf, which openSUSE explicitly disables for performance reason. Users that want to test gnome-software (technical preview) will have to take this performance hit. -Requires: PackageKit-branding-upstream BuildRoot: %{_tmppath}/%{name}-%{version}-build %glib2_gsettings_schema_requires @@ -61,6 +60,8 @@ make %{?_smp_mflags} %install %make_install find %{buildroot}%{_libdir} -type f -name '*.la' -delete -print +# Install AppData zypp plugin +install -Dm 0755 %{S:1} %{buildroot}%{_prefix}/lib/zypp/plugins/appdata/$(basename %{S:1}) #suse_update_desktop_file gnome-software %find_lang %{name} @@ -97,6 +98,11 @@ find %{buildroot}%{_libdir} -type f -name '*.la' -delete -print #{_libexecdir}/gnome-software-service %{_mandir}/man1/%{name}.1%{?ext_man} %{_sysconfdir}/xdg/autostart/gnome-software-service.desktop +# zypp plugin triggering AppData update on repo refresh +%dir %{_prefix}/lib/zypp +%dir %{_prefix}/lib/zypp/plugins +%dir %{_prefix}/lib/zypp/plugins/appdata/ +%{_prefix}/lib/zypp/plugins/appdata/InstallAppdata.sh %files lang -f %{name}.lang