Accepting request 241005 from GNOME:Factory

Addition of new appstream-glib library. Part of GNOME 3.14 stack,
but as it is new, it does not hurt to already push it now to
Factory... so we have it in time.

@coolo: this package actually contains appstream-builder: just like createrepo,
you can run it against a directory full of RPMs and it extracts a valid
appstream.xml.gz (plus icons) from it, which we should get published in our repo metadata
(for gnome-software and potentially other appstream based software centers).

Once this is in place (currently, there is a hack in place for Factory, but only based
on .desktop files, ignoring the actual shipped appdata.xml files), we will need zypper
to have a hook to perform appstream-util install <xml> <iconset> and enjoy the powers of it.

OBS-URL: https://build.opensuse.org/request/show/241005
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/appstream-glib?expand=0&rev=1
This commit is contained in:
Stephan Kulow 2014-07-20 08:49:45 +00:00 committed by Git OBS Bridge
parent d4c12471dc
commit 786bd508ed
7 changed files with 66 additions and 1681 deletions

View File

@ -1,14 +0,0 @@
<services>
<service name="tar_scm" mode="disabled">
<param name="url">https://github.com/hughsie/appstream-glib.git</param>
<param name="scm">git</param>
<param name="versionformat">0.7.5</param>
<param name="changesgenerate">enable</param>
<param name="revision">appstream_glib_0_7_5</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service name="set_version" mode="disabled"/>
</services>

View File

