From 6102f62b25a9642552d572a8e2e8c2baf3b0cc71 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 1 Mar 2022 15:13:55 +0100 Subject: better fix for pkgconfig file --- HdrHistogram_c-static.patch | 56 ------------------------------------------- hdrhistogram.spec | 20 +++++++++------- pkgconfig.patch | 58 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 65 deletions(-) delete mode 100644 HdrHistogram_c-static.patch create mode 100644 pkgconfig.patch diff --git a/HdrHistogram_c-static.patch b/HdrHistogram_c-static.patch deleted file mode 100644 index de85b37..0000000 --- a/HdrHistogram_c-static.patch +++ /dev/null @@ -1,56 +0,0 @@ -From d74a6abee509010a17c4a2c18e9d29acd3bad5d4 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Mon, 15 Jun 2020 10:50:12 +0200 -Subject: [PATCH] add options to be able to not install libraries - ---- - src/CMakeLists.txt | 18 +++++++++++------- - 1 file changed, 11 insertions(+), 7 deletions(-) - -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index a30f8fc..60be048 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -28,7 +28,7 @@ set(HDR_HISTOGRAM_PUBLIC_HEADERS - hdr_time.h - hdr_writer_reader_phaser.h) - --function(hdr_histogram_add_library NAME LIBRARY_TYPE) -+function(hdr_histogram_add_library NAME LIBRARY_TYPE DO_INSTALL) - add_library(${NAME} ${LIBRARY_TYPE} - ${HDR_HISTOGRAM_SOURCES} - ${HDR_HISTOGRAM_PRIVATE_HEADERS} -@@ -44,23 +44,27 @@ function(hdr_histogram_add_library NAME LIBRARY_TYPE) - PUBLIC - $ - $) -- install( -- TARGETS ${NAME} -- EXPORT ${PROJECT_NAME}-targets -- DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ if(DO_INSTALL) -+ install( -+ TARGETS ${NAME} -+ EXPORT ${PROJECT_NAME}-targets -+ DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ endif() - endfunction() - - option(HDR_HISTOGRAM_BUILD_SHARED "Build shared library" ON) -+option(HDR_HISTOGRAM_BUILD_SHARED "Install shared library" ON) - if(HDR_HISTOGRAM_BUILD_SHARED) -- hdr_histogram_add_library(hdr_histogram SHARED) -+ hdr_histogram_add_library(hdr_histogram SHARED ${HDR_HISTOGRAM_BUILD_SHARED}) - set_target_properties(hdr_histogram PROPERTIES - VERSION ${HDR_VERSION} - SOVERSION ${HDR_SOVERSION}) - endif() - - option(HDR_HISTOGRAM_BUILD_STATIC "Build static library" ON) -+option(HDR_HISTOGRAM_INSTALL_STATIC "Install static library" ON) - if(HDR_HISTOGRAM_BUILD_STATIC) -- hdr_histogram_add_library(hdr_histogram_static STATIC) -+ hdr_histogram_add_library(hdr_histogram_static STATIC ${HDR_HISTOGRAM_INSTALL_STATIC}) - endif() - - install( diff --git a/hdrhistogram.spec b/hdrhistogram.spec index f6a7461..4f38c13 100644 --- a/hdrhistogram.spec +++ b/hdrhistogram.spec @@ -25,13 +25,14 @@ Name: HdrHistogram_c%{oldsoname}php Summary: A High Dynamic Range (HDR) Histogram Version: 0.11.4 -Release: 1%{?dist} +Release: 2%{?dist} License: CC0 or BSD URL: https://github.com/%{gh_owner}/%{gh_project} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz Patch0: bumpsoname.patch +Patch1: pkgconfig.patch %if 0%{?rhel} == 7 BuildRequires: cmake3 >= 3.12 @@ -98,12 +99,7 @@ This package contains the %{libname} library. %prep %setup -q -n %{gh_project}-%{gh_commit} %patch0 -p1 -b .bump - -sed -e 's/CMAKE_INSTALL_DATAROOTDIR/CMAKE_INSTALL_LIBDIR/' -i CMakeLists.txt -sed -e 's/CMAKR_CURRENT_BINARY_DIR/CMAKE_CURRENT_BINARY_DIR/' -i CMakeLists.txt -%if 0%{?rhel} == 7 -sed -e '/^Requires.private/d' -i hdr_histogram.pc.in -%endif +%patch1 -p1 -b .pkgconfig mkdir docs cp -pr examples docs/examples @@ -183,13 +179,19 @@ fi %changelog -* Thu Dec 10 2020 Remi Collet - 0.11.2-1 -- update to 0.11.1 +* Tue Mar 1 2022 Remi Collet - 0.11.4-2 +- better fix for pkgconfig file + +* Tue Mar 1 2022 Remi Collet - 0.11.4-1 +- update to 0.11.4 - add pkgconfig file, fix its installation using patch from https://github.com/HdrHistogram/HdrHistogram_c/pull/104 - fix pkgconfig file using patch from https://github.com/HdrHistogram/HdrHistogram_c/pull/105 +* Thu Dec 10 2020 Remi Collet - 0.11.2-1 +- update to 0.11.2 + * Tue Dec 8 2020 Remi Collet - 0.11.1-2 - bump soname to 106 and rename to HdrHistogram_c6php to allow parallel installation with default HdrHistogram_c diff --git a/pkgconfig.patch b/pkgconfig.patch new file mode 100644 index 0000000..f4500bd --- /dev/null +++ b/pkgconfig.patch @@ -0,0 +1,58 @@ +From 7248409b5b56c825fe3c0a50c4c7e304e8551b40 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Tue, 1 Mar 2022 09:47:38 +0100 +Subject: [PATCH] fix pkgconfig installation + +--- + CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f6313ab..51bcc6e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -107,6 +107,6 @@ configure_file( + @ONLY + ) + install( +- FILES ${CMAKR_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc +- DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig ++ FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + ) +From 2df75f0b666761a650f7afb749f2dc72e8afb5a2 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Tue, 1 Mar 2022 14:59:44 +0100 +Subject: [PATCH 3/3] Clean pkgconfig + +--- + CMakeLists.txt | 4 +--- + hdr_histogram.pc.in | 2 +- + 2 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 51bcc6e..4a09589 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -95,10 +95,8 @@ set(CPACK_GENERATOR "TGZ") + include(CPack) + + if(${ZLIB_FOUND}) +- set(PC_LIBS_PRIVATE_ZLIB "-lz") +- set(PC_REQUIRES_PRIVATE_ZLIB "zlib >= 1.2.11") ++ set(PC_REQUIRES_PRIVATE_ZLIB "zlib") + else() +- set(PC_LIBS_PRIVATE_ZLIB "") + set(PC_REQUIRES_PRIVATE_ZLIB "") + endif() + configure_file( +diff --git a/hdr_histogram.pc.in b/hdr_histogram.pc.in +index a88e5e9..8494dc3 100644 +--- a/hdr_histogram.pc.in ++++ b/hdr_histogram.pc.in +@@ -9,4 +9,4 @@ Version: @PROJECT_VERSION@ + Requires.private: @PC_REQUIRES_PRIVATE_ZLIB@ + Cflags: -I${includedir} + Libs: -L${libdir} -l@PROJECT_NAME@ +-Libs.private: -pthread -lm -lrt @PC_LIBS_PRIVATE_ZLIB@ -L${libdir} ++Libs.private: -pthread -lm -lrt -L${libdir} -- cgit