From cf8573cae29cae52ecd6cc7ff2a21faa4b1bc88c Mon Sep 17 00:00:00 2001 From: Tomas Korbar Date: Thu, 7 Dec 2023 13:44:50 +0100 Subject: [PATCH] Add linking of gssapi to support Kerberos authentication Resolves: rhbz#2245095 --- libserf-1.3.10-gssapi.patch | 60 +++++++++++++++++++++++++++++++++++++ libserf.spec | 10 +++++-- 2 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 libserf-1.3.10-gssapi.patch diff --git a/libserf-1.3.10-gssapi.patch b/libserf-1.3.10-gssapi.patch new file mode 100644 index 0000000..0abc92e --- /dev/null +++ b/libserf-1.3.10-gssapi.patch @@ -0,0 +1,60 @@ +commit 821fc34e224a4e82563f0561be2e60fd1d4ec92b +Author: Tomas Korbar +Date: Tue Nov 14 12:42:45 2023 +0100 + + Add gssapi linking + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3f10eae..e435e29 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -51,7 +51,7 @@ option(DEBUG "Enable debugging info and strict compile warnings" OFF) + option(SKIP_SHARED "Disable building shared Serf libraries" OFF) + option(SKIP_STATIC "Disable building static Serf libraries" OFF) + option(LIBDIR "Install directory for architecture-dependent libraries" "") +-option(GSSAPI "Path to GSSAPI's install area" "") ++option(GSSAPI "Use pkg-config to link with GSSAPI" OFF) + option(BROTLI "Path to Brotli's install area" "") + option(DISABLE_LOGGING "Disable the logging framework at compile time" OFF) + option(SKIP_TESTS "Disable building the unit tests and utilities" OFF) +@@ -156,10 +156,14 @@ if(SERF_WINDOWS) + ) + endif(SERF_WINDOWS) + +- + # Process build options for dependency search + if(GSSAPI) +- message(WARNING "option GSSAPI is not implemented") ++ find_package(PkgConfig REQUIRED) ++ pkg_check_modules(GSSAPI krb5-gssapi) ++ if (NOT GSSAPI_FOUND) ++ message(WARNING "GSSAPI pkgconfig module was not found") ++ endif() ++ add_definitions("-DSERF_HAVE_GSSAPI") + endif() + + if(BROTLI) +@@ -285,6 +289,11 @@ if(NOT SKIP_SHARED) + PRIVATE ${SERF_PRIVATE_TARGETS} + ${SERF_STANDARD_LIBRARIES} + PUBLIC ${SERF_PUBLIC_TARGETS}) ++ if (GSSAPI_FOUND) ++ target_link_libraries(serf_shared PRIVATE ${GSSAPI_LIBRARIES}) ++ target_include_directories(serf_shared PRIVATE ${GSSAPI_INCLUDE_DIRS}) ++ target_compile_options(serf_shared PRIVATE ${GSSAPI_CFLAGS_OTHER}) ++ endif (GSSAPI_FOUND) + set_target_properties(serf_shared PROPERTIES + VERSION ${SERF_VERSION} + SOVERSION ${SERF_SOVERSION}) +@@ -307,6 +316,11 @@ if(NOT SKIP_STATIC) + ${SERF_PRIVATE_TARGETS} + ${SERF_PUBLIC_TARGETS} + ${SERF_STANDARD_LIBRARIES}) ++ if (GSSAPI_FOUND) ++ target_link_libraries(serf_shared PRIVATE ${GSSAPI_LIBRARIES}) ++ target_include_directories(serf_shared PRIVATE ${GSSAPI_INCLUDE_DIRS}) ++ target_compile_options(serf_shared PRIVATE ${GSSAPI_CFLAGS_OTHER}) ++ endif (GSSAPI_FOUND) + list(APPEND SERF_TARGETS "serf_static") + endif() + diff --git a/libserf.spec b/libserf.spec index 09e28d2..f750c04 100644 --- a/libserf.spec +++ b/libserf.spec @@ -1,6 +1,6 @@ Name: libserf Version: 1.3.10 -Release: 2%{?dist} +Release: 3%{?dist} Summary: High-Performance Asynchronous HTTP Client Library License: Apache-2.0 URL: http://serf.apache.org/ @@ -15,6 +15,7 @@ Patch0: %{name}-norpath.patch Patch1: %{name}-1.3.9-errgetfunc.patch Patch2: %{name}-1.3.9-multihome.patch Patch3: %{name}-1.3.9-cmake.patch +Patch4: %{name}-1.3.10-gssapi.patch %description The serf library is a C-based HTTP client library built upon the Apache @@ -46,12 +47,11 @@ popd %endif %build -%cmake -DCMAKE_INSTALL_LIBDIR=%{_libdir} +%cmake -DCMAKE_INSTALL_LIBDIR=%{_libdir} -DGSSAPI=ON -DSKIP_STATIC=ON %cmake_build %install %cmake_install -find %{buildroot}%{_libdir} -type f -name '*.*a' -delete -print mkdir -p %{buildroot}%{_libdir}/pkgconfig mv %{buildroot}%{_datadir}/pkgconfig/serf.pc %{buildroot}%{_libdir}/pkgconfig/serf.pc @@ -77,6 +77,10 @@ true %{_libdir}/pkgconfig/serf*.pc %changelog +* Thu Dec 07 2023 Tomas Korbar - 1.3.10-3 +- Add linking of gssapi to support Kerberos authentication +- Resolves: rhbz#2245095 + * Thu Jul 20 2023 Fedora Release Engineering - 1.3.10-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild