Hello community,
here is the log from the commit of package gstreamer-0_10 for openSUSE:Factory
checked in at Fri Sep 10 14:55:12 CEST 2010.
--------
--- GNOME/gstreamer-0_10/gstreamer-0_10.changes 2010-08-31 14:57:18.000000000 +0200
+++ /mounts/work_src_done/STABLE/gstreamer-0_10/gstreamer-0_10.changes 2010-09-07 15:23:28.000000000 +0200
@@ -1,0 +2,13 @@
+Thu Sep 2 12:07:07 UTC 2010 - dimstar@opensuse.org
+
+- Add gstreamer-0_10-rpm-prov.patch: adds --rpm to gst-inspect,
+ allowing rpm to create a list of provides, thanks to the
+ gstreamer-0_10.prov script we install. Those provides can then be
+ picked up by PackageKit. Patch taken from Fedora's gstreamer
+ package.
+- Add gstreamer-0_10.macros that contains a rpm macro, in case
+ external provides scripts are used.
+- Add gstreamer-utils Requires to the -devel package: this is used
+ in gstreamer-0_10.prov for the rpm magic to work.
+
+-------------------------------------------------------------------
--- GNOME/gstreamer-0_10/gstreamer-0_10-doc.changes 2010-03-13 20:21:25.000000000 +0100
+++ /mounts/work_src_done/STABLE/gstreamer-0_10/gstreamer-0_10-doc.changes 2010-09-07 23:18:34.000000000 +0200
@@ -1,0 +2,6 @@
+Tue Sep 7 23:16:34 CEST 2010 - vuntz@opensuse.org
+
+- Fix build: remove the macros.gstreamer and gstreamer-provides
+ from the doc package.
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
New:
----
gstreamer-0_10.macros
gstreamer-0_10.prov
gstreamer-0_10-rpm-prov.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ gstreamer-0_10-doc.spec ++++++
--- /var/tmp/diff_new_pack.QQ3cq9/_old 2010-09-10 14:54:21.000000000 +0200
+++ /var/tmp/diff_new_pack.QQ3cq9/_new 2010-09-10 14:54:21.000000000 +0200
@@ -22,7 +22,7 @@
%define build_doc 1
%define _name gstreamer
Version: 0.10.30
-Release: 2
+Release: 3
%define gst_branch 0.10
BuildRequires: bison check-devel fdupes flex glib2-devel libxml2-devel pyxml translation-update-upstream
%ifarch %ix86 ppc x86_64
@@ -60,10 +60,14 @@
License: LGPLv2.1+
Group: Productivity/Multimedia/Other
Summary: Streaming-Media Framework Runtime
-Source: %{_name}-%{version}.tar.bz2
-Source2: baselibs.conf
+Source0: %{_name}-%{version}.tar.bz2
+Source1: gstreamer-0_10.macros
+Source2: gstreamer-0_10.prov
+Source99: baselibs.conf
# PATCH-FIX-OPENSUSE gstreamer-0_10-no-gtk-doc-for-reals.patch maw@novell.com -- to build without gtk-doc, like totally for reals
Patch0: gstreamer-0_10-no-gtk-doc-for-reals.patch
+# PATCH-FEATURE-UPSTREAM gstreamer-0_10-rpm-prov.patch bgo#588783 dimstar@opensuse.org -- Add --rpm parameter to allow creation of rpm provides, patch from fedora
+Patch1: gstreamer-0_10-rpm-prov.patch
Url: http://gstreamer.freedesktop.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -135,6 +139,8 @@
Summary: Include Files and Libraries mandatory for Development
Group: Development/Libraries/C and C++
Requires: %{name} = %{version} glib2-devel libxml2-devel popt-devel check-devel
+# gstreamer-utils is required for the gstreamer-provides rpm magic.
+Requires: gstreamer-utils
# Name up to 10.3:
Provides: gstreamer010-devel = %{version}
Obsoletes: gstreamer010-devel < %{version}
@@ -154,6 +160,7 @@
%if ! %build_doc
%patch0 -p1
%endif
+%patch1 -p1
%build
# FIXME: GTKDOC_CFLAGS, GST_OBJ_CFLAGS:
@@ -202,6 +209,9 @@
rm -rf $RPM_BUILD_ROOT/%{_docdir}/%{name}/manual
rm -rf $RPM_BUILD_ROOT/%{_docdir}/%{name}/pwg
mkdir -p $RPM_BUILD_ROOT%{_datadir}/gstreamer-%{gst_branch}/presets
+# Install the rpm macros
+%__install -m644 -D %{S:1} %{buildroot}%{_sysconfdir}/rpm/macros.gstreamer
+%__install -m755 -D %{S:2} %{buildroot}%{_libexecdir}/rpm/gstreamer-provides
%endif
%fdupes %{buildroot}
@@ -267,6 +277,8 @@
%{_libdir}/*.so
%{_libdir}/*.*a
%{_libdir}/pkgconfig/*.pc
+%{_libexecdir}/rpm/gstreamer-provides
+%{_sysconfdir}/rpm/macros.gstreamer
%endif
%changelog
++++++ gstreamer-0_10.spec ++++++
--- /var/tmp/diff_new_pack.QQ3cq9/_old 2010-09-10 14:54:21.000000000 +0200
+++ /var/tmp/diff_new_pack.QQ3cq9/_new 2010-09-10 14:54:21.000000000 +0200
@@ -22,7 +22,7 @@
%define build_doc 0
%define _name gstreamer
Version: 0.10.30
-Release: 2
+Release: 3
%define gst_branch 0.10
BuildRequires: bison check-devel fdupes flex glib2-devel libxml2-devel pyxml translation-update-upstream
%ifarch %ix86 ppc x86_64
@@ -60,10 +60,14 @@
License: LGPLv2.1+
Group: Productivity/Multimedia/Other
Summary: Streaming-Media Framework Runtime
-Source: %{_name}-%{version}.tar.bz2
-Source2: baselibs.conf
+Source0: %{_name}-%{version}.tar.bz2
+Source1: gstreamer-0_10.macros
+Source2: gstreamer-0_10.prov
+Source99: baselibs.conf
# PATCH-FIX-OPENSUSE gstreamer-0_10-no-gtk-doc-for-reals.patch maw@novell.com -- to build without gtk-doc, like totally for reals
Patch0: gstreamer-0_10-no-gtk-doc-for-reals.patch
+# PATCH-FEATURE-UPSTREAM gstreamer-0_10-rpm-prov.patch bgo#588783 dimstar@opensuse.org -- Add --rpm parameter to allow creation of rpm provides, patch from fedora
+Patch1: gstreamer-0_10-rpm-prov.patch
Url: http://gstreamer.freedesktop.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -135,6 +139,8 @@
Summary: Include Files and Libraries mandatory for Development
Group: Development/Libraries/C and C++
Requires: %{name} = %{version} glib2-devel libxml2-devel popt-devel check-devel
+# gstreamer-utils is required for the gstreamer-provides rpm magic.
+Requires: gstreamer-utils
# Name up to 10.3:
Provides: gstreamer010-devel = %{version}
Obsoletes: gstreamer010-devel < %{version}
@@ -154,6 +160,7 @@
%if ! %build_doc
%patch0 -p1
%endif
+%patch1 -p1
%build
# FIXME: GTKDOC_CFLAGS, GST_OBJ_CFLAGS:
@@ -202,6 +209,9 @@
rm -rf $RPM_BUILD_ROOT/%{_docdir}/%{name}/manual
rm -rf $RPM_BUILD_ROOT/%{_docdir}/%{name}/pwg
mkdir -p $RPM_BUILD_ROOT%{_datadir}/gstreamer-%{gst_branch}/presets
+# Install the rpm macros
+%__install -m644 -D %{S:1} %{buildroot}%{_sysconfdir}/rpm/macros.gstreamer
+%__install -m755 -D %{S:2} %{buildroot}%{_libexecdir}/rpm/gstreamer-provides
%endif
%fdupes %{buildroot}
@@ -267,6 +277,8 @@
%{_libdir}/*.so
%{_libdir}/*.*a
%{_libdir}/pkgconfig/*.pc
+%{_libexecdir}/rpm/gstreamer-provides
+%{_sysconfdir}/rpm/macros.gstreamer
%endif
%changelog
++++++ gstreamer-0_10.macros ++++++
%__gstreamer_provides %{_libexecdir}/rpm/gstreamer.prov
++++++ gstreamer-0_10.prov ++++++
#!/bin/sh
#
# Script to install in:
# /usr/lib/rpm/redhat/find-provides.d
#
# Transform GStreamer auto install info into RPM provides
#
# Author: Bastien Nocera
# Based on other provides scripts from RPM
#
filelist=`grep -e '.so$' | sed "s/['\"]/\\\&/g"`
# --- Alpha does not mark 64bit dependencies•
case `uname -m` in
alpha*) mark64="" ;;
*) mark64="()(64bit)" ;;
esac
solist=$(echo $filelist | grep "libgst" | \
xargs file -L 2>/dev/null | grep "ELF.*shared object" | cut -d: -f1 )
function getmark()
{
lib64=`if file -L $1 2>/dev/null | \
grep "ELF 64-bit" >/dev/null; then echo -n "$mark64"; fi`
}
function libdir()
{
buildlibdir=`dirname $1`
buildlibdir=`dirname $buildlibdir`
}
for so in $solist ; do
getmark $so
libdir $so
LD_LIBRARY_PATH=$buildlibdir gst-inspect --print-plugin-auto-install-info --rpm $so 2> /dev/null | while read line ; do
echo -n "$line";
echo -n "$lib64"
echo
done
done
++++++ gstreamer-0_10-rpm-prov.patch ++++++
Index: gstreamer-0.10.30/tools/gst-inspect.c
===================================================================
--- gstreamer-0.10.30.orig/tools/gst-inspect.c
+++ gstreamer-0.10.30/tools/gst-inspect.c
@@ -1320,9 +1320,225 @@ print_element_info (GstElementFactory *
return 0;
}
+static void
+print_gst_structure_append_field (GList * strings, const char *field)
+{
+ GList *s;
+
+ //g_message ("adding '%s' to the string", field);
+
+ for (s = strings; s != NULL; s = s->next) {
+ g_string_append (s->data, field);
+ }
+}
static void
-print_plugin_automatic_install_info_codecs (GstElementFactory * factory)
+print_gst_structure_append_field_index (GList * strings, const char *field,
+ guint num_items, guint offset)
+{
+ GList *s;
+ guint i;
+
+ //g_message ("adding '%s' to the string (num: %d offset: %d)", field, num_items, offset);
+
+ for (s = strings, i = 0; s != NULL; s = s->next, i++) {
+ if (i == offset) {
+ //g_message ("adding '%s' at '%d'", field, i);
+ g_string_append (s->data, field);
+ }
+ if (i == num_items)
+ i = 0;
+ }
+
+}
+
+static GList *
+print_gst_structure_dup_fields (GList * strings, guint num_items)
+{
+ guint new_items, i;
+
+ if (num_items == 1)
+ return strings;
+
+ //g_message ("creating %d new items", num_items);
+
+ new_items = g_list_length (strings) * (num_items - 1);
+ for (i = 0; i < new_items; i++) {
+ GString *s, *first;
+
+ first = strings->data;
+ s = g_string_new_len (first->str, first->len);
+ strings = g_list_prepend (strings, s);
+ }
+
+ return strings;
+}
+
+enum
+{
+ FIELD_VERSION = 0,
+ FIELD_LAYER,
+ FIELD_VARIANT,
+ FIELD_SYSTEMSTREAM
+};
+
+static int
+field_get_type (const char *field_name)
+{
+ if (strstr (field_name, "version") != NULL)
+ return FIELD_VERSION;
+ if (strcmp (field_name, "layer") == 0)
+ return FIELD_LAYER;
+ if (strcmp (field_name, "systemstream") == 0)
+ return FIELD_SYSTEMSTREAM;
+ if (strcmp (field_name, "variant") == 0)
+ return FIELD_VARIANT;
+
+ return -1;
+}
+
+static gint
+fields_type_compare (const char *a, const char *b)
+{
+ gint a_type, b_type;
+
+ a_type = field_get_type (a);
+ b_type = field_get_type (b);
+ if (a_type < b_type)
+ return -1;
+ if (b_type < a_type)
+ return 1;
+ return 0;
+}
+
+static void
+print_gst_structure_for_rpm (const char *type_name, GstStructure * s)
+{
+ guint i, num_fields;
+ const char *name;
+ GList *fields, *l, *strings;
+ GString *string;
+
+ name = gst_structure_get_name (s);
+ strings = NULL;
+ num_fields = gst_structure_n_fields (s);
+ fields = NULL;
+
+ for (i = 0; i < num_fields; i++) {
+ const char *field_name;
+
+ field_name = gst_structure_nth_field_name (s, i);
+ if (field_get_type (field_name) < 0) {
+ //g_message ("ignoring field named %s", field_name);
+ continue;
+ }
+
+ fields =
+ g_list_insert_sorted (fields, g_strdup (field_name),
+ (GCompareFunc) fields_type_compare);
+ }
+
+ /* Example:
+ * gstreamer0.10(decoder-video/mpeg)(mpegversion=1)()(64bit) */
+ string = g_string_new ("gstreamer0.10");
+ g_string_append_c (string, '(');
+ g_string_append (string, type_name);
+ g_string_append_c (string, '-');
+ g_string_append (string, name);
+ g_string_append_c (string, ')');
+
+ strings = g_list_append (strings, string);
+
+ for (l = fields; l != NULL; l = l->next) {
+ char *field_name;
+ GType type;
+
+ field_name = l->data;
+
+ type = gst_structure_get_field_type (s, field_name);
+ //g_message ("field is: %s, type: %s", field_name, g_type_name (type));
+
+ if (type == G_TYPE_INT) {
+ char *field;
+ int value;
+
+ gst_structure_get_int (s, field_name, &value);
+ field = g_strdup_printf ("(%s=%d)", field_name, value);
+ print_gst_structure_append_field (strings, field);
+ g_free (field);
+ } else if (type == G_TYPE_BOOLEAN) {
+ char *field;
+ int value;
+
+ gst_structure_get_boolean (s, field_name, &value);
+ field = g_strdup_printf ("(%s=%s)", field_name, value ? "true" : "false");
+ print_gst_structure_append_field (strings, field);
+ g_free (field);
+ } else if (type == GST_TYPE_INT_RANGE) {
+ const GValue *value;
+ int min, max;
+
+ value = gst_structure_get_value (s, field_name);
+ min = gst_value_get_int_range_min (value);
+ max = gst_value_get_int_range_max (value);
+
+ strings = print_gst_structure_dup_fields (strings, max - min + 1);
+
+ for (i = min; i <= max; i++) {
+ char *field;
+
+ field = g_strdup_printf ("(%s=%d)", field_name, i);
+ print_gst_structure_append_field_index (strings, field, max - min + 1,
+ i - min);
+ g_free (field);
+ }
+ } else if (type == GST_TYPE_LIST) {
+ const GValue *value;
+ int num_items;
+
+ value = gst_structure_get_value (s, field_name);
+ num_items = gst_value_list_get_size (value);
+
+ strings = print_gst_structure_dup_fields (strings, num_items);
+
+ for (i = 0; i < num_items; i++) {
+ char *field;
+ const GValue *item_value;
+
+ item_value = gst_value_list_get_value (value, i);
+ field = g_strdup_printf ("(%s=%d)", field_name,
+ g_value_get_int (item_value));
+ print_gst_structure_append_field_index (strings, field, num_items, i);
+ g_free (field);
+ }
+ } else if (type == G_TYPE_STRING) {
+ char *field;
+ const char *value;
+
+ value = gst_structure_get_string (s, field_name);
+ field = g_strdup_printf ("(%s=%s)", field_name, value);
+ print_gst_structure_append_field (strings, field);
+ g_free (field);
+ } else {
+ g_warning ("unhandled type! %s", g_type_name (type));
+ }
+
+ g_free (field_name);
+ }
+
+ g_list_free (fields);
+
+ for (l = strings; l != NULL; l = l->next) {
+ string = l->data;
+ g_print ("%s\n", string->str);
+ g_string_free (string, TRUE);
+ }
+ g_list_free (strings);
+}
+
+static void
+print_plugin_automatic_install_info_codecs (GstElementFactory * factory,
+ gboolean rpm_format)
{
GstPadDirection direction;
const gchar *type_name;
@@ -1347,6 +1563,12 @@ print_plugin_automatic_install_info_code
return;
}
+ if (rpm_format) {
+ /* Ignore NONE ranked plugins */
+ if (GST_PLUGIN_FEATURE (factory)->rank == GST_RANK_NONE)
+ return;
+ }
+
/* decoder/demuxer sink pads should always be static and there should only
* be one, the same applies to encoders/muxers and source pads */
static_templates = gst_element_factory_get_static_pad_templates (factory);
@@ -1383,15 +1605,20 @@ print_plugin_automatic_install_info_code
gst_structure_remove_field (s, "rate");
gst_structure_remove_field (s, "depth");
gst_structure_remove_field (s, "clock-rate");
- s_str = gst_structure_to_string (s);
- g_print ("%s-%s\n", type_name, s_str);
- g_free (s_str);
+ if (!rpm_format) {
+ s_str = gst_structure_to_string (s);
+ g_print ("%s-%s\n", type_name, s_str);
+ g_free (s_str);
+ } else {
+ print_gst_structure_for_rpm (type_name, s);
+ }
}
gst_caps_unref (caps);
}
static void
-print_plugin_automatic_install_info_protocols (GstElementFactory * factory)
+print_plugin_automatic_install_info_protocols (GstElementFactory * factory,
+ gboolean rpm_format)
{
gchar **protocols, **p;
@@ -1400,11 +1627,17 @@ print_plugin_automatic_install_info_prot
switch (gst_element_factory_get_uri_type (factory)) {
case GST_URI_SINK:
for (p = protocols; *p != NULL; ++p)
- g_print ("urisink-%s\n", *p);
+ if (!rpm_format)
+ g_print ("urisink-%s\n", *p);
+ else
+ g_print ("gstreamer0.10(urisink-%s)\n", *p);
break;
case GST_URI_SRC:
for (p = protocols; *p != NULL; ++p)
- g_print ("urisource-%s\n", *p);
+ if (!rpm_format)
+ g_print ("urisource-%s\n", *p);
+ else
+ g_print ("gstreamer0.10(urisource-%s)\n", *p);
break;
default:
break;
@@ -1414,7 +1647,7 @@ print_plugin_automatic_install_info_prot
}
static void
-print_plugin_automatic_install_info (GstPlugin * plugin)
+print_plugin_automatic_install_info (GstPlugin * plugin, gboolean rpm_format)
{
const gchar *plugin_name;
GList *features, *l;
@@ -1434,11 +1667,12 @@ print_plugin_automatic_install_info (Gst
if (g_str_equal (plugin_name, feature->plugin_name)) {
GstElementFactory *factory;
- g_print ("element-%s\n", gst_plugin_feature_get_name (feature));
+ if (!rpm_format)
+ g_print ("element-%s\n", gst_plugin_feature_get_name (feature));
factory = GST_ELEMENT_FACTORY (feature);
- print_plugin_automatic_install_info_protocols (factory);
- print_plugin_automatic_install_info_codecs (factory);
+ print_plugin_automatic_install_info_protocols (factory, rpm_format);
+ print_plugin_automatic_install_info_codecs (factory, rpm_format);
}
}
@@ -1458,7 +1692,7 @@ print_all_plugin_automatic_install_info
plugin = (GstPlugin *) (plugins->data);
plugins = g_list_next (plugins);
- print_plugin_automatic_install_info (plugin);
+ print_plugin_automatic_install_info (plugin, FALSE);
}
gst_plugin_list_free (orig_plugins);
}
@@ -1470,6 +1704,7 @@ main (int argc, char *argv[])
gboolean do_print_blacklist = FALSE;
gboolean plugin_name = FALSE;
gboolean print_aii = FALSE;
+ gboolean print_aii_rpm = FALSE;
gboolean uri_handlers = FALSE;
#ifndef GST_DISABLE_OPTION_PARSING
GOptionEntry options[] = {
@@ -1482,6 +1717,9 @@ main (int argc, char *argv[])
"or all plugins provide.\n "
"Useful in connection with external automatic plugin "
"installation mechanisms"), NULL},
+ {"rpm", '\0', 0, G_OPTION_ARG_NONE, &print_aii_rpm,
+ N_("Print the machine-parsable list of features of a plugin in RPM "
+ "Provides compatible-format"), NULL},
{"plugin", '\0', 0, G_OPTION_ARG_NONE, &plugin_name,
N_("List the plugin contents"), NULL},
{"uri-handlers", 'u', 0, G_OPTION_ARG_NONE, &uri_handlers,
@@ -1570,7 +1808,7 @@ main (int argc, char *argv[])
/* if there is such a plugin, print out info */
if (plugin) {
if (print_aii) {
- print_plugin_automatic_install_info (plugin);
+ print_plugin_automatic_install_info (plugin, print_aii_rpm);
} else {
print_plugin_info (plugin);
print_plugin_features (plugin);
@@ -1583,13 +1821,17 @@ main (int argc, char *argv[])
if (plugin) {
if (print_aii) {
- print_plugin_automatic_install_info (plugin);
+ print_plugin_automatic_install_info (plugin, print_aii_rpm);
} else {
print_plugin_info (plugin);
print_plugin_features (plugin);
}
} else {
- g_print (_("Could not load plugin file: %s\n"), error->message);
+ if (!print_aii_rpm)
+ g_print (_("Could not load plugin file: %s\n"), error->message);
+ else
+ g_printerr (_("Could not load plugin file: %s\n"),
+ error->message);
g_error_free (error);
return -1;
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org