[packages/appstream-glib] - updated to 0.2.0 (now also appstream-builder library is built) - added rpm5 patch (adjust rpm plug

qboosh qboosh at pld-linux.org
Sun Jun 22 08:56:56 CEST 2014


commit 7750225828a841bab82f490425beb84fbad6522b
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Jun 22 09:00:47 2014 +0200

    - updated to 0.2.0 (now also appstream-builder library is built)
    - added rpm5 patch (adjust rpm plugin to rpm5 API)
    - added pc patch (fix appstream-builder.pc copy-pastos)

 appstream-glib-pc.patch   |  17 ++++++
 appstream-glib-rpm5.patch | 147 ++++++++++++++++++++++++++++++++++++++++++++++
 appstream-glib.spec       | 136 +++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 297 insertions(+), 3 deletions(-)
---
diff --git a/appstream-glib.spec b/appstream-glib.spec
index 3adbcf1..ac33592 100644
--- a/appstream-glib.spec
+++ b/appstream-glib.spec
@@ -1,22 +1,35 @@
 Summary:	GLib Objects and helper methods for reading and writing AppStream metadata
 Summary(pl.UTF-8):	Obiekty GLiba i metody pomocnicze do odczytu i zapisu metadanych AppStream
 Name:		appstream-glib
-Version:	0.1.7
+Version:	0.2.0
 Release:	1
 License:	LGPL v2.1+
 Group:		Libraries
 Source0:	http://people.freedesktop.org/~hughsient/appstream-glib/releases/%{name}-%{version}.tar.xz
-# Source0-md5:	4779c8b21df42cb0e874478201cee419
+# Source0-md5:	12256fed43fb8de30ddfebec9ff29140
+Patch0:		%{name}-rpm5.patch
+Patch1:		%{name}-pc.patch
 URL:		http://people.freedesktop.org/~hughsient/appstream-glib/
+BuildRequires:	autoconf >= 2.63
+BuildRequires:	automake >= 1:1.9
+BuildRequires:	docbook-dtd43-xml
+BuildRequires:	docbook-style-xsl
+BuildRequires:	freetype-devel >= 2.5
 BuildRequires:	gdk-pixbuf2-devel >= 2.14
+BuildRequires:	gettext-devel >= 0.17
 BuildRequires:	glib2-devel >= 1:2.16.1
 BuildRequires:	gobject-introspection-devel >= 0.9.8
 BuildRequires:	gperf
 BuildRequires:	gtk-doc >= 1.9
+BuildRequires:	gtk+3-devel >= 3.0
 BuildRequires:	libarchive-devel
 BuildRequires:	libsoup-devel >= 2.24
 BuildRequires:	libstdc++-devel
+BuildRequires:	libtool >= 2:2
+BuildRequires:	libxslt-progs
 BuildRequires:	pkgconfig
+BuildRequires:	rpm-devel >= 4.5
+BuildRequires:	sqlite3-devel
 BuildRequires:	tar >= 1:1.22
 BuildRequires:	xz
 Requires:	glib2 >= 1:2.16.1
@@ -73,10 +86,80 @@ API documentation for appstream-glib library.
 %description apidocs -l pl.UTF-8
 Dokumentacja API biblioteki appstream-glib.
 
+%package -n bash-completion-appstream-glib
+Summary:	Bash completion for appstream-glib package
+Summary(pl.UTF-8):	Bashowe dopełnianie składni dla pakietu appstream-glib
+Group:		Applications/Shells
+Requires:	%{name} = %{version}-%{release}
+Requires:	bash-completion >= 2.0
+
+%description -n bash-completion-appstream-glib
+Bash completion for appstream-util command.
+
+%description -n bash-completion-appstream-glib -l pl.UTF-8
+Bashowe dopełnianie składni polecenia appstream-util.
+
+%package -n appstream-builder
+Summary:	AppStreamBuilder library to create AppStream metadata from packages
+Summary(pl.UTF-8):	Biblioteka AppStreamBuilder tworząca metadane AppStream z pakietów
+Group:		Libraries
+Requires:	%{name} = %{version}-%{release}
+
+%description -n appstream-builder
+AppStreamBuilder library to create AppStream metadata from packages.
+
+%description -n appstream-builder -l pl.UTF-8
+Biblioteka AppStreamBuilder tworząca metadane AppStream z pakietów.
+
+%package -n appstream-builder-devel
+Summary:	Header files for AppStreamBuilder library
+Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki AppStreamBuilder
+Group:		Development/Libraries
+Requires:	%{name}-devel = %{version}-%{release}
+Requires:	appstream-builder = %{version}-%{release}
+
+%description -n appstream-builder-devel
+Header files for AppStreamBuilder library.
+
+%description -n appstream-builder-devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki AppStreamBuilder.
+
+%package -n appstream-builder-static
+Summary:	Static AppStreamBuilder library
+Summary(pl.UTF-8):	Statyczna biblioteka AppStreamBuilder
+Group:		Development/Libraries
+Requires:	appstream-builder-devel = %{version}-%{release}
+
+%description -n appstream-builder-static
+Static AppStreamBuilder library.
+
+%description -n appstream-builder-static -l pl.UTF-8
+Statyczna biblioteka AppStreamBuilder.
+
+%package -n bash-completion-appstream-builder
+Summary:	Bash completion for appstream-builder package
+Summary(pl.UTF-8):	Bashowe dopełnianie składni dla pakietu appstream-builder
+Group:		Applications/Shells
+Requires:	appstream-builder = %{version}-%{release}
+Requires:	bash-completion >= 2.0
+
+%description -n bash-completion-appstream-builder
+Bash completion for appstream-builder command.
+
+%description -n bash-completion-appstream-builder -l pl.UTF-8
+Bashowe dopełnianie składni polecenia appstream-builder.
+
 %prep
 %setup -q
+%patch0 -p1
+%patch1 -p1
 
 %build
+%{__libtoolize}
+%{__aclocal} -I m4
+%{__autoconf}
+%{__autoheader}
+%{__automake}
 %configure \
 	--disable-silent-rules \
 	--with-html-dir=%{_gtkdocdir}
@@ -88,8 +171,10 @@ rm -rf $RPM_BUILD_ROOT
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
 
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/asb-plugins/lib*.{la,a}
+
 # obsoleted by pkg-config
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/libappstream-glib.la
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libappstream-*.la
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -97,6 +182,9 @@ rm -rf $RPM_BUILD_ROOT
 %post	-p /sbin/ldconfig
 %postun	-p /sbin/ldconfig
 
+%post	-n appstream-builder -p /sbin/ldconfig
+%postun	-n appstream-builder -p /sbin/ldconfig
+
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS MAINTAINERS NEWS README.md
@@ -104,6 +192,7 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_libdir}/libappstream-glib.so.*.*.*
 %attr(755,root,root) %ghost %{_libdir}/libappstream-glib.so.1
 %{_libdir}/girepository-1.0/AppStreamGlib-1.0.typelib