@ -1,4 +0,0 @@
<servicedata>
<service name="tar_scm">
<param name="url">https://github.com/hughsie/appstream-glib.git</param>
<param name="changesrevision">92722fe24b0ba165a65efc565aa52a372b440604</param></service></servicedata>

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:20e0464114d5ddea504f82dc5d5741ab02400d1691f58baa4b3d2101b842fb0a
size 1518664

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:eec264fd1b7acdf78bade15f6edcbfbcb3d1fced0251ecc3bbce8f558b6586d9
size 2230288

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
#
# spec file for package appstream-glib
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2014 Dominique Leuenberger, Amsterdam, The Netherlands
#
# All modifications and additions to the file contributed by third parties
@ -17,55 +17,35 @@
#
%define _build_from_vcs 1
Name: appstream-glib
Version: 0.7.5
Version: 0.2.2
Release: 0
Summary: AppStream Abstraction Library
License: LGPL-2.1+ AND GPL-2.0+
License: LGPL-2.1+
Group: System/Libraries
Url: http://people.freedesktop.org/~hughsient/appstream-glib/
Source0: %{name}-%{version}.tar.xz
Source1: openSUSE-appstream-process
BuildRequires: gcab >= 0.6
BuildRequires: gobject-introspection-devel
BuildRequires: gperf
Source: http://people.freedesktop.org/~hughsient/appstream-glib/releases/appstream-glib-0.2.2.tar.xz
BuildRequires: intltool >= 0.40.0
BuildRequires: libyaml-devel
BuildRequires: meson
BuildRequires: pkgconfig
BuildRequires: pkgconfig(gdk-pixbuf-2.0) >= 2.14
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(gio-unix-2.0)
BuildRequires: pkgconfig(rpm)
BuildRequires: pkgconfig(glib-2.0) >= 2.16.1
BuildRequires: pkgconfig(gmodule-2.0)
BuildRequires: pkgconfig(gobject-2.0)
BuildRequires: pkgconfig(gthread-2.0)
BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: pkgconfig(json-glib-1.0) >= 1.1.1
BuildRequires: pkgconfig(libarchive)
BuildRequires: pkgconfig(libgcab-1.0)
BuildRequires: pkgconfig(libsoup-2.4) >= 2.24
BuildRequires: pkgconfig(rpm)
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(uuid)
Requires: gcab
# Required in order to be able to convert .svg icons
Requires: gdk-pixbuf-loader-rsvg
%if %{_build_from_vcs}
BuildRequires: gnome-common
%else
# We still need some part to build the man pages
BuildRequires: xsltproc
%endif
Requires: pngquant >= 2.8
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
This library provides GObjects and helper methods to read and write
AppStream metadata. It also provides a DOM implementation to edit
nodes and convert to and from the standardized XML representation.
This library provides GObjects and helper methods to make it easy to read and write AppStream metadata.
It also provides a simple DOM implementation that makes it easy to edit nodes and
convert to and from the standardized XML representation.
This library allows to:
What this library allows you to do:
* Read and write compressed AppStream XML files
* Add and search for applications in an application store
@ -73,168 +53,113 @@ This library allows to:
* Easily retrieve the best application data for the current locale
* Efficiently interface with more heavy-weight parsers like expat
%package -n libappstream-glib8
%package -n libappstream-glib1
Summary: AppStream Abstraction Library
License: LGPL-2.1+
Group: System/Libraries
%description -n libappstream-glib8
This library provides GObjects and helper methods to read and write
AppStream metadata. It also provides a DOM implementation to edit
nodes and convert to and from the standardized XML representation.
%description -n libappstream-glib1
This library provides GObjects and helper methods to make it easy to read and write AppStream metadata.
It also provides a simple DOM implementation that makes it easy to edit nodes and
convert to and from the standardized XML representation.
%package -n libappstream-builder8
What this library allows you to do:
* Read and write compressed AppStream XML files
* Add and search for applications in an application store
* Get screenshot image data and release announcements
* Easily retrieve the best application data for the current locale
* Efficiently interface with more heavy-weight parsers like expat
%package -n libappstream-builder1
Summary: AppStream Abstraction Library
License: LGPL-2.1+
Group: System/Libraries
%description -n libappstream-builder8
This library provides GObjects and helper methods to read and write
AppStream metadata. It also provides a DOM implementation to edit
nodes and convert to and from the standardized XML representation.
%description -n libappstream-builder1
This library provides GObjects and helper methods to make it easy to read and write AppStream metadata.
It also provides a simple DOM implementation that makes it easy to edit nodes and
convert to and from the standardized XML representation.
%package -n typelib-1_0-AppStreamBuilder-1_0
Summary: Introspection bindings for the AppStream abstraction library
License: LGPL-2.1+
Group: System/Libraries
What this library allows you to do:
%description -n typelib-1_0-AppStreamBuilder-1_0
This library provides GObjects and helper methods to read and write
AppStream metadata. It also provides a DOM implementation to edit
nodes and convert to and from the standardized XML representation.
%package -n typelib-1_0-AppStreamGlib-1_0
Summary: Introspection bindings for the AppStream abstraction library
License: LGPL-2.1+
Group: System/Libraries
%description -n typelib-1_0-AppStreamGlib-1_0
This library provides GObjects and helper methods to read and write
AppStream metadata. It also provides a DOM implementation to edit
nodes and convert to and from the standardized XML representation.
* Read and write compressed AppStream XML files
* Add and search for applications in an application store
* Get screenshot image data and release announcements
* Easily retrieve the best application data for the current locale
* Efficiently interface with more heavy-weight parsers like expat
%package devel
Summary: Development files for the AppStream abstraction library
License: LGPL-2.1+ AND GPL-2.0+
Summary: AppStream Abstraction Library -- Development files
Group: Development/Languages/C and C++
Requires: %{name} = %{version}
Requires: libappstream-builder8 = %{version}
Requires: libappstream-glib8 = %{version}
Requires: typelib-1_0-AppStreamBuilder-1_0 = %{version}
Requires: typelib-1_0-AppStreamGlib-1_0 = %{version}
# appdata-tools was consumed into appstream-glib and is no longer maintained upstream
Obsoletes: appdata-tools < 0.1.9
Provides: appdata-tools = 0.1.9
# Also obsolete the -lang package; or we end up with strange conflicts
Obsoletes: appdata-tools-lang < 0.1.9
Requires: libappstream-builder1 = %{version}
Requires: libappstream-glib1 = %{version}
%description devel
This library provides GObjects and helper methods to read and write
AppStream metadata. It also provides a DOM implementation to edit
nodes and convert to and from the standardized XML representation.
This library provides GObjects and helper methods to make it easy to read and write AppStream metadata.
It also provides a simple DOM implementation that makes it easy to edit nodes and
convert to and from the standardized XML representation.
This library allows to:
What this library allows you to do:
* Read and write compressed AppStream XML files
* Add and search for applications in an application store
* Get screenshot image data and release announcements
* Easily retrieve the best application data for the current locale
* Efficiently interface with more heavy-weight parsers like expat
%package -n openSUSE-appstream-process
Summary: Appstream processor employed by kiwi
License: LGPL-2.1+ AND GPL-2.0+
Group: Development/Tools/Building
Requires: appstream-glib >= %{version}
Requires: openSUSE-appdata-extra
%description -n openSUSE-appstream-process
A wrapper around appstream-builder, called by kiwi in order to produce AppStream metadata
for the repositories to be published
%lang_package
%prep
%setup -q
%build
%{meson} \
-Drpm=true \
-Dgtk-doc=true \
-Dstemmer=false \
%{nil}
%{meson_build}
%configure \
--disable-static \
--enable-rpm
make %{?_smp_mflags}
%install
%{meson_install}
# We don't care for 'installed tests'; that's used by GNOME Smoke Testing.
rm %{buildroot}%{_datadir}/installed-tests/appstream-glib/*.test
%make_install
find %{buildroot} -type f -name "*.la" -delete -print
# install the appstream process script to be used by kiwi
install -d -m 0755 %{_buildroot}%{_bindir}
install -m 0755 -D %{SOURCE1} %{buildroot}%{_bindir}/$(basename %{SOURCE1})
%find_lang %{name}
%check
if make %{?_smp_mflags} check; then
echo CHECKS passed
exit 0
else
echo CHECKS failed... dumping log file
find -name test-suite.log -exec cat {} +
exit 0
fi
%post -n libappstream-glib1 -p /sbin/ldconfig
%post -n libappstream-glib8 -p /sbin/ldconfig
%postun -n libappstream-glib8 -p /sbin/ldconfig
%post -n libappstream-builder8 -p /sbin/ldconfig
%postun -n libappstream-builder8 -p /sbin/ldconfig
%postun -n libappstream-glib1 -p /sbin/ldconfig
%post -n libappstream-builder1 -p /sbin/ldconfig
%postun -n libappstream-builder1 -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_bindir}/appstream-builder
%{_bindir}/appstream-compose
%{_bindir}/appstream-util
%{_datadir}/bash-completion/completions/appstream-builder
%{_datadir}/bash-completion/completions/appstream-util
%{_libdir}/asb-plugins-5/
%{_mandir}/man1/appstream-builder.1%{?ext_man}
%{_mandir}/man1/appstream-compose.1%{?ext_man}
%{_mandir}/man1/appstream-util.1%{?ext_man}
%{_libdir}/asb-plugins/
%files -n libappstream-builder8
%files -n libappstream-builder1
%defattr(-,root,root)
%doc COPYING
%{_libdir}/libappstream-builder.so.*
%files -n libappstream-glib8
%files -n libappstream-glib1
%defattr(-,root,root)
%doc COPYING
%{_libdir}/libappstream-glib.so.*
%files -n typelib-1_0-AppStreamBuilder-1_0
%{_libdir}/girepository-1.0/AppStreamBuilder-1.0.typelib
%files -n typelib-1_0-AppStreamGlib-1_0
%{_libdir}/girepository-1.0/AppStreamGlib-1.0.typelib
%files devel
%{_datadir}/aclocal/appdata-xml.m4
%{_datadir}/aclocal/appstream-xml.m4
%dir %{_datadir}/gettext/its
%{_datadir}/gettext/its/appdata.*
%{_datadir}/gir-1.0/AppStreamBuilder-1.0.gir
%{_datadir}/gir-1.0/AppStreamGlib-1.0.gir
%{_datadir}/gtk-doc/html/appstream-glib/
%defattr(-,root,root)
%{_includedir}/libappstream-builder/
%{_includedir}/libappstream-glib/
%{_datadir}/aclocal/appstream-xml.m4
%{_datadir}/gtk-doc/html/appstream-glib/
%{_libdir}/pkgconfig/appstream-builder.pc
%{_libdir}/pkgconfig/appstream-glib.pc
%{_libdir}/libappstream-builder.so
%{_libdir}/libappstream-glib.so
%files lang -f %{name}.lang
%files -n openSUSE-appstream-process
%{_bindir}/openSUSE-appstream-process
%defattr(-,root,root)
%changelog

View File

@ -1,73 +0,0 @@
#!/bin/bash
SRC=$1
DEST=$2
URL=https://static.opensuse.org/appstream/tumbleweed
# Do not produce the html files - the biggest tasks are done
# Users interested in them can always produce them locally out of the appdata.xml.gz file
HTMLOUT=no
HASHED_NAMES=no
TMPDIR=$(mktemp -d)
/usr/bin/appstream-builder \
--enable-hidpi \
--temp-dir=${TMPDIR}/apb \
--cache-dir=${TMPDIR}/apb/cache \
--origin=appdata \
--basename=appdata \
--packages-dir=${SRC} \
--output-dir=${DEST} 2>&1 > $TMPDIR/as-builder.log
RET=$?
if [ $RET -ne 0 ]; then
# The appstream-builder failed, exit with an error code, so prod builder knows about it
cat $TMPDIR/as-builder.log
exit $RET
fi
# clean up TMPDIR again
rm -rf ${TMPDIR}
# Change screenshot URLs to our own infrastructure; disabled, as infra not ready
# appstream-util mirror-screenshots \
# ${DEST}/appdata.xml.gz \
# ${URL} \
# /usr/share/app-screenshots \
# /tmp/apb-screenshots
if [ "$HTMLOUT" = "yes" ]; then
/usr/bin/appstream-util \
status-html \
${DEST}/appdata.xml.gz \
${DEST}/appdata.html
# compress the HTML file (boo#942985)
xz -9 ${DEST}/appdata.html
/usr/bin/appstream-util \
status-html \
${DEST}/appdata-failed.xml.gz \
${DEST}/appdata-failed.html
# compress the HTML file (boo#942985)
xz -9 ${DEST}/appdata-failed.html
fi
if [ "$HASHED_NAMES" = "yes" ]; then
# rename the appdata-icons.tar.gz tarball to something like
# appdata-icons-${hash}.tar.gz, allowing mirrorbrain to send users
# off to a mirror to catch the file, improving performance
read md5 fn_catchall <<<$(md5sum ${DEST}/appdata-icons.tar.gz)
mv ${DEST}/appdata-icons.tar.gz ${DEST}/appdata-icons-${md5}.tar.gz
# also rename the appdata.xml.gz file in the same style
read md5 fn_catchall <<<$(md5sum ${DEST}/appdata.xml.gz)
mv ${DEST}/appdata.xml.gz ${DEST}/appdata-${md5}.xml.gz
# And the same for the -screenshots tarball (containing auto-generated screenshots for fonts)
read md5 fn_catchall <<<$(md5sum ${DEST}/appdata-screenshots.tar)
mv ${DEST}/appdata-screenshots.tar ${DEST}/appdata-screenshots-${md5}.tar
fi