commit 7ed1a8fb3b3d149921446c010cf26eaa3262657f Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 10:39:18 2019 -0400 Package init diff --git a/GConf-3.2.6.tar.xz b/GConf-3.2.6.tar.xz new file mode 100644 index 0000000..8e05319 Binary files /dev/null and b/GConf-3.2.6.tar.xz differ diff --git a/GConf-gettext.patch b/GConf-gettext.patch new file mode 100644 index 0000000..638e8ae --- /dev/null +++ b/GConf-gettext.patch @@ -0,0 +1,360 @@ +diff -up GConf-2.26.0/backends/markup-tree.c.gettext GConf-2.26.0/backends/markup-tree.c +--- GConf-2.26.0/backends/markup-tree.c.gettext 2009-04-26 23:33:05.258484987 -0400 ++++ GConf-2.26.0/backends/markup-tree.c 2009-04-26 23:34:25.026700526 -0400 +@@ -52,6 +52,7 @@ struct _MarkupEntry + char *schema_name; + char *mod_user; + GTime mod_time; ++ const char *gettext_domain; + }; + + static LocalSchemaInfo* local_schema_info_new (void); +@@ -1593,6 +1594,8 @@ markup_entry_set_value (MarkupEntry + gconf_schema_get_type (schema)); + gconf_schema_set_owner (current_schema, + gconf_schema_get_owner (schema)); ++ gconf_schema_set_gettext_domain (current_schema, ++ gconf_schema_get_gettext_domain (schema)); + } + + /* Update mod time */ +@@ -1805,6 +1808,8 @@ markup_entry_get_value (MarkupEntry *ent + else if (c_local_schema && c_local_schema->long_desc) + gconf_schema_set_long_desc (schema, c_local_schema->long_desc); + ++ gconf_schema_set_gettext_domain (schema, entry->gettext_domain); ++ + return retval; + } + } +@@ -2339,8 +2344,9 @@ parse_value_element (GMarkupParseContext + const char *ltype; + const char *list_type; + const char *owner; ++ + GConfValueType vtype; +- const char *dummy1, *dummy2, *dummy3, *dummy4; ++ const char *dummy1, *dummy2, *dummy3, *dummy4, *dummy5; + + #if 0 + g_assert (ELEMENT_IS ("entry") || +@@ -2377,6 +2383,7 @@ parse_value_element (GMarkupParseContext + "muser", &dummy2, + "mtime", &dummy3, + "schema", &dummy4, ++ "gettext_domain", &dummy5, + + NULL)) + return; +@@ -2683,6 +2690,7 @@ parse_entry_element (GMarkupParseContext + const char *mtime; + const char *schema; + const char *type; ++ const char *gettext_domain; + const char *dummy1, *dummy2, *dummy3, *dummy4; + const char *dummy5, *dummy6, *dummy7; + GConfValue *value; +@@ -2693,6 +2701,7 @@ parse_entry_element (GMarkupParseContext + mtime = NULL; + schema = NULL; + type = NULL; ++ gettext_domain = NULL; + + if (!locate_attributes (context, element_name, attribute_names, attribute_values, + error, +@@ -2701,6 +2710,7 @@ parse_entry_element (GMarkupParseContext + "mtime", &mtime, + "schema", &schema, + "type", &type, ++ "gettext_domain", &gettext_domain, + + /* These are allowed but we don't use them until + * parse_value_element +@@ -2768,6 +2778,9 @@ parse_entry_element (GMarkupParseContext + */ + if (schema) + entry->schema_name = g_strdup (schema); ++ ++ if (gettext_domain) ++ entry->gettext_domain = g_intern_string (gettext_domain); + } + else + { +@@ -3716,6 +3729,7 @@ write_value_element (GConfValue *value, + GConfSchema *schema; + GConfValueType stype; + const char *owner; ++ const char *gettext_domain; + + schema = gconf_value_get_schema (value); + +@@ -3741,6 +3755,23 @@ write_value_element (GConfValue *value, + + g_free (s); + } ++ ++ gettext_domain = gconf_schema_get_gettext_domain (schema); ++ ++ if (gettext_domain) ++ { ++ char *s; ++ ++ s = g_markup_escape_text (gettext_domain, -1); ++ ++ if (fprintf (f, " gettext_domain=\"%s\"", s) < 0) ++ { ++ g_free (s); ++ return FALSE; ++ } ++ ++ g_free (s); ++ } + + if (stype == GCONF_VALUE_LIST) + { +diff -up GConf-2.26.0/doc/gconf-1.0.dtd.gettext GConf-2.26.0/doc/gconf-1.0.dtd +--- GConf-2.26.0/doc/gconf-1.0.dtd.gettext 2009-04-26 23:33:17.240736103 -0400 ++++ GConf-2.26.0/doc/gconf-1.0.dtd 2009-04-26 23:34:25.027700384 -0400 +@@ -7,7 +7,7 @@ + +- ++ + + + +diff -up GConf-2.26.0/gconf/gconf-internals.c.gettext GConf-2.26.0/gconf/gconf-internals.c +--- GConf-2.26.0/gconf/gconf-internals.c.gettext 2009-04-26 23:34:10.994700035 -0400 ++++ GConf-2.26.0/gconf/gconf-internals.c 2009-04-26 23:34:53.767450191 -0400 +@@ -513,6 +513,7 @@ gconf_fill_corba_schema_from_gconf_schem + cs->short_desc = CORBA_string_dup (gconf_schema_get_short_desc (sc) ? gconf_schema_get_short_desc (sc) : ""); + cs->long_desc = CORBA_string_dup (gconf_schema_get_long_desc (sc) ? gconf_schema_get_long_desc (sc) : ""); + cs->owner = CORBA_string_dup (gconf_schema_get_owner (sc) ? gconf_schema_get_owner (sc) : ""); ++ cs->gettext_domain = CORBA_string_dup (gconf_schema_get_gettext_domain (sc) ? gconf_schema_get_gettext_domain (sc) : ""); + + { + gchar* encoded; +@@ -600,6 +601,14 @@ gconf_schema_from_corba_schema(const Con + gconf_schema_set_owner(sc, cs->owner); + } + ++ if (*cs->gettext_domain != '\0') ++ { ++ if (!g_utf8_validate (cs->gettext_domain, -1, NULL)) ++ gconf_log (GCL_ERR, _("Invalid UTF-8 in gettext domain for schema")); ++ else ++ gconf_schema_set_gettext_domain(sc, cs->gettext_domain); ++ } ++ + { + GConfValue* val; + +diff -up GConf-2.26.0/gconf/gconf-schema.c.gettext GConf-2.26.0/gconf/gconf-schema.c +--- GConf-2.26.0/gconf/gconf-schema.c.gettext 2009-04-26 23:33:26.787483545 -0400 ++++ GConf-2.26.0/gconf/gconf-schema.c 2009-04-26 23:35:54.240450142 -0400 +@@ -32,9 +32,10 @@ typedef struct { + GConfValueType car_type; /* Pair car type of the described entry */ + GConfValueType cdr_type; /* Pair cdr type of the described entry */ + gchar* locale; /* Schema locale */ +- gchar* owner; /* Name of creating application */ ++ const gchar* owner; /* Name of creating application */ + gchar* short_desc; /* 40 char or less description, no newlines */ + gchar* long_desc; /* could be a paragraph or so */ ++ const gchar* gettext_domain; /* description gettext domain */ + GConfValue* default_value; /* Default value of the key */ + } GConfRealSchema; + +@@ -63,7 +64,6 @@ gconf_schema_free (GConfSchema* sc) + g_free (real->locale); + g_free (real->short_desc); + g_free (real->long_desc); +- g_free (real->owner); + + if (real->default_value) + gconf_value_free (real->default_value); +@@ -91,7 +91,9 @@ gconf_schema_copy (const GConfSchema* sc + + dest->long_desc = g_strdup (real->long_desc); + +- dest->owner = g_strdup (real->owner); ++ dest->gettext_domain = real->gettext_domain; ++ ++ dest->owner = real->owner; + + dest->default_value = real->default_value ? gconf_value_copy (real->default_value) : NULL; + +@@ -136,6 +138,17 @@ gconf_schema_set_locale (GConfSchema* sc + REAL_SCHEMA (sc)->locale = NULL; + } + ++void ++gconf_schema_set_gettext_domain (GConfSchema* sc, const gchar* domain) ++{ ++ g_return_if_fail (domain == NULL || g_utf8_validate (domain, -1, NULL)); ++ ++ if (domain) ++ REAL_SCHEMA (sc)->gettext_domain = g_intern_string (domain); ++ else ++ REAL_SCHEMA (sc)->gettext_domain = NULL; ++} ++ + void + gconf_schema_set_short_desc (GConfSchema* sc, const gchar* desc) + { +@@ -169,11 +182,8 @@ gconf_schema_set_owner (GConfSchema* sc, + { + g_return_if_fail (owner == NULL || g_utf8_validate (owner, -1, NULL)); + +- if (REAL_SCHEMA (sc)->owner) +- g_free (REAL_SCHEMA (sc)->owner); +- + if (owner) +- REAL_SCHEMA (sc)->owner = g_strdup (owner); ++ REAL_SCHEMA (sc)->owner = g_intern_string (owner); + else + REAL_SCHEMA (sc)->owner = NULL; + } +@@ -228,6 +238,14 @@ gconf_schema_validate (const GConfSchema + return FALSE; + } + ++ if (real->gettext_domain && !g_utf8_validate (real->gettext_domain, -1, NULL)) ++ { ++ g_set_error (err, GCONF_ERROR, ++ GCONF_ERROR_FAILED, ++ _("Schema contains invalid UTF-8")); ++ return FALSE; ++ } ++ + if (real->owner && !g_utf8_validate (real->owner, -1, NULL)) + { + g_set_error (err, GCONF_ERROR, +@@ -299,11 +317,32 @@ gconf_schema_get_locale (const GConfSche + } + + const char* ++gconf_schema_get_gettext_domain (const GConfSchema *schema) ++{ ++ g_return_val_if_fail (schema != NULL, NULL); ++ ++ return REAL_SCHEMA (schema)->gettext_domain; ++} ++ ++static inline const char * ++schema_translate (const GConfSchema *schema, ++ const char *string) ++{ ++ if (REAL_SCHEMA (schema)->gettext_domain) ++ { ++ bind_textdomain_codeset (REAL_SCHEMA (schema)->gettext_domain, "UTF-8"); ++ return g_dgettext(REAL_SCHEMA (schema)->gettext_domain, string); ++ } ++ else ++ return string; ++} ++ ++const char* + gconf_schema_get_short_desc (const GConfSchema *schema) + { + g_return_val_if_fail (schema != NULL, NULL); + +- return REAL_SCHEMA (schema)->short_desc; ++ return schema_translate (schema, REAL_SCHEMA (schema)->short_desc); + } + + const char* +@@ -311,7 +350,7 @@ gconf_schema_get_long_desc (const GConfS + { + g_return_val_if_fail (schema != NULL, NULL); + +- return REAL_SCHEMA (schema)->long_desc; ++ return schema_translate (schema, REAL_SCHEMA (schema)->long_desc); + } + + const char* +diff -up GConf-2.26.0/gconf/gconf-schema.h.gettext GConf-2.26.0/gconf/gconf-schema.h +--- GConf-2.26.0/gconf/gconf-schema.h.gettext 2009-04-26 23:33:33.979744088 -0400 ++++ GConf-2.26.0/gconf/gconf-schema.h 2009-04-26 23:34:25.030737043 -0400 +@@ -48,6 +48,8 @@ void gconf_schema_set_cdr_type + GConfValueType type); + void gconf_schema_set_locale (GConfSchema *sc, + const gchar *locale); ++void gconf_schema_set_gettext_domain (GConfSchema *sc, ++ const gchar *domain); + void gconf_schema_set_short_desc (GConfSchema *sc, + const gchar *desc); + void gconf_schema_set_long_desc (GConfSchema *sc, +@@ -65,6 +67,7 @@ GConfValueType gconf_schema_get_list_typ + GConfValueType gconf_schema_get_car_type (const GConfSchema *schema); + GConfValueType gconf_schema_get_cdr_type (const GConfSchema *schema); + const char* gconf_schema_get_locale (const GConfSchema *schema); ++const char* gconf_schema_get_gettext_domain(const GConfSchema *schema); + const char* gconf_schema_get_short_desc (const GConfSchema *schema); + const char* gconf_schema_get_long_desc (const GConfSchema *schema); + const char* gconf_schema_get_owner (const GConfSchema *schema); +diff -up GConf-2.26.0/gconf/gconftool.c.gettext GConf-2.26.0/gconf/gconftool.c +--- GConf-2.26.0/gconf/gconftool.c.gettext 2009-04-26 23:33:41.907451190 -0400 ++++ GConf-2.26.0/gconf/gconftool.c 2009-04-26 23:34:25.034736752 -0400 +@@ -3295,6 +3295,7 @@ struct _SchemaInfo { + GConfValueType cdr_type; + GConfValue* global_default; + GHashTable* hash; ++ gchar* gettext_domain; + }; + + static int +@@ -3547,6 +3548,15 @@ extract_global_info(xmlNodePtr node, + else + g_printerr (_("WARNING: empty node")); + } ++ else if (strcmp((char *)iter->name, "gettext_domain") == 0) ++ { ++ tmp = (char *)xmlNodeGetContent(iter); ++ if (tmp) ++ { ++ info->gettext_domain = g_strdup(tmp); ++ xmlFree(tmp); ++ } ++ } + else + g_printerr (_("WARNING: node <%s> not understood below \n"), + iter->name); +@@ -3636,6 +3646,9 @@ process_locale_info(xmlNodePtr node, Sch + if (info->owner != NULL) + gconf_schema_set_owner(schema, info->owner); + ++ if (info->gettext_domain != NULL) ++ gconf_schema_set_gettext_domain(schema, info->gettext_domain); ++ + xmlFree(name); + + /* Locale-specific info */ +@@ -3765,6 +3778,7 @@ get_schema_from_xml(xmlNodePtr node, gch + info.apply_to = NULL; + info.owner = NULL; + info.global_default = NULL; ++ info.gettext_domain = NULL; + info.hash = g_hash_table_new(g_str_hash, g_str_equal); + + extract_global_info(node, &info); +@@ -3801,6 +3815,8 @@ get_schema_from_xml(xmlNodePtr node, gch + ; /* nothing */ + else if (strcmp((char *)iter->name, "applyto") == 0) + ; /* nothing */ ++ else if (strcmp((char *)iter->name, "gettext_domain") == 0) ++ ; /* nothing */ + else if (strcmp((char *)iter->name, "locale") == 0) + { + process_locale_info(iter, &info); +diff -up GConf-2.26.0/gconf/GConfX.idl.gettext GConf-2.26.0/gconf/GConfX.idl +--- GConf-2.26.0/gconf/GConfX.idl.gettext 2009-04-26 23:33:58.457483190 -0400 ++++ GConf-2.26.0/gconf/GConfX.idl 2009-04-26 23:34:53.764448732 -0400 +@@ -16,6 +16,7 @@ struct ConfigSchema { + string short_desc; + string long_desc; + string owner; ++ string gettext_domain; + // Work around lack of recursive data types + string encoded_default_value; + }; diff --git a/GConf2.spec b/GConf2.spec new file mode 100644 index 0000000..fc5fdcd --- /dev/null +++ b/GConf2.spec @@ -0,0 +1,121 @@ +Name: GConf2 +Version: 3.2.6 +Release: 22 +Summary: GConf is a system for storing application preferences +License: LGPLv2+ and GPLv2+ +URL: http://projects.gnome.org/gconf/ +Source0: http://download.gnome.org/sources/GConf/3.2/GConf-%{version}.tar.xz +Source1: macros.gconf2 + +#PATCH-FIX-http://bugzilla.gnome.org/show_bug.cgi?id=568845 +Patch0000: GConf-gettext.patch +#PATCH-FIX-https://bugzilla.gnome.org/show_bug.cgi?id=671490 +Patch0001: drop-spew.patch +#PATCH-FIX-https://bugzilla.redhat.com/show_bug.cgi?id=755992 +Patch0099: workaround-crash.patch +#PATCH-FIX-upstream-https://patchwork.kernel.org/patch/10583361/ +Patch0100: pkill-hack.patch + +BuildRequires: libxml2-devel >= 2.4.12 libxslt-devel glib2-devel >= 2.25.9 gtk-doc >= 0.9 +BuildRequires: pkgconfig >= 0.14 gettext intltool polkit-devel >= 0.92 dbus-glib-devel >= 0.8 +BuildRequires: gobject-introspection-devel >= 0.6.7 autoconf automake libtool +Requires: dbus psmisc +Conflicts: GConf2-dbus + +Provides: GConf2-gtk = 3.2.6-6 +Obsoletes: GConf2-gtk < 3.2.6-6 + +%description +The root motivation for GConf is to make application preferences more manageable for system administrators. +The initial GConf implementation has some shortcomings in this area; however, the client-side API should be correct, +and the initial implementation is a decent first cut GConf involves a few new concepts, +but no rocket science. Essentially GConf provides a preferences database, which is like a simple filesystem + +%package devel +Summary: Development files for GConf2 package +Requires: %{name} = %{version}-%{release} +Requires: libxml2-devel >= 2.4.12 pkgconfig automake glib2-devel >= 2.25.9 +Conflicts: GConf2-dbus-devel + +%description devel +GConf2-devel package Contains library files needed for doing development. +Essentially GConf provides a preferences database, which is like a simple filesystem + +%prep +%autosetup -n GConf-%{version} -p1 +autoreconf -i -f + +%build +%configure --disable-static --enable-defaults-service --disable-orbit --with-gtk=3.0 +sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0 /g' -e \ +'s/ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then/ \ +func_append compile_command " -Wl,-O1,--as-needed"\n func_append finalize_command " -Wl,-O1,--as-needed"\n\0/' \ +libtool + +%make_build + +%install +%make_install +install -d $RPM_BUILD_ROOT%{_sysconfdir}/gconf/{schemas,gconf.xml.system} +install -d $RPM_BUILD_ROOT%{_rpmconfigdir}/macros.d/ +install -d $RPM_BUILD_ROOT%{_localstatedir}/lib/rpm-state/gconf +install -d $RPM_BUILD_ROOT%{_datadir}/GConf/gsettings +install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_rpmconfigdir}/macros.d/ + +%find_lang %name + +%post +/sbin/ldconfig +if [ $1 -gt 1 ]; then + if ! fgrep -q gconf.xml.system %{_sysconfdir}/gconf/2/path; then + sed -i -e 's@xml:readwrite:$(HOME)/.gconf@&\n\n# Location for system-wide settings.\nxml:readonly:/etc/gconf/gconf.xml.system@' %{_sysconfdir}/gconf/2/path + fi +fi + +%postun -p /sbin/ldconfig + +%files -f %{name}.lang +%license COPYING +%doc NEWS README +%config(noreplace) %{_sysconfdir}/gconf/2/path +%dir %{_sysconfdir}/gconf/2 +%dir %{_sysconfdir}/gconf/gconf.xml.defaults +%dir %{_sysconfdir}/gconf/gconf.xml.mandatory +%dir %{_sysconfdir}/gconf/gconf.xml.system +%dir %{_sysconfdir}/gconf/schemas +%{_bindir}/gconf* +%{_bindir}/gsettings-data-convert +%{_sysconfdir}/xdg/autostart/gsettings-data-convert.desktop +%{_libexecdir}/gconfd-2 +%{_libdir}/*.so.* +%{_libdir}/GConf/2/*.so +%{_datadir}/sgml/gconf +%{_datadir}/GConf +%{_mandir}/man1/* +%exclude %{_mandir}/man1/gsettings-schema-convert.1* +%{_rpmconfigdir}/macros.d/macros.gconf2 +%{_sysconfdir}/dbus-1/system.d/org.gnome.GConf.Defaults.conf +%{_libexecdir}/gconf-defaults-mechanism +%{_datadir}/polkit-1/actions/org.gnome.gconf.defaults.policy +%{_datadir}/dbus-1/system-services/org.gnome.GConf.Defaults.service +%{_datadir}/dbus-1/services/org.gnome.GConf.service +%{_localstatedir}/lib/rpm-state/gconf/ +%{_libdir}/gio/modules/libgsettingsgconfbackend.so +%{_libdir}/girepository-1.0 + +%files devel +%{_libdir}/*.so +%{_includedir}/gconf +%exclude %{_libdir}/*.la +%exclude %{_libdir}/GConf/2/*.la +%exclude %{_libdir}/gio/modules/*.la +%{_datadir}/aclocal/*.m4 +%{_datadir}/gtk-doc/html/gconf +%{_libdir}/pkgconfig/* +%{_datadir}/gir-1.0 +%{_bindir}/gsettings-schema-convert +%{_mandir}/man1/gsettings-schema-convert.1* + +%changelog +* Wed Sep 18 2019 openEuler jimmy - 3.2.6-22 +- Package init jimmy diff --git a/drop-spew.patch b/drop-spew.patch new file mode 100644 index 0000000..b5c899b --- /dev/null +++ b/drop-spew.patch @@ -0,0 +1,98 @@ +From b0895e1998ebc83ab030ec0f17c0685439f5b404 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Mon, 15 Apr 2013 09:57:34 -0400 +Subject: [PATCH] dbus: Don't spew to console when unable to connect to dbus + daemon + +Instead pass the error up for the caller to decide what to do. + +This prevent untrappable warning messages from showing up at the +console if gconftool --makefile-install-rule is called. +--- + gconf/gconf-dbus.c | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/gconf/gconf-dbus.c b/gconf/gconf-dbus.c +index 5610fcf..048e3ea 100644 +--- a/gconf/gconf-dbus.c ++++ b/gconf/gconf-dbus.c +@@ -104,9 +104,9 @@ static GConfEngine *default_engine = NULL; + static GHashTable *engines_by_db = NULL; + static GHashTable *engines_by_address = NULL; + static gboolean dbus_disconnected = FALSE; + +-static gboolean ensure_dbus_connection (void); ++static gboolean ensure_dbus_connection (GError **error); + static gboolean ensure_service (gboolean start_if_not_found, + GError **err); + static gboolean ensure_database (GConfEngine *conf, + gboolean start_if_not_found, +@@ -382,18 +382,20 @@ gconf_engine_detach (GConfEngine *conf) + } + } + + static gboolean +-ensure_dbus_connection (void) ++ensure_dbus_connection (GError **err) + { + DBusError error; + + if (global_conn != NULL) + return TRUE; + + if (dbus_disconnected) + { +- g_warning ("The connection to DBus was broken. Can't reinitialize it."); ++ g_set_error (err, GCONF_ERROR, ++ GCONF_ERROR_NO_SERVER, ++ "The connection to DBus was broken. Can't reinitialize it."); + return FALSE; + } + + dbus_error_init (&error); +@@ -401,9 +403,12 @@ ensure_dbus_connection (void) + global_conn = dbus_bus_get_private (DBUS_BUS_SESSION, &error); + + if (!global_conn) + { +- g_warning ("Client failed to connect to the D-BUS daemon:\n%s", error.message); ++ g_set_error (err, GCONF_ERROR, ++ GCONF_ERROR_NO_SERVER, ++ "Client failed to connect to the D-BUS daemon:\n%s", ++ error.message); + + dbus_error_free (&error); + return FALSE; + } +@@ -430,15 +435,10 @@ ensure_service (gboolean start_if_not_found, + DBusError error; + + if (global_conn == NULL) + { +- if (!ensure_dbus_connection ()) +- { +- g_set_error (err, GCONF_ERROR, +- GCONF_ERROR_NO_SERVER, +- _("No D-BUS daemon running\n")); +- return FALSE; +- } ++ if (!ensure_dbus_connection (err)) ++ return FALSE; + + g_assert (global_conn != NULL); + } + +@@ -2511,9 +2511,9 @@ gboolean + gconf_ping_daemon (void) + { + if (global_conn == NULL) + { +- if (!ensure_dbus_connection ()) ++ if (!ensure_dbus_connection (NULL)) + { + return FALSE; + } + g_assert (global_conn != NULL); +-- +1.8.1.4 + diff --git a/macros.gconf2 b/macros.gconf2 new file mode 100644 index 0000000..928ec70 --- /dev/null +++ b/macros.gconf2 @@ -0,0 +1,86 @@ +# +# RPM macros for gconf applications. +# +# (c) 2006-2007 SUSE LINUX +# Author: Stanislav Brabec +# (c) 2009 Red Hat, Inc +# Author: Toshio Kuratomi +# +# License: LGPLv2+ +# +# Usage: +# +# Preamble: +# Requires(pre): GConf2 +# Requires(preun): GConf2 +# Requires(post): GConf2 +# +# schemas names are without path and suffix +# +# +# %pre +# %gconf_schema_obsolete schema1 +# %gconf_schema_prepare schema2 schema3 +# +# %preun +# %gconf_schema_remove schema2 schema3 +# +# %post +# %gconf_schema_upgrade schema2 schema3 +# +# %files +# %{_sysconfdir}/gconf/schemas/schema2.schemas +# %{_sysconfdir}/gconf/schemas/schema3.schemas + +# Copy schemas from old package for later uninstall on upgrade +%gconf_schema_prepare() \ +if [ "$1" -gt 1 ] ; then \ + rm -rf %{_localstatedir}/lib/rpm-state/gconf/* \ + for schema in %{*} ; do \ + if test -f %{_sysconfdir}/gconf/schemas/"$schema".schemas ; then \ + cp -p %{_sysconfdir}/gconf/schemas/"$schema".schemas %{_localstatedir}/lib/rpm-state/gconf/ || : \ + fi \ + done \ +fi \ +%{nil} + +# Macro to remove schemas. Not meant to be used publically +%_do_gconf_schema_remove() \ + if test -f %{_sysconfdir}/gconf/schemas/"$schema".schemas ; then \ + export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \ + gconftool-2 --makefile-uninstall-rule %{_sysconfdir}/gconf/schemas/"$schema".schemas > /dev/null || : \ + fi \ +%{nil} + +# Remove schemas unconditionally +%gconf_schema_obsolete() \ +for schema in %{*} ; do \ + %_do_gconf_schema_remove \ +done \ +%{nil} + +# Remove schemas on package removal (not upgrade) +%gconf_schema_remove() \ +if [ "$1" -eq 0 ] ; then \ + for schema in %{*} ; do \ + %_do_gconf_schema_remove \ + done \ +fi \ +%{nil} + +%gconf_schema_upgrade() \ +for schema in %{*} ; do \ + if test -f %{_localstatedir}/lib/rpm-state/gconf/"$schema".schemas ; then \ + cmp --quiet %{_sysconfdir}/gconf/schemas/"$schema".schemas %{_localstatedir}/lib/rpm-state/gconf/"$schema".schemas \ + if test $? != 0; then\ + export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \ + gconftool-2 --makefile-uninstall-rule %{_localstatedir}/lib/rpm-state/gconf/"$schema".schemas > /dev/null || : \ + gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/"$schema".schemas > /dev/null || : \ + fi \ + rm -f %{_localstatedir}/lib/rpm-state/gconf/"$schema".schemas \ + else \ + export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \ + gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/"$schema".schemas > /dev/null || : \ + fi \ +done \ +%{nil} diff --git a/pkill-hack.patch b/pkill-hack.patch new file mode 100644 index 0000000..b0936ce --- /dev/null +++ b/pkill-hack.patch @@ -0,0 +1,14 @@ +diff -up GConf-3.2.6/gconf/gconftool.c.pkill-hack GConf-3.2.6/gconf/gconftool.c +--- GConf-3.2.6/gconf/gconftool.c.pkill-hack 2013-04-17 10:46:13.225426329 -0400 ++++ GConf-3.2.6/gconf/gconftool.c 2013-04-17 10:48:25.963508300 -0400 +@@ -916,8 +916,8 @@ main (int argc, char** argv) + + use_local_source = TRUE; + +- /* shut down daemon, this is a race condition, but will usually work. */ +- gconf_shutdown_daemon (NULL); ++ g_spawn_command_line_sync ("/usr/bin/pkill -HUP -f /usr/libexec/gconfd-2", ++ NULL, NULL, NULL, NULL); + } + + if (config_source == NULL) diff --git a/workaround-crash.patch b/workaround-crash.patch new file mode 100644 index 0000000..50ce7a2 --- /dev/null +++ b/workaround-crash.patch @@ -0,0 +1,46 @@ +diff -up GConf-3.2.6/gconf/gconfd.c.workaround-crash GConf-3.2.6/gconf/gconfd.c +--- GConf-3.2.6/gconf/gconfd.c.workaround-crash 2013-04-15 10:12:54.480753142 -0400 ++++ GConf-3.2.6/gconf/gconfd.c 2013-04-15 10:12:53.457736847 -0400 +@@ -1076,17 +1076,6 @@ periodic_cleanup_timeout(gpointer data) + #endif + drop_old_databases (); + +-#ifdef HAVE_DBUS +- if (no_databases_in_use () && gconfd_dbus_client_count () == 0) +-#else +- if (no_databases_in_use () && client_count () == 0) +-#endif +- { +- gconf_log (GCL_INFO, _("GConf server is not in use, shutting down.")); +- gconfd_main_quit (); +- return FALSE; +- } +- + /* expire old locale cache entries */ + gconfd_locale_cache_expire (); + +@@ -1105,7 +1094,6 @@ periodic_cleanup_timeout(gpointer data) + + return TRUE; + } +- + void + gconfd_need_log_cleanup (void) + { +@@ -1131,14 +1119,14 @@ gconf_main(void) + } + + main_loops = g_slist_prepend(main_loops, loop); ++ main_loops = g_slist_prepend(main_loops, loop); + + g_main_loop_run (loop); + + main_loops = g_slist_remove(main_loops, loop); + +- if (main_loops == NULL) ++ if (main_loops == NULL && timeout_id != 0) + { +- g_assert(timeout_id != 0); + g_source_remove(timeout_id); + timeout_id = 0; + }