+%{_mandir}/man1/appstream-util.1*
 
 %files devel
 %defattr(644,root,root,755)
@@ -111,11 +200,52 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/gir-1.0/AppStreamGlib-1.0.gir
 %{_includedir}/libappstream-glib
 %{_pkgconfigdir}/appstream-glib.pc
+%{_aclocaldir}/appstream-xml.m4
 
 %files static
 %defattr(644,root,root,755)
 %{_libdir}/libappstream-glib.a
 
+%files -n bash-completion-appstream-glib
+%defattr(644,root,root,755)
+%{_datadir}/bash-completion/completions/appstream-util
+
 %files apidocs
 %defattr(644,root,root,755)
 %{_gtkdocdir}/appstream-glib
+
+%files -n appstream-builder
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/appstream-builder
+%attr(755,root,root) %{_libdir}/libappstream-builder.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libappstream-builder.so.1
+%{_libdir}/girepository-1.0/AppStreamBuilder-1.0.typelib
+%dir %{_libdir}/asb-plugins
+%attr(755,root,root) %{_libdir}/asb-plugins/libasb_plugin_appdata.so
+%attr(755,root,root) %{_libdir}/asb-plugins/libasb_plugin_blacklist.so
+%attr(755,root,root) %{_libdir}/asb-plugins/libasb_plugin_desktop.so
+%attr(755,root,root) %{_libdir}/asb-plugins/libasb_plugin_font.so
+%attr(755,root,root) %{_libdir}/asb-plugins/libasb_plugin_gettext.so
+%attr(755,root,root) %{_libdir}/asb-plugins/libasb_plugin_gir.so
+%attr(755,root,root) %{_libdir}/asb-plugins/libasb_plugin_gstreamer.so
+%attr(755,root,root) %{_libdir}/asb-plugins/libasb_plugin_hardcoded.so
+%attr(755,root,root) %{_libdir}/asb-plugins/libasb_plugin_ibus_sql.so
+%attr(755,root,root) %{_libdir}/asb-plugins/libasb_plugin_ibus_xml.so
+%attr(755,root,root) %{_libdir}/asb-plugins/libasb_plugin_metainfo.so
+%attr(755,root,root) %{_libdir}/asb-plugins/libasb_plugin_nm.so
+%{_mandir}/man1/appstream-builder.1*
+
+%files -n appstream-builder-devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libappstream-builder.so
+%{_includedir}/libappstream-builder
+%{_datadir}/gir-1.0/AppStreamBuilder-1.0.gir
+%{_pkgconfigdir}/appstream-builder.pc
+
+%files -n appstream-builder-static
+%defattr(644,root,root,755)
+%{_libdir}/libappstream-builder.a
+
+%files -n bash-completion-appstream-builder
+%defattr(644,root,root,755)
+%{_datadir}/bash-completion/completions/appstream-builder
diff --git a/appstream-glib-pc.patch b/appstream-glib-pc.patch
new file mode 100644
index 0000000..5776db6
--- /dev/null
+++ b/appstream-glib-pc.patch
@@ -0,0 +1,17 @@
+--- appstream-glib-0.2.0/libappstream-builder/appstream-builder.pc.in.orig	2014-06-17 11:10:33.000000000 +0200
++++ appstream-glib-0.2.0/libappstream-builder/appstream-builder.pc.in	2014-06-22 08:53:49.401148383 +0200
+@@ -3,10 +3,10 @@
+ libdir=@libdir@
+ includedir=@includedir@
+ 
+-Name: appstream-glib
++Name: appstream-builder
+ Description: Objects and helper methods to help reading and writing AppStream metadata
+ Version: @VERSION@
+-Requires: glib-2.0, gobject-2.0, gdk-pixbuf-2.0
+-Libs: -L${libdir} -lappstream-glib
+-Cflags: -I${includedir}/libappstream-glib
++Requires: appstream-glib, glib-2.0, gobject-2.0, gdk-pixbuf-2.0
++Libs: -L${libdir} -lappstream-builder
++Cflags: -I${includedir}/libappstream-builder
+ 
diff --git a/appstream-glib-rpm5.patch b/appstream-glib-rpm5.patch
new file mode 100644
index 0000000..4642986
--- /dev/null
+++ b/appstream-glib-rpm5.patch
@@ -0,0 +1,147 @@
+--- appstream-glib-0.2.0/libappstream-builder/Makefile.am.orig	2014-06-19 10:09:35.000000000 +0200
++++ appstream-glib-0.2.0/libappstream-builder/Makefile.am	2014-06-21 22:26:16.105266525 +0200
+@@ -66,6 +66,7 @@
+ 
+ libappstream_builder_la_LIBADD =				\
+ 	$(AS_GLIB_LIBS)						\
++	$(LIBARCHIVE_LIBS)					\
+ 	$(RPM_LIBS)						\
+ 	$(GLIB_LIBS)
+ 
+@@ -76,6 +77,7 @@
+ 	-export-symbols-regex '^asb_.*'
+ 
+ libappstream_builder_la_CFLAGS =				\
++        $(RPM_CFLAGS)						\
+ 	$(WARNINGFLAGS_C)
+ 
+ if HAVE_INTROSPECTION
+@@ -107,11 +109,6 @@
+ 	$(AS_GLIB_LIBS)						\
+ 	libappstream-builder.la					\
+ 	archive
+-if HAVE_RPM
+-AppStreamBuilder_1_0_gir_LIBS +=				\
+-	rpmio 							\
+-	rpm
+-endif
+ AppStreamBuilder_1_0_gir_FILES = $(introspection_sources)
+ INTROSPECTION_GIRS += AppStreamBuilder-1.0.gir
+ 
+--- appstream-glib-0.2.0/libappstream-builder/asb-package-rpm.c.orig	2014-06-21 22:53:36.268565676 +0200
++++ appstream-glib-0.2.0/libappstream-builder/asb-package-rpm.c	2014-06-21 22:56:36.995228569 +0200
+@@ -33,7 +33,7 @@
+ #include <archive.h>
+ #include <archive_entry.h>
+ 
+-#include <rpm/rpmlib.h>
++#include <rpm/rpm46compat.h>
+ #include <rpm/rpmts.h>
+ 
+ #include "as-cleanup.h"
+@@ -229,6 +229,33 @@
+ 	asb_package_set_source (pkg, srcrpm);
+ }
+ 
++static uint64_t rpmtdGetNumber(rpmtd td)
++{
++    uint64_t val = 0;
++    int ix;
++    assert(td != NULL);
++    ix = (td->ix >= 0 ? td->ix : 0);
++
++    switch (td->type) {
++    case RPM_INT64_TYPE:
++	val = *((uint64_t *) td->data + ix);
++	break;
++    case RPM_INT32_TYPE:
++	val = *((uint32_t *) td->data + ix);
++	break;
++    case RPM_INT16_TYPE:
++	val = *((uint16_t *) td->data + ix);
++	break;
++    case RPM_INT8_TYPE:
++    case RPM_CHAR_TYPE:
++	val = *((uint8_t *) td->data + ix);
++	break;
++    default:
++	break;
++    }
++    return val;
++}
++
+ /**
+  * asb_package_rpm_ensure_simple:
+  **/
+@@ -241,7 +268,7 @@
+ 	rpmtd td;
+ 
+ 	/* get the simple stuff */
+-	td = rpmtdNew ();
++	td = malloc (sizeof (*td));
+ 	headerGet (priv->h, RPMTAG_NAME, td, HEADERGET_MINMEM);
+ 	asb_package_set_name (pkg, rpmtdGetString (td));
+ 	headerGet (priv->h, RPMTAG_VERSION, td, HEADERGET_MINMEM);
+@@ -258,7 +285,7 @@
+ 	asb_package_rpm_set_license (pkg, rpmtdGetString (td));
+ 	headerGet (priv->h, RPMTAG_SOURCERPM, td, HEADERGET_MINMEM);
+ 	asb_package_rpm_set_source (pkg, rpmtdGetString (td));
+-	rpmtdFree (td);
++	free (td);
+ 	return ret;
+ }
+ 
+@@ -390,7 +417,7 @@
+ 
+ 	/* read out the file list */
+ 	for (i = 0; i < 3; i++)
+-		td[i] = rpmtdNew ();
++		td[i] = malloc (sizeof (*td[1]));
+ 	/* get the ChangeLog info */
+ 	headerGet (priv->h, RPMTAG_CHANGELOGTIME, td[0], HEADERGET_MINMEM);
+ 	headerGet (priv->h, RPMTAG_CHANGELOGNAME, td[1], HEADERGET_MINMEM);
+@@ -405,7 +432,7 @@
+ 	}
+ 	for (i = 0; i < 3; i++) {
+ 		rpmtdFreeData (td[i]);
+-		rpmtdFree (td[i]);
++		free (td[i]);
+ 	}
+ 	return TRUE;
+ }
+@@ -427,7 +454,7 @@
+ 	_cleanup_strv_free_ gchar **deps = NULL;
+ 
+ 	/* read out the dep list */
+-	td = rpmtdNew ();
++	td = malloc (sizeof (*td));
+ 	rc = headerGet (priv->h, RPMTAG_REQUIRENAME, td, HEADERGET_MINMEM);
+ 	if (!rc) {
+ 		ret = FALSE;
+@@ -455,7 +482,7 @@
+ 	asb_package_set_deps (pkg, deps);
+ out:
+ 	rpmtdFreeData (td);
+-	rpmtdFree (td);
++	free (td);
+ 	return ret;
+ }
+ 
+@@ -477,7 +504,7 @@
+ 
+ 	/* read out the file list */
+ 	for (i = 0; i < 3; i++)
+-		td[i] = rpmtdNew ();
++		td[i] = malloc (sizeof (*td[i]));
+ 	rc = headerGet (priv->h, RPMTAG_DIRNAMES, td[0], HEADERGET_MINMEM);
+ 	if (rc)
+ 		rc = headerGet (priv->h, RPMTAG_BASENAMES, td[1], HEADERGET_MINMEM);
+@@ -512,7 +539,7 @@
+ out:
+ 	for (i = 0; i < 3; i++) {
+ 		rpmtdFreeData (td[i]);
+-		rpmtdFree (td[i]);
++		free (td[i]);
+ 	}
+ 	return ret;
+ }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/appstream-glib.git/commitdiff/7750225828a841bab82f490425beb84fbad6522b



More information about the pld-cvs-commit mailing list