diff --git a/libproxy-0.4.17-fix-python-version-check.patch b/libproxy-0.4.17-fix-python-version-check.patch new file mode 100644 index 0000000000000000000000000000000000000000..e4affb0ed0546f382c63de4c0bdbcdf536eba594 --- /dev/null +++ b/libproxy-0.4.17-fix-python-version-check.patch @@ -0,0 +1,61 @@ +From 04eeeabb42436cb58e9bac2f6c31c0fb87905a72 Mon Sep 17 00:00:00 2001 +From: David King +Date: Mon, 21 Jun 2021 17:10:43 +0100 +Subject: [PATCH] python: Support Python 3.10 and above +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +As suggested by Miro HronĨok, change the way that the Python interpreter +version is found. Additionally, update the static list of accepted +Python 3 versions. + +https://bugzilla.redhat.com/show_bug.cgi?id=1898060 +--- + bindings/python/python2/CMakeLists.txt | 2 +- + bindings/python/python3/CMakeLists.txt | 2 +- + cmake/FindPython3Interp.cmake | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/bindings/python/python2/CMakeLists.txt b/bindings/python/python2/CMakeLists.txt +index 00df551..f4d2b91 100644 +--- a/bindings/python/python2/CMakeLists.txt ++++ b/bindings/python/python2/CMakeLists.txt +@@ -6,7 +6,7 @@ if(PYTHON2INTERP_FOUND) + if(NOT PYTHON2_SITEPKG_DIR) + execute_process(COMMAND + ${PYTHON2_EXECUTABLE} +- -c "import sys; print (sys.version[0:3])" ++ -c "import sys; print('{}.{}'.format(*sys.version_info[0:2]))" + OUTPUT_VARIABLE PYTHON2_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) + +diff --git a/bindings/python/python3/CMakeLists.txt b/bindings/python/python3/CMakeLists.txt +index bf87dfc..fc3b24b 100644 +--- a/bindings/python/python3/CMakeLists.txt ++++ b/bindings/python/python3/CMakeLists.txt +@@ -6,7 +6,7 @@ if(PYTHON3INTERP_FOUND) + if(NOT PYTHON3_SITEPKG_DIR) + execute_process(COMMAND + ${PYTHON3_EXECUTABLE} +- -c "import sys; print (sys.version[0:3])" ++ -c "import sys; print('{}.{}'.format(*sys.version_info[0:2]))" + OUTPUT_VARIABLE PYTHON3_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) + +diff --git a/cmake/FindPython3Interp.cmake b/cmake/FindPython3Interp.cmake +index 74398b2..5b25e5a 100644 +--- a/cmake/FindPython3Interp.cmake ++++ b/cmake/FindPython3Interp.cmake +@@ -39,7 +39,7 @@ + + unset(_Python3_NAMES) + +-set(_Python3_VERSIONS 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0) ++set(_Python3_VERSIONS 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0) + + if(Python3Interp_FIND_VERSION) + if(Python3Interp_FIND_VERSION_COUNT GREATER 1) +-- +2.31.1 + diff --git a/libproxy-0.4.17.tar.xz b/libproxy-0.4.17.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..1873f516613d285f191d273eaeed5c2c9e4e3a65 Binary files /dev/null and b/libproxy-0.4.17.tar.xz differ diff --git a/libproxy.spec b/libproxy.spec new file mode 100644 index 0000000000000000000000000000000000000000..c688db9dc7f5e5774b5d356768ab10fed823093e --- /dev/null +++ b/libproxy.spec @@ -0,0 +1,198 @@ +%define anolis_release 1 +%{!?_with_bootstrap: %global bootstrap 0} + +Name: libproxy +Version: 0.4.17 +Release: %{anolis_release}%{?dist} +Summary: A library handling all the details of proxy configuration + +License: LGPLv2+ +URL: https://libproxy.github.io/libproxy/ +Source0: https://github.com/libproxy/%{name}/releases/download/%{name}-%{version}.tar.xz +# Taken from the Debian package. +Source1: proxy.1 +# Fix the problem that matches python 3.10 but matches python 3.1 +Patch0: libproxy-0.4.17-fix-python-version-check.patch + +BuildRequires: cmake >= 2.6.0 +BuildRequires: gcc-c++ + +%if ! 0%{?bootstrap} +# gnome +BuildRequires: pkgconfig(gio-2.0) >= 2.26 +# NetworkManager +BuildRequires: pkgconfig(libnm) +# pacrunner (and NetworkManager) +BuildRequires: pkgconfig(dbus-1) +# webkit (gtk3) +BuildRequires: pkgconfig(javascriptcoregtk-4.0) +# Python +BuildRequires: python3-devel +%else +# Obsoletes of disabled subpackages. +Provides: %{name}-mozjs = %{version}-%{release} +Obsoletes: %{name}-mozjs < %{version}-%{release} +Provides: %{name}-webkitgtk4 = %{version}-%{release} +Obsoletes: %{name}-webkitgtk4 < %{version}-%{release} +%endif + + +%description +libproxy offers the following features: + + * extremely small core footprint (< 35K) + * no external dependencies within libproxy core + (libproxy plugins may have dependencies) + * only 3 functions in the stable external API + * dynamic adjustment to changing network topology + * a standard way of dealing with proxy settings across all scenarios + * a sublime sense of joy and accomplishment + + +%package bin +Summary: Binary to test %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description bin +The %{name}-bin package contains the proxy binary for %{name} + +%if ! 0%{?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. + + +%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 webkitgtk4 +Summary: Plugin for %{name} and webkitgtk3 +Requires: %{name}%{?_isa} = %{version}-%{release} +Provides: %{name}-pac = %{version}-%{release} +Obsoletes: %{name}-mozjs <= %{version}-%{release} + +%description webkitgtk4 +The %{name}-webkitgtk4 package contains the %{name} plugin for +webkitgtk3. + +%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 +PacRunner. +%endif + + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%prep +%autosetup -p1 + + +%build +export CXXFLAGS="-std=c++14 $RPM_OPT_FLAGS" +%{cmake} \ + -DMODULE_INSTALL_DIR=%{_libdir}/%{name}/%{version}/modules \ + -DBIPR=OFF \ + -DWITH_KDE=OFF \ + -DWITH_MOZJS=OFF \ + -DWITH_PERL=OFF \ +%if ! 0%{?bootstrap} + -DWITH_GNOME3=ON \ + -DWITH_PYTHON2=OFF \ + -DWITH_PYTHON3=ON \ + -DWITH_WEBKIT3=ON \ +%else + -DWITH_PYTHON2=OFF \ + -DWITH_PYTHON3=OFF \ +%endif + . +%cmake_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 + + +%check +%ctest + +%ldconfig_scriptlets + + +%files +%doc AUTHORS README +%license COPYING +%{_libdir}/*.so.* +%dir %{_libdir}/%{name} +%dir %{_libdir}/%{name}/%{version} +%dir %{_libdir}/%{name}/%{version}/modules + +%files bin +%{_bindir}/proxy +%{_mandir}/man1/proxy.1* + +%if ! 0%{?bootstrap} +%files -n python3-%{name} +%{python3_sitelib}/__pycache__/* +%{python3_sitelib}/%{name}.* + +%files gnome +%{_libdir}/%{name}/%{version}/modules/config_gnome3.so +%{_libexecdir}/pxgsettings + + +%files networkmanager +%{_libdir}/%{name}/%{version}/modules/network_networkmanager.so + +%files webkitgtk4 +%{_libdir}/%{name}/%{version}/modules/pacrunner_webkit.so + +%files pacrunner +%{_libdir}/%{name}/%{version}/modules/config_pacrunner.so +%endif + +%files devel +%{_includedir}/proxy.h +%{_libdir}/*.so +%{_libdir}/pkgconfig/libproxy-1.0.pc +%{_datadir}/cmake/Modules/Findlibproxy.cmake + + +%changelog +* Thu Apr 07 2022 mgb01105731 - 0.4.17-1 +- Init from upstream version 0.4.17 + diff --git a/proxy.1 b/proxy.1 new file mode 100644 index 0000000000000000000000000000000000000000..a8c2d83079e24470e66c4f801f1d877de7939639 --- /dev/null +++ b/proxy.1 @@ -0,0 +1,23 @@ +.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 .