libzypp-plugin-appdata/libzypp-plugin-appdata.spec

96 lines
3.5 KiB
RPMSpec

#
# spec file for package libzypp-plugin-appdata
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: libzypp-plugin-appdata
Version: 1.0.1+git.20180327
Release: 0
Summary: Extend libzypp to handle AppStream metadata
License: MIT AND CC0-1.0
Group: System/Libraries
URL: https://wiki.gnome.org/Design/Apps/Software
Source0: openSUSE-appstream-%{version}.tar.xz
# appstreamcli is provided by the AppStream package
Requires: AppStream
# appstream-glib >= 0.3.6 is the first to correctly to appstream-util uninstall in /var/cache
Requires: appstream-glib >= 0.3.6
# appdata hook was introduced in libzypp 14.29.4
Requires: libzypp >= 14.29.4
# AsHelper is a python program with few dependencies
Requires: python3-cmdln
Requires: python3-createrepo_c
Requires(post): appstream-glib >= 0.3.6
# libzypp 16.13.1 was the version gaingin support for ZYPP_PLUGIN_APPDATA_FORCE_COLLECT
Requires(post): libzypp >= 16.13.1
Requires(post): python3-cmdln
Requires(post): python3-createrepo_c
Requires(post): zypper
# This is one way of providing valid appstream metadata to applications (currently the only implemented one)
Provides: appstream-provider
BuildArch: noarch
%description
This plugin extends libzypp to install AppStream metadata, as extracted from the
repository metadata, onto the file system in order to be picked up by
software centers.
%package -n openSUSE-appdata-extra
Summary: Additional Appstream Metadata
License: CC0-1.0
Group: Metapackages
%description -n openSUSE-appdata-extra
This package contains extra appstream metadata to be used by appstream-builder
%prep
%setup -q -n openSUSE-appstream-%{version}
%build
%install
# install the additional appstream metadata
install -m 0755 -d %{buildroot}%{_datadir}/appdata-extra
cp appdata-extra/*/* %{buildroot}%{_datadir}/appdata-extra/
# Install AppData zypp plugin
install -Dm 0755 InstallAppdata.sh %{buildroot}%{_prefix}/lib/zypp/plugins/appdata/InstallAppdata.sh
install -Dm 0755 AsHelper.py %{buildroot}%{_libexecdir}/AsHelper
%post
# On initial installation, we enforce an AppStream refresh
# ZYPP_PLUGIN_APPDATA_FORCE_COLLECT=1 instructs zypper to fire off the appdata plugin
# which normally would only happen on repo refresh; but for 'non-rolling' products,
# the default repos are all static and don't refresh. This would leave software centers
# in a unusable state
# Addresses https://bugzilla.opensuse.org/show_bug.cgi?id=1009745
if [ $1 == 1 ]; then
ZYPP_PLUGIN_APPDATA_FORCE_COLLECT=1 zypper -n lr >/dev/null 2>&1
fi
%files
# 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
%{_libexecdir}/AsHelper
%files -n openSUSE-appdata-extra
%{_datadir}/appdata-extra/
%changelog