Update to 0.5.0

Migrate to SPDX license field. Enable documentation using gi-docgen. Use
curl and duktape for PAC handling. Have the main package
provide/obsolete nearly all the proxy backend subpackages, and note that
the provides should be removed in F41. Include upstream patch to move
libpxbackend.so under pkglibdir.
This commit is contained in:
David King 2023-05-17 08:37:58 +01:00
parent c8c0c04059
commit f6df95ae13
4 changed files with 603 additions and 171 deletions

View File

@ -0,0 +1,537 @@
From f6aab7bc2a821117b2079f7504ab444dd13f4708 Mon Sep 17 00:00:00 2001
From: Jan-Michael Brummer <jan.brummer@tabos.org>
Date: Tue, 16 May 2023 15:10:53 +0200
Subject: [PATCH 1/7] Guard PxManager test with pacrunner-duktape option (#215)
Fixes: https://github.com/libproxy/libproxy/issues/213
---
tests/meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/meson.build b/tests/meson.build
index 4ae8e7d..c8fe11f 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -17,7 +17,7 @@ if get_option('tests')
env: envs
)
- if soup_dep.found()
+ if soup_dep.found() and get_option('pacrunner-duktape')
px_manager_test = executable('test-px-manager',
['px-manager-test.c', 'px-manager-helper.c'],
include_directories: px_backend_inc,
--
2.40.1
From 917e8be8756ae8f7bf502c23499fd6a605e9871e Mon Sep 17 00:00:00 2001
From: Thomas Klausner <wiz@gatalith.at>
Date: Wed, 17 May 2023 21:05:44 +0200
Subject: [PATCH 2/7] Fix build on NetBSD (#220)
Closes #219
---
src/backend/plugins/pacrunner-duktape/pacrunner-duktape.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/backend/plugins/pacrunner-duktape/pacrunner-duktape.c b/src/backend/plugins/pacrunner-duktape/pacrunner-duktape.c
index 3845fca..40137ca 100644
--- a/src/backend/plugins/pacrunner-duktape/pacrunner-duktape.c
+++ b/src/backend/plugins/pacrunner-duktape/pacrunner-duktape.c
@@ -26,6 +26,7 @@
#include <ws2tcpip.h>
#else
#include <netdb.h>
+#include <netinet/in.h>
#endif
#include "pacrunner-duktape.h"
--
2.40.1
From 383681b0111e29bafe513cbbf4c6fe6e7129714f Mon Sep 17 00:00:00 2001
From: David King <amigadave@amigadave.com>
Date: Mon, 22 May 2023 06:59:06 +0100
Subject: [PATCH 3/7] Install libpxbackend into pkglibdir (#223)
Fixes: https://github.com/libproxy/libproxy/issues/222
---
meson.build | 2 +-
src/backend/meson.build | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/meson.build b/meson.build
index f209f60..b6bda0d 100644
--- a/meson.build
+++ b/meson.build
@@ -12,7 +12,7 @@ root_dir = include_directories('.')
px_prefix = get_option('prefix')
datadir = get_option('datadir')
-px_libdir = join_paths(px_prefix, get_option('libdir'))
+pkglibdir = join_paths(px_prefix, get_option('libdir'), 'libproxy')
girdir = get_option('datadir') / 'gir-1.0'
typelibdir = get_option('libdir') / 'girepository-1.0'
vapidir = get_option('datadir') / 'vala' / 'vapi'
diff --git a/src/backend/meson.build b/src/backend/meson.build
index c8be5da..ce5a242 100644
--- a/src/backend/meson.build
+++ b/src/backend/meson.build
@@ -37,7 +37,9 @@ px_backend = shared_library(
px_backend_sources,
dependencies: px_backend_deps,
c_args: px_backend_c_args,
- install: true
+ install: true,
+ install_dir: pkglibdir,
+ install_rpath: pkglibdir
)
px_backend_dep = declare_dependency(
--
2.40.1
From d32f1e65bf54d5d9cae9e9f57d04ce34005b90f0 Mon Sep 17 00:00:00 2001
From: Thomas Klausner <wiz@gatalith.at>
Date: Mon, 22 May 2023 08:56:50 +0200
Subject: [PATCH 4/7] Move glib2 inclusion out of c++ protection (#227)
Fixes usage of header file from C++
Addresses one part of #226.
---
src/libproxy/proxy.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/libproxy/proxy.h b/src/libproxy/proxy.h
index cf4fc34..1289f41 100644
--- a/src/libproxy/proxy.h
+++ b/src/libproxy/proxy.h
@@ -22,12 +22,12 @@
#pragma once
+#include <gio/gio.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <gio/gio.h>
-
/**
* SECTION:px-proxy
* @short_description: A convient helper for using proxy servers
--
2.40.1
From 14430634e1bb003c5f6e7b83caca60c08e5579bd Mon Sep 17 00:00:00 2001
From: Jan-Michael Brummer <jan.brummer@tabos.org>
Date: Mon, 22 May 2023 11:01:00 +0200
Subject: [PATCH 5/7] Replace libsoup with glib socket service functions (#228)
---
meson.build | 1 -
tests/config-kde-test.c | 4 +-
tests/data/px-manager-pac | 6 +-
tests/data/sample-kde-proxy-disabled | 2 +-
tests/data/sample-kde-proxy-pac | 2 +-
tests/meson.build | 4 +-
tests/px-manager-test.c | 143 ++++++++++++++++++++++-----
7 files changed, 127 insertions(+), 35 deletions(-)
diff --git a/meson.build b/meson.build
index b6bda0d..49a5fb4 100644
--- a/meson.build
+++ b/meson.build
@@ -106,7 +106,6 @@ endif
glib_dep = dependency('glib-2.0', version: '>= 2.71.3')
gio_dep = dependency('gio-2.0', version: '>= 2.71.3')
-soup_dep = dependency('libsoup-3.0', required: get_option('tests'))
curl_dep = dependency('libcurl', required: get_option('curl'))
ws2_32_dep = cc.find_library('ws2_32', required : with_platform_windows)
gsettings_desktop_schema = dependency('gsettings-desktop-schemas', required: get_option('config-gnome'))
diff --git a/tests/config-kde-test.c b/tests/config-kde-test.c
index 5129384..07f83f9 100644
--- a/tests/config-kde-test.c
+++ b/tests/config-kde-test.c
@@ -168,9 +168,9 @@ test_config_kde_pac (void)
config = px_manager_get_configuration (manager, uri, &error);
if (test.success)
- g_assert_cmpstr (config[0], ==, "pac+http://127.0.0.1/test.pac");
+ g_assert_cmpstr (config[0], ==, "pac+http://127.0.0.1/px-manager-sample.pac");
else
- g_assert_cmpstr (config[0], !=, "pac+http://127.0.0.1/test.pac");
+ g_assert_cmpstr (config[0], !=, "pac+http://127.0.0.1/px-manager-sample.pac");
g_clear_object (&manager);
}
diff --git a/tests/data/px-manager-pac b/tests/data/px-manager-pac
index 2ff4000..cb74134 100644
--- a/tests/data/px-manager-pac
+++ b/tests/data/px-manager-pac
@@ -1,5 +1,5 @@
PROXY_ENABLED="yes"
-HTTP_PROXY="pac+http://127.0.0.1:1983/test.pac"
-HTTPS_PROXY="pac+http://127.0.0.1:1983/test.pac"
-FTP_PROXY="pac+http://127.0.0.1:1983/test.pac"
+HTTP_PROXY="pac+http://127.0.0.1:1983/px-manager-sample.pac"
+HTTPS_PROXY="pac+http://127.0.0.1:1983/px-manager-sample.pac"
+FTP_PROXY="pac+http://127.0.0.1:1983/px-manager-sample.pac"
NO_PROXY="localhost, 127.0.0.1"
diff --git a/tests/data/sample-kde-proxy-disabled b/tests/data/sample-kde-proxy-disabled
index 9598abd..1c8aa46 100644
--- a/tests/data/sample-kde-proxy-disabled
+++ b/tests/data/sample-kde-proxy-disabled
@@ -2,7 +2,7 @@ ProxyUrlDisplayFlags=15
[Proxy Settings]
NoProxyFor=localhost,127.0.0.1
-Proxy Config Script=http://127.0.0.1/test.pac
+Proxy Config Script=http://127.0.0.1/px-manager-sample.pac
ProxyType=0
ReversedException=false
ftpProxy=ftp://127.0.0.1 8080
diff --git a/tests/data/sample-kde-proxy-pac b/tests/data/sample-kde-proxy-pac
index c0db824..c051879 100644
--- a/tests/data/sample-kde-proxy-pac
+++ b/tests/data/sample-kde-proxy-pac
@@ -2,7 +2,7 @@ ProxyUrlDisplayFlags=15
[Proxy Settings]
NoProxyFor=localhost,127.0.0.1
-Proxy Config Script=http://127.0.0.1/test.pac
+Proxy Config Script=http://127.0.0.1/px-manager-sample.pac
ProxyType=2
ReversedException=false
ftpProxy=ftp://127.0.0.1 8080
diff --git a/tests/meson.build b/tests/meson.build
index c8fe11f..f955f15 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -17,11 +17,11 @@ if get_option('tests')
env: envs
)
- if soup_dep.found() and get_option('pacrunner-duktape')
+ if get_option('pacrunner-duktape')
px_manager_test = executable('test-px-manager',
['px-manager-test.c', 'px-manager-helper.c'],
include_directories: px_backend_inc,
- dependencies: [soup_dep, glib_dep, px_backend_dep],
+ dependencies: [glib_dep, px_backend_dep],
)
test('PX Manager test',
px_manager_test,
diff --git a/tests/px-manager-test.c b/tests/px-manager-test.c
index bfd3112..311e632 100644
--- a/tests/px-manager-test.c
+++ b/tests/px-manager-test.c
@@ -22,7 +22,7 @@
#include "px-manager.h"
#include "px-manager-helper.h"
-#include <libsoup/soup.h>
+#include <gio/gio.h>
#define SERVER_PORT 1983
@@ -32,27 +32,120 @@ typedef struct {
} Fixture;
static void
-server_callback (SoupServer *server,
- SoupServerMessage *msg,
- const char *path,
- GHashTable *query,
- gpointer data)
+send_error (GOutputStream *out,
+ int error_code,
+ const char *reason)
{
- g_print ("%s: path %s\n", __FUNCTION__, path);
- soup_server_message_set_status (SOUP_SERVER_MESSAGE (msg), SOUP_STATUS_OK, NULL);
-
- if (g_strcmp0 (path, "/test.pac") == 0) {
- g_autofree char *pac = g_test_build_filename (G_TEST_DIST, "data", "px-manager-sample.pac", NULL);
- g_autofree char *pac_data = NULL;
- g_autoptr (GError) error = NULL;
- gsize len;
-
- if (!g_file_get_contents (pac, &pac_data, &len, &error)) {
- g_warning ("Could not read pac file: %s", error ? error->message : "");
- return;
+ char *res;
+
+ res = g_strdup_printf ("HTTP/1.0 %d %s\r\n\r\n"
+ "<html><head><title>%d %s</title></head>"
+ "<body>%s</body></html>",
+ error_code, reason,
+ error_code, reason,
+ reason);
+ g_output_stream_write_all (out, res, strlen (res), NULL, NULL, NULL);
+ g_free (res);
+}
+
+static gboolean
+on_incoming (GSocketService *service,
+ GSocketConnection *connection,
+ GObject *source_object)
+{
+ GOutputStream *out = NULL;
+ GInputStream *in = NULL;
+ g_autoptr (GDataInputStream) data = NULL;
+ g_autoptr (GFile) f = NULL;
+ g_autoptr (GError) error = NULL;
+ g_autoptr (GFileInputStream) file_in = NULL;
+ g_autoptr (GString) s = NULL;
+ g_autoptr (GFileInfo) info = NULL;
+ g_autofree char *line = NULL;
+ g_autofree char *unescaped = NULL;
+ g_autofree char *path = NULL;
+ char *escaped;
+ char *version;
+ char *tmp;
+
+ in = g_io_stream_get_input_stream (G_IO_STREAM (connection));
+ out = g_io_stream_get_output_stream (G_IO_STREAM (connection));
+
+ data = g_data_input_stream_new (in);
+ /* Be tolerant of input */
+ g_data_input_stream_set_newline_type (data, G_DATA_STREAM_NEWLINE_TYPE_ANY);
+
+ line = g_data_input_stream_read_line (data, NULL, NULL, NULL);
+
+ if (line == NULL) {
+ send_error (out, 400, "Invalid request");
+ goto out;
+ }
+
+ if (!g_str_has_prefix (line, "GET ")) {
+ send_error (out, 501, "Only GET implemented");
+ goto out;
+ }
+
+ escaped = line + 4; /* Skip "GET " */
+
+ version = NULL;
+ tmp = strchr (escaped, ' ');
+ if (tmp == NULL) {
+ send_error (out, 400, "Bad Request");
+ goto out;
+ }
+ *tmp = 0;
+
+ version = tmp + 1;
+ if (!g_str_has_prefix (version, "HTTP/1.")) {
+ send_error(out, 505, "HTTP Version Not Supported");
+ goto out;
+ }
+
+ unescaped = g_uri_unescape_string (escaped, NULL);
+ path = g_test_build_filename (G_TEST_DIST, "data", unescaped, NULL);
+ f = g_file_new_for_path (path);
+
+ error = NULL;
+ file_in = g_file_read (f, NULL, &error);
+ if (file_in == NULL) {
+ send_error (out, 404, error->message);
+ goto out;
+ }
+
+ s = g_string_new ("HTTP/1.0 200 OK\r\n");
+
+ info = g_file_input_stream_query_info (file_in,
+ G_FILE_ATTRIBUTE_STANDARD_SIZE ","
+ G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+ NULL, NULL);
+ if (info) {
+ const char *content_type;
+ char *mime_type;
+
+ if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_SIZE))
+ g_string_append_printf (s, "Content-Length: %"G_GINT64_FORMAT"\r\n", g_file_info_get_size (info));
+
+ if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE)) {
+ content_type = g_file_info_get_content_type (info);
+ if (content_type) {
+ mime_type = g_content_type_get_mime_type (content_type);
+ if (mime_type) {
+ g_string_append_printf (s, "Content-Type: %s\r\n", mime_type);
+ g_free (mime_type);
+ }
+ }
}
- soup_server_message_set_response (msg, "text/plain", SOUP_MEMORY_COPY, pac_data, len);
}
+ g_string_append (s, "\r\n");
+
+ if (g_output_stream_write_all (out, s->str, s->len, NULL, NULL, NULL)) {
+ g_output_stream_splice (out, G_INPUT_STREAM (file_in), 0, NULL, NULL);
+ }
+
+out:
+ return TRUE;
}
static void
@@ -82,7 +175,7 @@ download_pac (gpointer data)
Fixture *self = data;
GBytes *pac;
- pac = px_manager_pac_download (self->manager, "http://127.0.0.1:1983/test.pac");
+ pac = px_manager_pac_download (self->manager, "http://127.0.0.1:1983/px-manager-sample.pac");
g_assert_nonnull (pac);
g_main_loop_quit (self->loop);
@@ -286,18 +379,18 @@ int
main (int argc,
char **argv)
{
- SoupServer *server = NULL;
+ g_autoptr (GSocketService) service = NULL;
g_autoptr (GError) error = NULL;
g_test_init (&argc, &argv, NULL);
- server = soup_server_new (NULL, NULL);
- if (!soup_server_listen_local (server, SERVER_PORT, SOUP_SERVER_LISTEN_IPV4_ONLY, &error)) {
- g_warning ("Could not create local server: %s", error ? error->message : "");
+ service = g_socket_service_new ();
+ if (!g_socket_listener_add_inet_port (G_SOCKET_LISTENER (service), SERVER_PORT, NULL, &error)) {
+ g_error ("Could not create server socket: %s", error ? error->message : "?");
return -1;
}
- soup_server_add_handler (server, NULL, server_callback, NULL, NULL);
+ g_signal_connect (service, "incoming", G_CALLBACK (on_incoming), NULL);
g_test_add ("/pac/download", Fixture, "px-manager-direct", fixture_setup, test_pac_download, fixture_teardown);
g_test_add ("/pac/get_proxies_direct", Fixture, "px-manager-direct", fixture_setup, test_get_proxies_direct, fixture_teardown);
--
2.40.1
From 59b5306bba8419e118ff6eaab45ea6f735616db9 Mon Sep 17 00:00:00 2001
From: Jan-Michael Brummer <jan.brummer@tabos.org>
Date: Mon, 22 May 2023 14:06:46 +0200
Subject: [PATCH 6/7] Enforce online state for tests (#229)
Fixes: https://github.com/libproxy/libproxy/issues/224
---
src/backend/px-manager.c | 22 +++++++++++++++++++---
tests/px-manager-helper.c | 1 +
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/src/backend/px-manager.c b/src/backend/px-manager.c
index 67a0b0f..3231aae 100644
--- a/src/backend/px-manager.c
+++ b/src/backend/px-manager.c
@@ -66,6 +66,7 @@ enum {
PROP_0,
PROP_CONFIG_PLUGIN,
PROP_CONFIG_OPTION,
+ PROP_FORCE_ONLINE,
LAST_PROP
};
@@ -89,6 +90,7 @@ struct _PxManager {
char *config_plugin;
char *config_option;
+ gboolean force_online;
gboolean online;
gboolean wpad;
GBytes *pac_data;
@@ -208,9 +210,14 @@ px_manager_constructed (GObject *object)
self->pac_data = NULL;
- self->network_monitor = g_network_monitor_get_default ();
- g_signal_connect_object (G_OBJECT (self->network_monitor), "network-changed", G_CALLBACK (px_manager_on_network_changed), self, 0);
- px_manager_on_network_changed (self->network_monitor, g_network_monitor_get_network_available (self->network_monitor), self);
+ if (!self->force_online) {
+ self->network_monitor = g_network_monitor_get_default ();
+ g_signal_connect_object (G_OBJECT (self->network_monitor), "network-changed", G_CALLBACK (px_manager_on_network_changed), self, 0);
+ px_manager_on_network_changed (self->network_monitor, g_network_monitor_get_network_available (self->network_monitor), self);
+ } else {
+ px_manager_on_network_changed (NULL, TRUE, self);
+ }
+
g_debug ("%s: Up and running", __FUNCTION__);
}
@@ -245,6 +252,9 @@ px_manager_set_property (GObject *object,
case PROP_CONFIG_OPTION:
self->config_option = g_strdup (g_value_get_string (value));
break;
+ case PROP_FORCE_ONLINE:
+ self->force_online = g_value_get_boolean (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
@@ -287,6 +297,12 @@ px_manager_class_init (PxManagerClass *klass)
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+ obj_properties[PROP_FORCE_ONLINE] = g_param_spec_boolean ("force-online",
+ NULL,
+ NULL,
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+
g_object_class_install_properties (object_class, LAST_PROP, obj_properties);
}
diff --git a/tests/px-manager-helper.c b/tests/px-manager-helper.c
index e3129a2..10b43a2 100644
--- a/tests/px-manager-helper.c
+++ b/tests/px-manager-helper.c
@@ -27,5 +27,6 @@ px_test_manager_new (const char *config_plugin, const char *config_option)
{
return px_manager_new_with_options ("config-plugin", config_plugin,
"config-option", config_option,
+ "force-online", TRUE,
NULL);
}
--
2.40.1
From 4a4f54ca754689fb5a47dc7361e2530344ce82f5 Mon Sep 17 00:00:00 2001
From: Jan-Michael Brummer <jan.brummer@tabos.org>
Date: Mon, 22 May 2023 17:24:02 +0200
Subject: [PATCH 7/7] Use glib-object header instead of gio (#230)
3rd party libraries (like QT) which defines same variable names will
clash if we use gio/gio.h in public proxy.h. Switch to minimal required
to fix compilation issues with QT5/6.
Fixes: https://github.com/libproxy/libproxy/issues/226
---
src/libproxy/proxy.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libproxy/proxy.h b/src/libproxy/proxy.h
index 1289f41..d24dc0f 100644
--- a/src/libproxy/proxy.h
+++ b/src/libproxy/proxy.h
@@ -22,7 +22,7 @@
#pragma once
-#include <gio/gio.h>
+#include <glib-object.h>
#ifdef __cplusplus
extern "C" {
--
2.40.1

View File

@ -1,32 +1,46 @@
# When we are bootstrapping, we drop some dependencies.
%bcond_with bootstrap
%global _privatelibs libpxbackend-1.0[.]so.*
%global __provides_exclude ^(%{_privatelibs})$
%global __requires_exclude ^(%{_privatelibs})$
Name: libproxy
Version: 0.4.18
Release: 6%{?dist}
Version: 0.5.0
Release: 1%{?dist}
Summary: A library handling all the details of proxy configuration
License: LGPLv2+
License: LGPL-2.1-or-later
URL: https://libproxy.github.io/libproxy/
Source0: https://github.com/libproxy/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz
# Taken from the Debian package.
Source1: proxy.1
Source0: https://github.com/libproxy/%{name}/archive/refs/tags/%{name}-%{version}.tar.gz
# https://github.com/libproxy/libproxy/issues/222 and others.
Patch0: libproxy-0.5.0-post-release-fixes.patch
BuildRequires: cmake >= 2.6.0
BuildRequires: gcc-c++
BuildRequires: gcc
BuildRequires: meson
BuildRequires: /usr/bin/gi-docgen
BuildRequires: /usr/bin/vapigen
%if %{without bootstrap}
# gnome
BuildRequires: pkgconfig(gio-2.0) >= 2.26
# NetworkManager
BuildRequires: pkgconfig(libnm)
# ConnMan's pacrunner (and NetworkManager)
BuildRequires: pkgconfig(dbus-1)
# for libproxy's duktape pacrunner
BuildRequires: pkgconfig(duktape)
# Python
BuildRequires: pkgconfig(gio-2.0) >= 2.71.3
BuildRequires: pkgconfig(gobject-introspection-1.0)
BuildRequires: pkgconfig(libcurl)
BuildRequires: python3-devel
%endif
# For config-gnome
BuildRequires: pkgconfig(gsettings-desktop-schemas)
# Folded into main package in 0.5.0. Remove in F41.
Provides: python3-%{name} = %{version}-%{release}
Provides: %{name}-pac = %{version}-%{release}
# Obsoletes of subpackages prior to 0.5.0 rewrite. Remove in F41.
Provides: %{name}-gnome = %{version}-%{release}
Obsoletes: %{name}-gnome < %{version}-%{release}
Provides: %{name}-kde = %{version}-%{release}
Obsoletes: %{name}-kde < %{version}-%{release}
Provides: %{name}-mozjs = %{version}-%{release}
Obsoletes: %{name}-mozjs < %{version}-%{release}
Provides: %{name}-pacrunner = %{version}-%{release}
Obsoletes: %{name}-pacrunner < %{version}-%{release}
Provides: %{name}-webkitgtk4 = %{version}-%{release}
Obsoletes: %{name}-webkitgtk4 < %{version}-%{release}
%description
@ -48,64 +62,6 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%description bin
The %{name}-bin package contains the proxy binary for %{name}
%if %{without bootstrap}
%package -n python3-%{name}
Summary: Binding for %{name} and python3
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%{?python_provide:%python_provide python3-%{name}}
%description -n python3-%{name}
The python3 binding for %{name}
%package gnome
Summary: Plugin for %{name} and gnome
Requires: %{name}%{?_isa} = %{version}-%{release}
%description gnome
The %{name}-gnome package contains the %{name} plugin for gnome.
%if 0%{?fedora}
%package kde
Summary: Plugin for %{name} and kde
Requires: %{name}%{?_isa} = %{version}-%{release}
Recommends: /usr/bin/kreadconfig5
%description kde
The %{name}-kde package contains the %{name} plugin for kde.
%endif
%package networkmanager
Summary: Plugin for %{name} and networkmanager
Requires: %{name}%{?_isa} = %{version}-%{release}
%description networkmanager
The %{name}-networkmanager package contains the %{name} plugin
for networkmanager.
%package duktape
Summary: Plugin for %{name} and duktape
Requires: %{name}%{?_isa} = %{version}-%{release}
Provides: %{name}-pac = %{version}-%{release}
Obsoletes: %{name}-mozjs <= %{version}-%{release}
Obsoletes: %{name}-webkitgtk4 <= %{version}-%{release}
%description duktape
The %{name}-duktape package contains the %{name} plugin for
duktape.
%package pacrunner
Summary: Plugin for %{name} and PacRunner
Requires: %{name}%{?_isa} = %{version}-%{release}
Provides: %{name}-pac = %{version}-%{release}
Requires: pacrunner
%description pacrunner
The %{name}-pacrunner package contains the %{name} plugin for
ConnMan's PacRunner.
%endif
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
@ -115,99 +71,61 @@ The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%prep
%autosetup -p1
# Unusual tarball directory name should be fixed in the next release.
%autosetup -p1 -n libproxy-%{name}-%{version}
%build
export CXXFLAGS="-std=c++14 $RPM_OPT_FLAGS"
%cmake \
-DMODULE_INSTALL_DIR=%{_libdir}/%{name}/%{version}/modules \
-DBIPR=OFF \
-DWITH_GNOME=OFF \
-DWITH_MOZJS=OFF \
-DWITH_PERL=OFF \
-DWITH_PYTHON2=OFF \
-DWITH_WEBKIT=OFF \
-DWITH_WEBKIT3=OFF \
%if %{without bootstrap}
-DWITH_DUKTAPE=ON \
-DWITH_GNOME3=ON \
-DWITH_PYTHON3=ON \
%if 0%{?fedora}
-DWITH_KDE=ON \
%else
-DWITH_KDE=OFF \
%endif
%else
-DWITH_DUKTAPE=OFF \
-DWITH_KDE=OFF \
-DWITH_GNOME3=OFF \
-DWITH_PYTHON3=OFF \
%endif
%{nil}
%cmake_build
%meson \
-Dconfig-gnome=true \
-Dconfig-kde=true \
-Dconfig-osx=false \
-Dconfig-windows=false \
-Dintrospection=true \
-Dtests=true \
-Dvapi=true
%meson_build
%install
%cmake_install
#In case all modules are disabled
mkdir -p %{buildroot}%{_libdir}/%{name}/%{version}/modules
# Man page.
install -Dpm 0644 %{SOURCE1} %{buildroot}/%{_mandir}/man1/proxy.1
%meson_install
%check
%ctest
%meson_test
%ldconfig_scriptlets
%files
%doc AUTHORS README
%doc CHANGELOG.md README.md
%license COPYING
%{_libdir}/*.so.*
%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/%{version}
%dir %{_libdir}/%{name}/%{version}/modules
%dir %{_libdir}/girepository-1.0
%{_libdir}/girepository-1.0/Libproxy-1.0.typelib
%{_libdir}/libproxy.so.*
%dir %{_libdir}/libproxy
%{_libdir}/libproxy/libpxbackend-1.0.so
%files bin
%{_bindir}/proxy
%{_mandir}/man1/proxy.1*
%if %{without bootstrap}
%files -n python3-%{name}
%{python3_sitelib}/__pycache__/*
%{python3_sitelib}/%{name}.*
%files duktape
%{_libdir}/%{name}/%{version}/modules/pacrunner_duktape.so
%files gnome
%{_libdir}/%{name}/%{version}/modules/config_gnome3.so
%{_libexecdir}/pxgsettings
%if 0%{?fedora}
%files kde
%{_libdir}/%{name}/%{version}/modules/config_kde.so
%endif
%files networkmanager
%{_libdir}/%{name}/%{version}/modules/network_networkmanager.so
%files pacrunner
%{_libdir}/%{name}/%{version}/modules/config_pacrunner.so
%endif
%{_mandir}/man8/proxy.8*
%files devel
%{_includedir}/proxy.h
%{_libdir}/*.so
%{_docdir}/libproxy-1.0/
%{_includedir}/libproxy/
%{_libdir}/libproxy.so
%{_libdir}/pkgconfig/libproxy-1.0.pc
%{_datadir}/cmake/Modules/Findlibproxy.cmake
%dir %{_datadir}/gir-1.0
%{_datadir}/gir-1.0/Libproxy-1.0.gir
%dir %{_datadir}/vala/vapi/
%{_datadir}/vala/vapi/libproxy-1.0.deps
%{_datadir}/vala/vapi/libproxy-1.0.vapi
%changelog
* Tue May 16 2023 David King <amigadave@amigadave.com> - 0.5.0-1
- Update to 0.5.0
* Wed Feb 08 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 0.4.18-6
- Soften KDE dependency

23
proxy.1
View File

@ -1,23 +0,0 @@
.TH PROXY "1" "September 2013" "libproxy" "User Commands"
.SH NAME
proxy \- Display the proxy server that should be used to reach a given a network resource
.SH SYNOPSIS
proxy
.SH DESCRIPTION
Display the proxy server that should be used to reach a given a network resource.
.PP
libproxy is a library that provides automatic proxy configuration management
using different backends.
.SH EXAMPLE
.B echo http://www.example.com/ | proxy
http://webcache:3128 direct://
.SH AUTHOR
This manual page was written by
.MT bigon@debian.org
Laurent Bigonville
.ME ,
for the Debian GNU/Linux system (but may be used by others).
.SH SEE ALSO
.UR http://code.google.com/p/libproxy/
libproxy
.UE .

View File

@ -1 +1 @@
SHA512 (libproxy-0.4.18.tar.xz) = 0c6b138bc8da9abcf21e091b876527cfff0703800995363e5a46c29a2a9caa2946c45b299abed6129b314461123949dae387456a0cddcbb0b29a84b9b55f499c
SHA512 (libproxy-0.5.0.tar.gz) = 699d09d747c3e56247b1d0a8dee0cd7c122199cc4296aa61753a4e52b4346ad5d98d608f953d28a5779e7d49f64be639e22c696ac82d48bbdaa7b743501b18e6