From c072ab2d7d975781d6649b13cfb5d4ebd9a335ddae68252a7d1aa693d6f5a6fb Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Sat, 2 Aug 2008 01:15:52 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/epiphany?expand=0&rev=30 --- epiphany-bgo300190-default-bookmarks.patch | 298 +++++++++++++++++++++ epiphany-default-bookmarks.patch | 29 -- epiphany.changes | 9 + epiphany.spec | 47 +++- 4 files changed, 350 insertions(+), 33 deletions(-) create mode 100644 epiphany-bgo300190-default-bookmarks.patch delete mode 100644 epiphany-default-bookmarks.patch diff --git a/epiphany-bgo300190-default-bookmarks.patch b/epiphany-bgo300190-default-bookmarks.patch new file mode 100644 index 0000000..d1e6b2d --- /dev/null +++ b/epiphany-bgo300190-default-bookmarks.patch @@ -0,0 +1,298 @@ +Index: src/bookmarks/ephy-bookmarks-import.c +=================================================================== +--- src/bookmarks/ephy-bookmarks-import.c (révision 8368) ++++ src/bookmarks/ephy-bookmarks-import.c (copie de travail) +@@ -812,49 +812,65 @@ ephy_bookmarks_import_xbel (EphyBookmark + return ret >= 0 ? TRUE : FALSE; + } + +-#define OLD_RDF_TEMPORARY_HACK +- + static void +-parse_rdf_subjects (xmlNodePtr node, +- GList **subjects) ++parse_rdf_lang_tag (xmlNode *child, ++ xmlChar **value, ++ int *best_match) + { +- xmlChar *subject; +- +-#ifdef OLD_RDF_TEMPORARY_HACK +- xmlNode *child; ++ const char * const *locales; ++ char *this_language; ++ xmlChar *lang; ++ xmlChar *content; ++ int i; ++ ++ if (*best_match == 0) ++ /* there's no way we can do better */ ++ return; ++ ++ locales = g_get_language_names (); ++ ++ content = xmlNodeGetContent (child); ++ if (!content) ++ return; + +- child = node->children; +- +- while (child != NULL) ++ lang = xmlNodeGetLang (child); ++ if (lang == NULL) + { +- if (xmlStrEqual (child->name, (xmlChar *) "Bag")) +- { +- child = child->children; +- +- while (child != NULL) +- { +- if (xmlStrEqual (child->name, (xmlChar *) "li")) +- { +- subject = xmlNodeGetContent (child); +- *subjects = g_list_append (*subjects, subject); +- } ++ const char *translated; + +- child = child->next; +- } ++ translated = _((char *) content); ++ if ((char *) content != translated) ++ { ++ /* if we have a translation for the content of the ++ * node, then we just use this */ ++ if (*value) xmlFree (*value); ++ *value = (xmlChar *) g_strdup (translated); ++ *best_match = 0; + ++ xmlFree (content); + return; + } + +- child = child->next; ++ this_language = "C"; + } +-#endif ++ else ++ this_language = (char *) lang; + +- subject = xmlNodeGetContent (node); + +- if (subject) +- { +- *subjects = g_list_append (*subjects, subject); ++ for (i = 0; locales[i] && i < *best_match; i++) { ++ if (!strcmp (locales[i], this_language)) { ++ /* if we've already encountered a less accurate ++ * translation, then free it */ ++ if (*value) xmlFree (*value); ++ ++ *value = xmlNodeGetContent (child); ++ *best_match = i; ++ ++ break; ++ } + } ++ ++ if (lang) xmlFree (lang); + } + + static void +@@ -862,43 +878,59 @@ parse_rdf_item (EphyBookmarks *bookmarks + xmlNodePtr node) + { + xmlChar *title = NULL; ++ int best_match_title = INT_MAX; + xmlChar *link = NULL; ++ int best_match_link = INT_MAX; ++ /* we consider that it's better to use a non-localized smart link than ++ * a localized link */ ++ gboolean use_smartlink = FALSE; ++ xmlChar *subject = NULL; + GList *subjects = NULL, *l = NULL; + xmlNode *child; +- EphyNode *bmk; ++ EphyNode *bmk = NULL; + + child = node->children; + +-#ifdef OLD_RDF_TEMPORARY_HACK + link = xmlGetProp (node, (xmlChar *) "about"); +-#endif + + while (child != NULL) + { + if (xmlStrEqual (child->name, (xmlChar *) "title")) + { +- title = xmlNodeGetContent (child); ++ parse_rdf_lang_tag (child, &title, &best_match_title); + } +-#ifndef OLD_RDF_TEMPORARY_HACK +- else if (xmlStrEqual (child->name, (xmlChar *) "link")) ++ else if (xmlStrEqual (child->name, (xmlChar *) "link") && ++ !use_smartlink) + { +- link = xmlNodeGetContent (child); ++ parse_rdf_lang_tag (child, &link, &best_match_link); + } +-#endif +- else if (xmlStrEqual (child->name, (xmlChar *) "subject")) ++ else if (child->ns && ++ xmlStrEqual (child->ns->prefix, (xmlChar *) "ephy") && ++ xmlStrEqual (child->name, (xmlChar *) "smartlink")) + { +- parse_rdf_subjects (child, &subjects); ++ if (!use_smartlink) ++ { ++ use_smartlink = TRUE; ++ best_match_link = INT_MAX; ++ } ++ ++ parse_rdf_lang_tag (child, &link, &best_match_link); + } +- else if (xmlStrEqual (child->name, (xmlChar *) "smartlink")) ++ else if (child->ns && ++ xmlStrEqual (child->ns->prefix, (xmlChar *) "dc") && ++ xmlStrEqual (child->name, (xmlChar *) "subject")) + { +- if (link) xmlFree (link); +- link = xmlNodeGetContent (child); ++ subject = xmlNodeGetContent (child); ++ if (subject) ++ subjects = g_list_prepend (subjects, subject); + } + + child = child->next; + } + +- bmk = bookmark_add (bookmarks, (char *) title, (char *) link); ++ if (title && link) ++ bmk = bookmark_add (bookmarks, (char *) title, (char *) link); ++ + if (bmk) + { + l = subjects; +Index: src/bookmarks/Makefile.am +=================================================================== +--- src/bookmarks/Makefile.am (révision 8368) ++++ src/bookmarks/Makefile.am (copie de travail) +@@ -107,6 +107,7 @@ libephybookmarks_la_CPPFLAGS = \ + -I$(top_srcdir)/embed \ + -I$(top_srcdir)/lib/widgets \ + -I$(top_srcdir)/lib/egg \ ++ -DDATADIR=\""$(pkgdatadir)"\" \ + $(AM_CPPFLAGS) + + libephybookmarks_la_CFLAGS = \ +Index: src/bookmarks/ephy-bookmarks.c +=================================================================== +--- src/bookmarks/ephy-bookmarks.c (révision 8368) ++++ src/bookmarks/ephy-bookmarks.c (copie de travail) +@@ -101,15 +101,6 @@ typedef struct + const char *location; + } EphyBookmarksBookmarkInfo; + +-static const EphyBookmarksBookmarkInfo default_bookmarks [] = +-{ +- /* Translators you should change these links to respect your locale. +- * For instance in .nl these should be +- * "http://www.google.nl" and "http://www.google.nl/search?q=%s" +- */ +- { N_("Search the web"), N_("http://www.google.com/search?q=%s&ie=UTF-8&oe=UTF-8") } +-}; +- + static const char *default_topics [] = + { + N_("Entertainment"), +@@ -151,13 +142,7 @@ ephy_bookmarks_init_defaults (EphyBookma + ephy_bookmarks_add_keyword (eb, _(default_topics[i])); + } + +- for (i = 0; i < G_N_ELEMENTS (default_bookmarks); i++) +- { +- EphyNode *bmk; +- +- bmk = ephy_bookmarks_add (eb, _(default_bookmarks[i].title), +- _(default_bookmarks[i].location)); +- } ++ ephy_bookmarks_import_rdf (eb, DATADIR "/default-bookmarks.rdf"); + } + + static void +Index: data/default-bookmarks.rdf.xml.in +=================================================================== +--- data/default-bookmarks.rdf.xml.in (révision 0) ++++ data/default-bookmarks.rdf.xml.in (révision 0) +@@ -0,0 +1,23 @@ ++ ++ ++ ++ Epiphany bookmarks ++ http://www.gnome.org/projects/epiphany/ ++ ++ ++ ++ ++ ++ ++ ++ <_title>Search the web ++ ++ <_link>http://www.google.com ++ ++ <_ephy:smartlink>http://www.google.com/search?q=%s&ie=UTF-8&oe=UTF-8 ++ ++ +Index: data/Makefile.am +=================================================================== +--- data/Makefile.am (révision 8368) ++++ data/Makefile.am (copie de travail) +@@ -60,6 +60,17 @@ service_DATA = $(service_in_files:.servi + $(service_DATA): $(service_in_files) Makefile + @sed -e "s|\@bindir\@|$(bindir)|" $< > $@ + ++# Default bookmarks ++# intltool hack: we name the file .xml.in so that intltool knows it's xml ++# format and can analyze it. ++# We don't put translations in the resulting rdf since the code can get ++# the translations via gettext (although it can also get translations ++# from the rdf if they are there and not available via gettext) ++default_bookmarksdir = $(pkgdatadir) ++default_bookmarks_in_files = default-bookmarks.rdf.xml.in ++default_bookmarks_DATA = $(default_bookmarks_in_files:.rdf.xml.in=.rdf) ++$(default_bookmarks_DATA): $(default_bookmarks_in_files) Makefile ++ @sed -e "s|\@pkgdatadir\@|$(pkgdatadir)|;s|_title|title|g;s|_link|link|g;s|_ephy:smartlink|ephy:smartlink|g" $< > $@ + + install-data-local: $(schema_DATA) + if GCONF_SCHEMAS_INSTALL +@@ -83,6 +94,7 @@ EXTRA_DIST = \ + $(xsl_DATA) \ + $(service_DATA) \ + $(m4data_DATA) \ ++ $(default_bookmarks_in_files) \ + epiphany-service.xml \ + check-mime.py \ + generate-font-schemas.py +@@ -92,4 +104,5 @@ DISTCLEANFILES = \ + $(schema_in_files:.schemas.in=.schemas) \ + $(pkgconfig_DATA) \ + $(default_prefs_DATA) \ +- $(desktop_DATA) ++ $(desktop_DATA) \ ++ $(default_bookmarks_DATA) +Index: po/POTFILES.in +=================================================================== +--- po/POTFILES.in (révision 8368) ++++ po/POTFILES.in (copie de travail) +@@ -2,6 +2,7 @@ + # List of source files containing translatable strings. + # Please keep this file sorted alphabetically. + data/bme.desktop.in.in ++data/default-bookmarks.rdf.xml.in + data/epiphany.desktop.in.in + data/epiphany-lockdown.schemas.in + data/epiphany.schemas.in diff --git a/epiphany-default-bookmarks.patch b/epiphany-default-bookmarks.patch deleted file mode 100644 index 098d4f7..0000000 --- a/epiphany-default-bookmarks.patch +++ /dev/null @@ -1,29 +0,0 @@ -Index: epiphany-2.19.6/data/epiphany-bookmarks-html.xsl -=================================================================== ---- epiphany-2.19.6.orig/data/epiphany-bookmarks-html.xsl -+++ epiphany-2.19.6/data/epiphany-bookmarks-html.xsl -@@ -51,7 +51,7 @@ $Id: epiphany-bookmarks-html.xsl 6952 20 -
- - -- -+ - - - -Index: epiphany-2.19.6/src/bookmarks/ephy-bookmarks.c -=================================================================== ---- epiphany-2.19.6.orig/src/bookmarks/ephy-bookmarks.c -+++ epiphany-2.19.6/src/bookmarks/ephy-bookmarks.c -@@ -102,7 +102,10 @@ static const EphyBookmarksBookmarkInfo d - * For instance in .nl these should be - * "http://www.google.nl" and "http://www.google.nl/search?q=%s" - */ -- { N_("Search the web"), N_("http://www.google.com/search?q=%s&ie=UTF-8&oe=UTF-8") } -+ { N_("Search the web"), N_("http://www.google.com/search?q=%s&ie=UTF-8&oe=UTF-8") }, -+ { N_("openSUSE News"), N_("http://news.opensuse.org/") } -+ /* I'm not sure how to do this properly, or if you even can: -+ { N_("openSUSE News Feed"), N_("http://news.opensuse.org/?feed=rss2") } */ - }; - - static const char *default_topics [] = diff --git a/epiphany.changes b/epiphany.changes index d1cb02c..f696f1d 100644 --- a/epiphany.changes +++ b/epiphany.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Jul 30 03:29:27 CEST 2008 - vuntz@novell.com + +- Add epiphany-bgo300190-default-bookmarks.patch to specify + default bookmarks via a RDF file. (bgo#300190) +- Remove epiphany-default-bookmarks.patch: this will go in a + separate branding package. +- Add epiphany-branding-upstream package. + ------------------------------------------------------------------- Fri Jul 18 13:34:47 CEST 2008 - rodrigo@suse.de diff --git a/epiphany.spec b/epiphany.spec index 4856e9a..8de5585 100644 --- a/epiphany.spec +++ b/epiphany.spec @@ -30,7 +30,7 @@ Requires: mozilla => %{mozilla_ver} %endif %endif Version: 2.22.2 -Release: 10 +Release: 24 Requires: %{name}-lang = %{version} License: GPL v2 or later Group: Productivity/Networking/Web/Browsers @@ -38,13 +38,14 @@ Summary: GNOME Web Browser Based on the Mozilla Rendering Engine Source: %{name}-%{version}.tar.bz2 # PATCH-FIX-OPENSUSE epiphany-browser-plugins.patch bnc222861 -- Handle suse specific plugins dir Patch1: epiphany-browser-plugins.patch -# PATCH-FIX-OPENSUSE epiphany-default-bookmarks.patch bnc293690 -- openSUSE specific bookmarks -Patch2: epiphany-default-bookmarks.patch # PATCH-FIX-OPENSUSE epiphany-libtool.patch -- Create libtool before use Patch4: epiphany-libtool.patch +# PATCH-FEATURE-UPSTREAM epiphany-bgo300190-default-bookmarks.patch bgo300190 vuntz@novell.com -- Use rdf to specify default bookmarks +Patch5: epiphany-bgo300190-default-bookmarks.patch Url: http://www.gnome.org/projects/epiphany/ BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: python-gtk python-gnome iso-codes gnome-icon-theme +Requires: %{name}-branding AutoReqProv: on %gconf_schemas_prereq @@ -99,6 +100,33 @@ This package contains developer documentation for epiphany. +Authors: +-------- + Marco Pesenti Gritti + Xan Lopez + Christian Persch + Adam Hooper + Jean-François Rameau + Crispin Flowerday + +%package branding-upstream +License: GPL v2 or later +Summary: Upstream branding of Epiphany +Group: Productivity/Networking/Web/Browsers +Provides: %{name}-branding = %{version} +Supplements: packageand(branding-upstream:%{name}) +#BRAND: Provide a few files - +#BRAND: /usr/share/epiphany/default-bookmarks.rdf +#BRAND: the default bookmarks +#BRAND: /usr/share/epiphany/chrome/branding/brand.dtd +#BRAND: /usr/share/epiphany/chrome/branding/brand.properties +#BRAND: branding information that can be patched + +%description branding-upstream +This package provides upstream Look and Feel for Epiphany. + + + Authors: -------- Marco Pesenti Gritti @@ -112,8 +140,8 @@ Authors: %prep %setup -q %patch1 -%patch2 -p1 %patch4 +%patch5 %build #cp -i data/default-prefs-gecko-1-8.js data/default-prefs-xulrunner.js @@ -186,7 +214,18 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root) %{_datadir}/gtk-doc/html/epiphany +%files branding-upstream +%defattr(-,root,root) +%{_datadir}/epiphany/default-bookmarks.rdf +%{_datadir}/epiphany/chrome/branding/* + %changelog +* Wed Jul 30 2008 vuntz@novell.com +- Add epiphany-bgo300190-default-bookmarks.patch to specify + default bookmarks via a RDF file. (bgo#300190) +- Remove epiphany-default-bookmarks.patch: this will go in a + separate branding package. +- Add epiphany-branding-upstream package. * Fri Jul 18 2008 rodrigo@suse.de - Fixed tagging of patches * Wed Jun 18 2008 maw@suse.de