Fix linking of gssapi to support kerberos

This commit is contained in:
Tomas Korbar 2023-12-15 12:21:04 +01:00 committed by root
parent f39d19bb2b
commit 108bb994c0
3 changed files with 69 additions and 3 deletions

1
.libserf.metadata Normal file
View File

@ -0,0 +1 @@
26015c63e3bbb108c1689bf2090e4c26351db674 serf-1.3.9.tar.bz2

View File

@ -0,0 +1,60 @@
commit 821fc34e224a4e82563f0561be2e60fd1d4ec92b
Author: Tomas Korbar <tkorbar@redhat.com>
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()

View File

@ -1,6 +1,6 @@
Name: libserf
Version: 1.3.9
Release: 26%{?dist}
Release: 27%{?dist}
Summary: High-Performance Asynchronous HTTP Client Library
License: ASL 2.0
URL: http://serf.apache.org/
@ -15,6 +15,8 @@ Patch3: %{name}-1.3.9-errgetfunc.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2004714
# Patch BIO to work with openssl 3
Patch4: %{name}-1.3.9-bio-ctrl.patch
# https://issues.redhat.com/browse/RHEL-6802
Patch5: %{name}-1.3.9-gssapi.patch
%description
The serf library is a C-based HTTP client library built upon the Apache
@ -35,12 +37,11 @@ developing applications that use %{name}.
%autosetup -n serf-%{version} -p1
%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
@ -62,6 +63,10 @@ rm -rf %{buildroot}%{_datadir}
%{_libdir}/pkgconfig/serf*.pc
%changelog
* Fri Dec 15 2023 Tomas Korbar <tkorbar@redhat.com> - 1.3.9-27
- Fix linking of gssapi to support kerberos
- Resolves: RHEL-6802
* Fri Sep 17 2021 Tomas Korbar <tkorbar@redhat.com> - 1.3.9-26
- Fix BIO control function implementation
- Resolves: rhbz#2004714