From ea09416b674d221b2acfce7c6154db3b13d5653e4f668c8326a739206c0ebc02 Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Tue, 19 Apr 2011 07:12:56 +0000 Subject: [PATCH 1/3] Updating link to change in openSUSE:Factory/libproxy revision 30.0 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/libproxy?expand=0&rev=595c93ce57c828949b341edc2a35769c --- libproxy-plugins.spec | 2 +- libproxy.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libproxy-plugins.spec b/libproxy-plugins.spec index 4306aad..505c413 100644 --- a/libproxy-plugins.spec +++ b/libproxy-plugins.spec @@ -43,7 +43,7 @@ Name: libproxy-plugins Group: System/Libraries Summary: Libproxy provides consistent proxy configuration to applications Version: 0.4.6 -Release: 3 +Release: 4 %if 0%{?build_snapshot} %define _sourcename %{_name} %else diff --git a/libproxy.spec b/libproxy.spec index 389ac27..88eadb0 100644 --- a/libproxy.spec +++ b/libproxy.spec @@ -43,7 +43,7 @@ Name: libproxy Group: System/Libraries Summary: Libproxy provides consistent proxy configuration to applications Version: 0.4.6 -Release: 8 +Release: 9 %if 0%{?build_snapshot} %define _sourcename %{_name} %else From 60d08a653e6f02c57895b6ed7ada0dda64102487ca44a342c91c78ffa99d9f3e Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Tue, 7 Jun 2011 10:47:11 +0000 Subject: [PATCH 2/3] Accepting request 72832 from home:dimstar:branches:GNOME:Factory Update to 0.4.7... with full gnome3 support.. yay OBS-URL: https://build.opensuse.org/request/show/72832 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/libproxy?expand=0&rev=62 --- baselibs.conf | 12 +- libproxy-0.4.6.tar.bz2 | 3 - libproxy-0.4.7.tar.bz2 | 3 + libproxy-backports.patch | 151 ----------------------- libproxy-plugins.changes | 35 ++++++ libproxy-plugins.spec | 54 ++++++--- libproxy-sysconfig-support.patch | 201 ------------------------------- libproxy-xul2.patch | 104 ---------------- libproxy.changes | 32 ++++- libproxy.spec | 52 ++++++-- 10 files changed, 155 insertions(+), 492 deletions(-) delete mode 100644 libproxy-0.4.6.tar.bz2 create mode 100644 libproxy-0.4.7.tar.bz2 delete mode 100644 libproxy-backports.patch delete mode 100644 libproxy-sysconfig-support.patch delete mode 100644 libproxy-xul2.patch diff --git a/baselibs.conf b/baselibs.conf index 894f8b9..260e408 100644 --- a/baselibs.conf +++ b/baselibs.conf @@ -1,11 +1,13 @@ libproxy1 libproxy1-config-gnome - supplements "packageand(libproxy1-:libproxy1-gnome)" + supplements "packageand(libproxy1-:libproxy1-config-gnome)" +libproxy1-config-gnome3 + supplements "packageand(libproxy1-:libproxy1-config-gnome3)" libproxy1-config-kde4 - supplements "packageand(libproxy1-:libproxy1-kde)" + supplements "packageand(libproxy1-:libproxy1-config-kde)" libproxy1-pacrunner-mozjs - supplements "packageand(libproxy1-:libproxy1-mozjs)" + supplements "packageand(libproxy1-:libproxy1-config-mozjs)" libproxy1-networkmanager - supplements "packageand(libproxy1-:libproxy1-networkmanager)" + supplements "packageand(libproxy1-:libproxy1-config-networkmanager)" libproxy1-pacrunner-webkit - supplements "packageand(libproxy1-:libproxy1-webkit)" + supplements "packageand(libproxy1-:libproxy1-config-webkit)" diff --git a/libproxy-0.4.6.tar.bz2 b/libproxy-0.4.6.tar.bz2 deleted file mode 100644 index 8039232..0000000 --- a/libproxy-0.4.6.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9be19e35cec7de2159ad68b620665f02c25938d186697176125e9ad89220fb85 -size 71816 diff --git a/libproxy-0.4.7.tar.bz2 b/libproxy-0.4.7.tar.bz2 new file mode 100644 index 0000000..c2603e1 --- /dev/null +++ b/libproxy-0.4.7.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:76ab598e64cde209734191dc9efd631bbbe7c161f617e420dff1896497bc0f02 +size 77714 diff --git a/libproxy-backports.patch b/libproxy-backports.patch deleted file mode 100644 index c315fd1..0000000 --- a/libproxy-backports.patch +++ /dev/null @@ -1,151 +0,0 @@ -Index: libproxy/url.cpp -=================================================================== ---- libproxy/url.cpp.orig -+++ libproxy/url.cpp -@@ -36,12 +36,9 @@ - - #ifdef WIN32 - #include --#define pfsize(st) (st.st_size) - #define close _close - #define read _read - #define SHUT_RDWR SD_BOTH --#else --#define pfsize(st) (st.st_blksize * st.st_blocks) - #endif - - #include "url.hpp" -@@ -56,13 +53,6 @@ using namespace std; - // This is the maximum pac size (to avoid memory attacks) - #define PAC_MAX_SIZE 102400 - --const string url::GENERIC_DELIMITERS(":/?#[]@"); --const string url::SUBCOMPONENT_DELIMITERS("!$&'()*+,;="); --const string url::ALLOWED_IN_USERINFO_ELEMENT(url::SUBCOMPONENT_DELIMITERS); --const string url::ALLOWED_IN_USERINFO(url::ALLOWED_IN_USERINFO_ELEMENT + ":"); --const string url::ALLOWED_IN_PATH_ELEMENT(url::SUBCOMPONENT_DELIMITERS + ":@"); --const string url::ALLOWED_IN_PATH(url::ALLOWED_IN_PATH_ELEMENT + "/"); -- - static inline int get_default_port(string scheme) { - struct servent *serv; - size_t plus = scheme.find('+'); -@@ -109,8 +99,8 @@ bool url::is_valid(const string url_) { - - string url::encode(const string &data, const string &valid_reserved) { - ostringstream encoded; -- for (int i=0; data[i]; i++) { -- if (isalnum(data[i]) -+ for (unsigned int i=0; i < data.size(); i++) { -+ if (isalnum((unsigned char)data[i]) - || valid_reserved.find(data[i]) != string::npos - || string("-._~").find(data[i]) != string::npos) - encoded << data[i]; -@@ -211,7 +201,8 @@ url::url(const string &url) throw(parse_ - host_start = userinfo_end + 1; - - /* Check for IPv6 IP */ -- if (hier_part[host_start] == '[') { -+ if (host_start < hier_part.size() -+ && hier_part[host_start] == '[') { - host_end = hier_part.find(']', host_start); - if (host_end == string::npos) - throw parse_error("Invalid URL: " + url); -@@ -232,7 +223,7 @@ url::url(const string &url) throw(parse_ - /* Get port */ - m_port = get_default_port(m_scheme); - -- if (host_end != hier_part.size() -+ if (host_end < hier_part.size() - && hier_part[host_end] == ':') { - size_t port_start = host_end + 1; - m_port = atoi(hier_part.c_str() + port_start); -@@ -400,10 +391,12 @@ char* url::get_pac() { - struct stat st; - if ((sock = ::open(m_path.c_str(), O_RDONLY)) < 0) - return NULL; -- if (!fstat(sock, &st) && pfsize(st) < PAC_MAX_SIZE) { -- buffer = new char[pfsize(st)+1]; -- if (read(sock, buffer, pfsize(st)) == 0) { -- delete buffer; -+ -+ if (!fstat(sock, &st) && st.st_size < PAC_MAX_SIZE) { -+ buffer = new char[st.st_size+1]; -+ memset(buffer, 0, st.st_size+1); -+ if (read(sock, buffer, st.st_size) == 0) { -+ delete[] buffer; - buffer = NULL; - } - } -Index: libproxy/modules/config_gnome.cpp -=================================================================== ---- libproxy/modules/config_gnome.cpp.orig -+++ libproxy/modules/config_gnome.cpp -@@ -102,10 +102,8 @@ static int popen2(const char *program, F - if (dup2(rpipe[1], STDOUT_FILENO) != STDOUT_FILENO) _exit(2); - - // Close unneeded fds -- close(rpipe[0]); -- close(rpipe[1]); -- close(wpipe[0]); -- close(wpipe[1]); -+ for (int i = 3; i < sysconf(_SC_OPEN_MAX); i++) -+ close(i); - - // Exec - execl("/bin/sh", "sh", "-c", program, (char*) NULL); -@@ -194,8 +192,8 @@ public: - else if (this->data[PROXY_MODE] == "manual") { - string type, host, port; - bool auth = this->data[PROXY_USE_AUTHENTICATION] == "true"; -- string username = url::encode(this->data[PROXY_AUTH_USER], url::ALLOWED_IN_USERINFO_ELEMENT); -- string password = url::encode(this->data[PROXY_AUTH_PASSWORD], url::ALLOWED_IN_USERINFO_ELEMENT); -+ string username = url::encode(this->data[PROXY_AUTH_USER], URL_ALLOWED_IN_USERINFO_ELEMENT); -+ string password = url::encode(this->data[PROXY_AUTH_PASSWORD], URL_ALLOWED_IN_USERINFO_ELEMENT); - bool same_proxy = this->data[PROXY_SAME_FOR_ALL] == "true"; - - // If socks is set use it (except when same_proxy is set) -Index: libproxy/proxy.cpp -=================================================================== ---- libproxy/proxy.cpp.orig -+++ libproxy/proxy.cpp -@@ -164,7 +164,7 @@ proxy_factory::proxy_factory() { - proxy_factory::~proxy_factory() { - lock(); - -- if (this->pac) delete this->pac; -+ if (this->pac) delete[] this->pac; - if (this->pacurl) delete this->pacurl; - - unlock(); -Index: libproxy/url.hpp -=================================================================== ---- libproxy/url.hpp.orig -+++ libproxy/url.hpp -@@ -27,6 +27,13 @@ - - #include "config.hpp" - -+#define URL_GENERIC_DELIMITERS ":/?#[]@" -+#define URL_SUBCOMPONENT_DELIMITERS "!$&'()*+,;=" -+#define URL_ALLOWED_IN_USERINFO_ELEMENT URL_SUBCOMPONENT_DELIMITERS -+#define URL_ALLOWED_IN_USERINFO URL_ALLOWED_IN_USERINFO_ELEMENT ":" -+#define URL_ALLOWED_IN_PATH_ELEMENT URL_SUBCOMPONENT_DELIMITERS ":@" -+#define URL_ALLOWED_IN_PATH URL_ALLOWED_IN_PATH_ELEMENT "/" -+ - namespace libproxy { - - using namespace std; -@@ -38,13 +45,6 @@ public: - - class DLL_PUBLIC url { - public: -- static const string ALLOWED_IN_PATH; -- static const string ALLOWED_IN_PATH_ELEMENT; -- static const string ALLOWED_IN_USERINFO; -- static const string ALLOWED_IN_USERINFO_ELEMENT; -- static const string GENERIC_DELIMITERS; -- static const string SUBCOMPONENT_DELIMITERS; -- - static bool is_valid(const string url); - static string encode(const string &data, const string &valid_reserved = ""); - diff --git a/libproxy-plugins.changes b/libproxy-plugins.changes index 8e30241..403a4f7 100644 --- a/libproxy-plugins.changes +++ b/libproxy-plugins.changes @@ -1,3 +1,38 @@ +------------------------------------------------------------------- +Mon Jun 6 21:51:45 UTC 2011 - dimstar@opensuse.org + +- Update to version 0.4.7: + + Support/require xulrunner 2.0+ + + Support linking againgst libwebkit-gtk3 (-DWITH_WEBKIT3=ON) + + Port to gsettings for gnome3. (-DWITH_GNOME3=ON[default]) + + Issues closed: + - #149: always test for the right python noarch module path + - #155: Cannot compile with Firefox 4 + - #156: libproxy should build against webkitgtk-3.0 + - #158: Won't compile w/ xulrunner 2.0 final + - #159: libproxy fails with autoconfiguration + "http://proxy.domain.com" + - #131: GSettings-based GNOME plugin + - #150: SUSE sysconfig/proxy config support +- Drop upstream included patches: + + libproxy-sysconfig-support.patch + + libproxy-xul2.patch + + libproxy-backports.patch +- Package gnome3 module if favor_gtk2 is not set (project metadata) +- Add gnome3 module to baselibs.conf and fixup the various + supplements in baselibs.conf (pointed to the pre -config names). +- When building for gnome3 (favor_gtk2 = 0), add BuildRequires: + pkgconfig(gio-2.0) >= 2.26, pkgconfig(gobject-2.0) and + pkgconfig(webkitgtk-3.0) +- When building for gnome2, add BuildRequires: + pkgconfig(gconf-2.0), pkgconfig(gobject-2.0) and replace + libwebkit-devel with pkgconfig(webkit-1.0). + +------------------------------------------------------------------- +Tue Apr 19 00:10:03 CEST 2011 - ro@suse.de + +- Update baselibs.conf. + ------------------------------------------------------------------- Tue Feb 15 19:16:02 UTC 2011 - dimstar@opensuse.org diff --git a/libproxy-plugins.spec b/libproxy-plugins.spec index 505c413..00364bc 100644 --- a/libproxy-plugins.spec +++ b/libproxy-plugins.spec @@ -1,5 +1,5 @@ # -# spec file for package libproxy-plugins +# spec file for package libproxy # # Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -42,8 +42,8 @@ Url: http://code.google.com/p/libproxy/ Name: libproxy-plugins Group: System/Libraries Summary: Libproxy provides consistent proxy configuration to applications -Version: 0.4.6 -Release: 4 +Version: 0.4.7 +Release: 1 %if 0%{?build_snapshot} %define _sourcename %{_name} %else @@ -53,12 +53,6 @@ Source: http://libproxy.googlecode.com/files/%{_sourcename}.tar.bz2 # Script used for automatic snapshot updates Source98: update-from-svn.sh Source99: baselibs.conf -# PATCH-FEATURE-UPSTREAM libproxy-sysconfig-support.patch bnc#655483 dmacvicar@novell.com -- Add /etc/sysconfig support. Also tracked at http://code.google.com/p/libproxy/issues/detail?id=150 -Patch0: libproxy-sysconfig-support.patch -# PATCH-FEATURE-UPSTREAM libproxy-xul2.patch dimstar@opensuse.org -- Add compatibility to build against xulrunner 2.0 -Patch1: libproxy-xul2.patch -# PATCH-FIX-UPSTREAM libproxy-backports.patch dimstar@opensuse.org -- Backport from upstream source: svn revs: 769,771,776,777,778,780,781,782 -Patch2: libproxy-backports.patch License: GPLv2+ ; LGPLv2.1+ BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: cmake @@ -73,7 +67,15 @@ BuildRequires: gconf2-devel # For directory ownership, but also because we want to rebuild the modules if # the library changed BuildRequires: libproxy1 -BuildRequires: libwebkit-devel +%if 0%{?favor_gtk2} +BuildRequires: pkgconfig(gconf-2.0) +BuildRequires: pkgconfig(gobject-2.0) +BuildRequires: pkgconfig(webkit-1.0) +%else +BuildRequires: pkgconfig(gio-2.0) >= 2.26 +BuildRequires: pkgconfig(gobject-2.0) +BuildRequires: pkgconfig(webkitgtk-3.0) +%endif %if 0%{?suse_version} BuildRequires: mozilla-xulrunner%{xulrunner_ver}-devel %else @@ -212,21 +214,34 @@ libproxy offers the following features: * extremely small core %else +%if 0%{?favor_gtk2} %package -n libproxy1-config-gnome -License: GPLv2+ ; LGPLv2.1+ Summary: Libproxy module for GNOME configuration +%else +%package -n libproxy1-config-gnome3 +Summary: Libproxy module for GNOME3 configuration +%endif +License: GPLv2+ ; LGPLv2.1+ Group: System/Libraries Requires: libproxy1 = %{version} %if 0%{?suse_version} Recommends: libproxy1-pacrunner = %{version} +%if 0%{?favor_gtk2} Supplements: packageand(libproxy1:gconf2) %else +Supplements: packageand(libproxy1:libgio-2_0-0) +%endif +%else Requires: libproxy1-pacrunner = %{version} %endif Provides: libproxy-gnome = %{version} Obsoletes: libproxy-gnome < %{version} +%if 0%{?favor_gtk2} %description -n libproxy1-config-gnome +%else +%description -n libproxy1-config-gnome3 +%endif A module to extend libproxy with capabilities to query GNOME about proxy settings. @@ -299,9 +314,6 @@ about network configuration changes. %prep %setup -q -n %{_sourcename} mkdir build -%patch0 -p0 -%patch1 -p0 -%patch2 -p0 %build cd build @@ -342,6 +354,13 @@ cmake \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_INSTALL_CONFIG_NAME=RelWithDebInfo \ %endif +%if 0%{?favor_gtk2} + -DWITH_WEBKIT3=OFF \ + -DWITH_GNOME3=OFF \ +%else + -DWITH_WEBKIT3=ON \ + -DWITH_GNOME3=ON \ +%endif .. %{__make} VERBOSE=1 @@ -445,10 +464,17 @@ make test %defattr(-, root, root) %{_libdir}/libproxy-%{version}/modules/config_kde4.so +%if 0%{?favor_gtk2} %files -n libproxy1-config-gnome %defattr(-, root, root) %{_libdir}/libproxy-%{version}/modules/config_gnome.so %{_libexecdir}/libproxy-%{version}/pxgconf +%else +%files -n libproxy1-config-gnome3 +%defattr(-, root, root) +%{_libdir}/libproxy-%{version}/modules/config_gnome3.so +%{_libexecdir}/libproxy-%{version}/pxgsettings +%endif %files -n libproxy1-networkmanager %defattr(-, root, root) diff --git a/libproxy-sysconfig-support.patch b/libproxy-sysconfig-support.patch deleted file mode 100644 index 08608b0..0000000 --- a/libproxy-sysconfig-support.patch +++ /dev/null @@ -1,201 +0,0 @@ -Index: libproxy/cmake/modules.cmk -=================================================================== ---- libproxy/cmake/modules.cmk (revision 775) -+++ libproxy/cmake/modules.cmk (working copy) -@@ -9,6 +9,7 @@ - include(cmake/pxmodule.cmk) - include(cmake/pkgconfig.cmk) - include(cmake/modules/config_envvar.cmk) -+include(cmake/modules/config_sysconfig.cmk) - include(cmake/modules/config_gnome.cmk) - include(cmake/modules/config_kde4.cmk) - include(cmake/modules/config_macosx.cmk) -@@ -27,6 +28,7 @@ - # - message("MODULES TO BUILD:") - px_module(config_envvar "${ENVVAR_FOUND}" 1) -+px_module(config_sysconfig "${SYSCONFIG_FOUND}" 1) - px_module(config_gnome "${GNOME_FOUND}" 0) - px_module(config_kde4 "${KDE4_FOUND}" 0 ${KDE4_LIBRARIES}) - px_module(config_macosx "${SC_FOUND}" 1 ${SC_LIBRARIES} ${CF_LIBRARIES}) -Index: libproxy/cmake/modules/config_sysconfig.cmk -=================================================================== ---- libproxy/cmake/modules/config_sysconfig.cmk (revision 0) -+++ libproxy/cmake/modules/config_sysconfig.cmk (revision 0) -@@ -0,0 +1,5 @@ -+if (NOT WIN32 AND NOT APPLE) -+ if (EXISTS "/etc/sysconfig" AND IS_DIRECTORY "/etc/sysconfig") -+ set(SYSCONFIG_FOUND 1) -+ endif() -+endif() -\ No newline at end of file -Index: libproxy/modules/config_sysconfig.cpp -=================================================================== ---- libproxy/modules/config_sysconfig.cpp (revision 0) -+++ libproxy/modules/config_sysconfig.cpp (revision 0) -@@ -0,0 +1,165 @@ -+/******************************************************************************* -+ * libproxy sysconfig module -+ * Copyright (C) 2010 Novell Inc. -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with this library; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ ******************************************************************************/ -+ -+#include -+#include -+#include -+#include -+ -+#include "../extension_config.hpp" -+using namespace libproxy; -+using std::map; -+ -+enum Trim { -+ NO_TRIM = 0x00, -+ L_TRIM = 0x01, -+ R_TRIM = 0x02, -+ TRIM = (L_TRIM|R_TRIM) -+}; -+ -+static std::string trim( const std::string & s, const Trim trim_r = TRIM ) { -+ -+ if (s.empty() || trim_r == NO_TRIM) -+ return s; -+ -+ std::string ret(s); -+ -+ if (trim_r & L_TRIM) { -+ std::string::size_type p = ret.find_first_not_of(" \t\n"); -+ if (p == std::string::npos) -+ return std::string(); -+ -+ ret = ret.substr(p); -+ } -+ -+ if (trim_r & R_TRIM) { -+ std::string::size_type p = ret.find_last_not_of(" \t\n"); -+ if (p == std::string::npos) -+ return std::string(); -+ -+ ret = ret.substr(0, p+1); -+ } -+ -+ return ret; -+} -+ -+static map sysconfig_read(const string &_path) { -+ -+ map ret; -+ string line; -+ -+ ifstream in(_path.c_str()); -+ if (in.fail()) { -+ return ret; -+ } -+ -+ while(getline( in, line)) { -+ -+ if (*line.begin() != '#') { -+ -+ string::size_type pos = line.find('=', 0); -+ -+ if (pos != string::npos) { -+ -+ string key = trim(line.substr(0, pos)); -+ string value = trim(line.substr(pos + 1, line.length() - pos - 1)); -+ -+ if (value.length() >= 2 -+ && *(value.begin()) == '"' -+ && *(value.rbegin()) == '"') { -+ value = value.substr( 1, value.length() - 2 ); -+ } -+ -+ if (value.length() >= 2 -+ && *(value.begin()) == '\'' -+ && *(value.rbegin()) == '\'' ) { -+ value = value.substr( 1, value.length() - 2 ); -+ } -+ ret[key] = value; -+ } // '=' found -+ -+ } // not comment -+ -+ } // while getline -+ return ret; -+} -+ -+static bool should_use_sysconfig() -+{ -+ struct stat st; -+ if (stat("/etc/sysconfig", &st) == 0) -+ return (getuid() == 0); -+ return false; -+} -+ -+class sysconfig_config_extension : public config_extension { -+ -+ map _data; -+ -+public: -+ sysconfig_config_extension() -+ : _data(sysconfig_read("/etc/sysconfig/proxy")) { -+ -+ } -+ -+ ~sysconfig_config_extension() { -+ } -+ -+ url get_config(url url) throw (runtime_error) { -+ map::const_iterator it = _data.find("PROXY_ENABLED"); -+ if (it != _data.end() && it->second == "no") -+ return libproxy::url("direct://"); -+ -+ string key; -+ string proxy; -+ -+ // If the URL is an ftp url, try to read the ftp proxy -+ if (url.get_scheme() == "ftp") -+ key = "FTP_PROXY"; -+ else if (url.get_scheme() == "http") -+ key = "HTTP_PROXY"; -+ else if (url.get_scheme() == "https") -+ key = "HTTPS_PROXY"; -+ -+ it = _data.find(key); -+ if (it != _data.end()) -+ proxy = it->second; -+ -+ if (proxy.empty()) -+ throw runtime_error("Unable to read configuration"); -+ -+ return libproxy::url(proxy); -+ } -+ -+ string get_ignore(url) { -+ map::const_iterator it = _data.find("NO_PROXY"); -+ if (it != _data.end()) -+ return it->second; -+ return ""; -+ } -+ -+ // if we are running as root, and the module is used, then -+ // make sure this is the first method tried -+ virtual bool operator<(const base_extension&) const { -+ return true; -+ } -+}; -+ -+MM_MODULE_INIT_EZ(sysconfig_config_extension, should_use_sysconfig(), NULL, NULL); -+ diff --git a/libproxy-xul2.patch b/libproxy-xul2.patch deleted file mode 100644 index 9807957..0000000 --- a/libproxy-xul2.patch +++ /dev/null @@ -1,104 +0,0 @@ -Index: libproxy/cmake/modules/pacrunner_mozjs.cmk -=================================================================== ---- libproxy/cmake/modules/pacrunner_mozjs.cmk (revision 783) -+++ libproxy/cmake/modules/pacrunner_mozjs.cmk (working copy) -@@ -14,6 +14,10 @@ - if(MOZJS_FOUND) - include_directories(${MOZJS_INCLUDE_DIRS}) - link_directories(${MOZJS_LIBRARY_DIRS}) -+ pkg_search_module(MOZJS2 mozilla-js>=2.0b10) -+ if(MOZJS2_FOUND) -+ add_definitions(-DHAVE_MOZJS_2) -+ endif(MOZJS2_FOUND) - else() - set(MOZJS_FOUND 0) - endif() -Index: libproxy/modules/pacrunner_mozjs.cpp -=================================================================== ---- libproxy/modules/pacrunner_mozjs.cpp (revision 783) -+++ libproxy/modules/pacrunner_mozjs.cpp (working copy) -@@ -42,12 +42,12 @@ - #define INET6_ADDRSTRLEN 46 - #endif - --static JSBool dnsResolve(JSContext *cx, JSObject * /*obj*/, uintN /*argc*/, jsval *argv, jsval *rval) { -+static JSBool dnsResolve_(JSContext *cx, jsval hostname, jsval *vp) { - // Get hostname argument -- char *tmp = JS_strdup(cx, JS_GetStringBytes(JS_ValueToString(cx, argv[0]))); -+ char *tmp = JS_EncodeString(cx, JS_ValueToString(cx, hostname)); - - // Set the default return value -- *rval = JSVAL_NULL; -+ JS_SET_RVAL(cx, vp, JSVAL_NULL); - - // Look it up - struct addrinfo *info = NULL; -@@ -66,7 +66,7 @@ - NI_NUMERICHOST)) goto out; - - // We succeeded -- *rval = STRING_TO_JSVAL(JS_NewString(cx, tmp, strlen(tmp))); -+ JS_SET_RVAL(cx, vp, STRING_TO_JSVAL(JS_NewStringCopyN(cx, tmp, strlen(tmp)))); - tmp = NULL; - - out: -@@ -75,15 +75,20 @@ - return true; - } - --static JSBool myIpAddress(JSContext *cx, JSObject *obj, uintN /*argc*/, jsval * /*argv*/, jsval *rval) { -+static JSBool dnsResolve(JSContext *cx, uintN /*argc*/, jsval *vp) { -+ jsval *argv = JS_ARGV(cx, vp); -+ return dnsResolve_(cx, argv[0], vp); -+} -+ -+static JSBool myIpAddress(JSContext *cx, uintN /*argc*/, jsval *vp) { - char *hostname = (char *) JS_malloc(cx, 1024); - if (!gethostname(hostname, 1023)) { -- JSString *myhost = JS_NewString(cx, hostname, strlen(hostname)); -+ JSString *myhost = JS_NewStringCopyN(cx, hostname, strlen(hostname)); - jsval arg = STRING_TO_JSVAL(myhost); -- return dnsResolve(cx, obj, 1, &arg, rval); -+ return dnsResolve_(cx, 1, &arg); - } - JS_free(cx, hostname); -- *rval = JSVAL_NULL; -+ JS_SET_RVAL(cx, vp, JSVAL_NULL); - return true; - } - -@@ -111,7 +116,11 @@ - //JS_SetOptions(this->jsctx, JSOPTION_VAROBJFIX); - //JS_SetVersion(this->jsctx, JSVERSION_LATEST); - //JS_SetErrorReporter(cx, reportError); -+ #ifdef HAVE_MOZJS_2 -+ if (!(this->jsglb = JS_NewCompartmentAndGlobalObject(this->jsctx, &cls, NULL))) goto error; -+ #else - if (!(this->jsglb = JS_NewObject(this->jsctx, &cls, NULL, NULL))) goto error; -+ #endif - if (!JS_InitStandardClasses(this->jsctx, this->jsglb)) goto error; - - // Define Javascript functions -@@ -147,15 +156,19 @@ - throw bad_alloc(); - } - jsval args[2] = { -- STRING_TO_JSVAL(JS_NewString(this->jsctx, tmpurl, strlen(tmpurl))), -- STRING_TO_JSVAL(JS_NewString(this->jsctx, tmphost, strlen(tmphost))) -+ STRING_TO_JSVAL(JS_NewStringCopyN(this->jsctx, tmpurl, strlen(tmpurl))), -+ STRING_TO_JSVAL(JS_NewStringCopyN(this->jsctx, tmphost, strlen(tmphost))) - }; - - // Find the proxy (call FindProxyForURL()) - jsval rval; - JSBool result = JS_CallFunctionName(this->jsctx, this->jsglb, "FindProxyForURL", 2, args, &rval); - if (!result) return ""; -- string answer = string(JS_GetStringBytes(JS_ValueToString(this->jsctx, rval))); -+ -+ char * tmpanswer = JS_EncodeString(this->jsctx, JS_ValueToString(this->jsctx, rval)); -+ string answer = string(tmpanswer); -+ JS_free(this->jsctx, tmpanswer); -+ - if (answer == "undefined") return ""; - return answer; - } diff --git a/libproxy.changes b/libproxy.changes index c91f98d..403a4f7 100644 --- a/libproxy.changes +++ b/libproxy.changes @@ -1,7 +1,37 @@ +------------------------------------------------------------------- +Mon Jun 6 21:51:45 UTC 2011 - dimstar@opensuse.org + +- Update to version 0.4.7: + + Support/require xulrunner 2.0+ + + Support linking againgst libwebkit-gtk3 (-DWITH_WEBKIT3=ON) + + Port to gsettings for gnome3. (-DWITH_GNOME3=ON[default]) + + Issues closed: + - #149: always test for the right python noarch module path + - #155: Cannot compile with Firefox 4 + - #156: libproxy should build against webkitgtk-3.0 + - #158: Won't compile w/ xulrunner 2.0 final + - #159: libproxy fails with autoconfiguration + "http://proxy.domain.com" + - #131: GSettings-based GNOME plugin + - #150: SUSE sysconfig/proxy config support +- Drop upstream included patches: + + libproxy-sysconfig-support.patch + + libproxy-xul2.patch + + libproxy-backports.patch +- Package gnome3 module if favor_gtk2 is not set (project metadata) +- Add gnome3 module to baselibs.conf and fixup the various + supplements in baselibs.conf (pointed to the pre -config names). +- When building for gnome3 (favor_gtk2 = 0), add BuildRequires: + pkgconfig(gio-2.0) >= 2.26, pkgconfig(gobject-2.0) and + pkgconfig(webkitgtk-3.0) +- When building for gnome2, add BuildRequires: + pkgconfig(gconf-2.0), pkgconfig(gobject-2.0) and replace + libwebkit-devel with pkgconfig(webkit-1.0). + ------------------------------------------------------------------- Tue Apr 19 00:10:03 CEST 2011 - ro@suse.de -- update baselibs.conf +- Update baselibs.conf. ------------------------------------------------------------------- Tue Feb 15 19:16:02 UTC 2011 - dimstar@opensuse.org diff --git a/libproxy.spec b/libproxy.spec index 88eadb0..9c6cc62 100644 --- a/libproxy.spec +++ b/libproxy.spec @@ -42,8 +42,8 @@ Url: http://code.google.com/p/libproxy/ Name: libproxy Group: System/Libraries Summary: Libproxy provides consistent proxy configuration to applications -Version: 0.4.6 -Release: 9 +Version: 0.4.7 +Release: 1 %if 0%{?build_snapshot} %define _sourcename %{_name} %else @@ -53,12 +53,6 @@ Source: http://libproxy.googlecode.com/files/%{_sourcename}.tar.bz2 # Script used for automatic snapshot updates Source98: update-from-svn.sh Source99: baselibs.conf -# PATCH-FEATURE-UPSTREAM libproxy-sysconfig-support.patch bnc#655483 dmacvicar@novell.com -- Add /etc/sysconfig support. Also tracked at http://code.google.com/p/libproxy/issues/detail?id=150 -Patch0: libproxy-sysconfig-support.patch -# PATCH-FEATURE-UPSTREAM libproxy-xul2.patch dimstar@opensuse.org -- Add compatibility to build against xulrunner 2.0 -Patch1: libproxy-xul2.patch -# PATCH-FIX-UPSTREAM libproxy-backports.patch dimstar@opensuse.org -- Backport from upstream source: svn revs: 769,771,776,777,778,780,781,782 -Patch2: libproxy-backports.patch License: GPLv2+ ; LGPLv2.1+ BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: cmake @@ -73,7 +67,15 @@ BuildRequires: gconf2-devel # For directory ownership, but also because we want to rebuild the modules if # the library changed BuildRequires: libproxy1 -BuildRequires: libwebkit-devel +%if 0%{?favor_gtk2} +BuildRequires: pkgconfig(gconf-2.0) +BuildRequires: pkgconfig(gobject-2.0) +BuildRequires: pkgconfig(webkit-1.0) +%else +BuildRequires: pkgconfig(gio-2.0) >= 2.26 +BuildRequires: pkgconfig(gobject-2.0) +BuildRequires: pkgconfig(webkitgtk-3.0) +%endif %if 0%{?suse_version} BuildRequires: mozilla-xulrunner%{xulrunner_ver}-devel %else @@ -212,21 +214,34 @@ libproxy offers the following features: * extremely small core %else +%if 0%{?favor_gtk2} %package -n libproxy1-config-gnome -License: GPLv2+ ; LGPLv2.1+ Summary: Libproxy module for GNOME configuration +%else +%package -n libproxy1-config-gnome3 +Summary: Libproxy module for GNOME3 configuration +%endif +License: GPLv2+ ; LGPLv2.1+ Group: System/Libraries Requires: libproxy1 = %{version} %if 0%{?suse_version} Recommends: libproxy1-pacrunner = %{version} +%if 0%{?favor_gtk2} Supplements: packageand(libproxy1:gconf2) %else +Supplements: packageand(libproxy1:libgio-2_0-0) +%endif +%else Requires: libproxy1-pacrunner = %{version} %endif Provides: libproxy-gnome = %{version} Obsoletes: libproxy-gnome < %{version} +%if 0%{?favor_gtk2} %description -n libproxy1-config-gnome +%else +%description -n libproxy1-config-gnome3 +%endif A module to extend libproxy with capabilities to query GNOME about proxy settings. @@ -299,9 +314,6 @@ about network configuration changes. %prep %setup -q -n %{_sourcename} mkdir build -%patch0 -p0 -%patch1 -p0 -%patch2 -p0 %build cd build @@ -342,6 +354,13 @@ cmake \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_INSTALL_CONFIG_NAME=RelWithDebInfo \ %endif +%if 0%{?favor_gtk2} + -DWITH_WEBKIT3=OFF \ + -DWITH_GNOME3=OFF \ +%else + -DWITH_WEBKIT3=ON \ + -DWITH_GNOME3=ON \ +%endif .. %{__make} VERBOSE=1 @@ -445,10 +464,17 @@ make test %defattr(-, root, root) %{_libdir}/libproxy-%{version}/modules/config_kde4.so +%if 0%{?favor_gtk2} %files -n libproxy1-config-gnome %defattr(-, root, root) %{_libdir}/libproxy-%{version}/modules/config_gnome.so %{_libexecdir}/libproxy-%{version}/pxgconf +%else +%files -n libproxy1-config-gnome3 +%defattr(-, root, root) +%{_libdir}/libproxy-%{version}/modules/config_gnome3.so +%{_libexecdir}/libproxy-%{version}/pxgsettings +%endif %files -n libproxy1-networkmanager %defattr(-, root, root) From a4c1863e091e3b492860439b1e6769bd894cabae79d3bd446728a5e50da5f0be Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Tue, 7 Jun 2011 10:48:35 +0000 Subject: [PATCH 3/3] Accepting request 72865 from home:vuntz:branches:GNOME:Factory I'm a tweaker OBS-URL: https://build.opensuse.org/request/show/72865 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/libproxy?expand=0&rev=63 --- libproxy-plugins.changes | 7 ++++--- libproxy.changes | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/libproxy-plugins.changes b/libproxy-plugins.changes index 403a4f7..5fd0547 100644 --- a/libproxy-plugins.changes +++ b/libproxy-plugins.changes @@ -14,13 +14,14 @@ Mon Jun 6 21:51:45 UTC 2011 - dimstar@opensuse.org "http://proxy.domain.com" - #131: GSettings-based GNOME plugin - #150: SUSE sysconfig/proxy config support -- Drop upstream included patches: +- Drop patches included upstream: + libproxy-sysconfig-support.patch + libproxy-xul2.patch + libproxy-backports.patch -- Package gnome3 module if favor_gtk2 is not set (project metadata) +- Package gnome3 module instead of gnome module, if favor_gtk2 is + not set (in the project metadata). - Add gnome3 module to baselibs.conf and fixup the various - supplements in baselibs.conf (pointed to the pre -config names). + Supplements in baselibs.conf (pointed to the pre -config names). - When building for gnome3 (favor_gtk2 = 0), add BuildRequires: pkgconfig(gio-2.0) >= 2.26, pkgconfig(gobject-2.0) and pkgconfig(webkitgtk-3.0) diff --git a/libproxy.changes b/libproxy.changes index 403a4f7..5fd0547 100644 --- a/libproxy.changes +++ b/libproxy.changes @@ -14,13 +14,14 @@ Mon Jun 6 21:51:45 UTC 2011 - dimstar@opensuse.org "http://proxy.domain.com" - #131: GSettings-based GNOME plugin - #150: SUSE sysconfig/proxy config support -- Drop upstream included patches: +- Drop patches included upstream: + libproxy-sysconfig-support.patch + libproxy-xul2.patch + libproxy-backports.patch -- Package gnome3 module if favor_gtk2 is not set (project metadata) +- Package gnome3 module instead of gnome module, if favor_gtk2 is + not set (in the project metadata). - Add gnome3 module to baselibs.conf and fixup the various - supplements in baselibs.conf (pointed to the pre -config names). + Supplements in baselibs.conf (pointed to the pre -config names). - When building for gnome3 (favor_gtk2 = 0), add BuildRequires: pkgconfig(gio-2.0) >= 2.26, pkgconfig(gobject-2.0) and pkgconfig(webkitgtk-3.0)