From 7be7f764646e21313696b90de2ee461420a11ad8 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 1 Jan 2016 10:27:05 +0100 Subject: hdrhistogram: new package (library) --- Makefile | 4 ++ hdrhistogram-pr28.patch | 65 +++++++++++++++++++++++++ hdrhistogram.spec | 127 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 196 insertions(+) create mode 100644 Makefile create mode 100644 hdrhistogram-pr28.patch create mode 100644 hdrhistogram.spec diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1e65467 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +SRCDIR := $(shell pwd) +NAME := $(shell basename $(SRCDIR)) +include ../common/Makefile + diff --git a/hdrhistogram-pr28.patch b/hdrhistogram-pr28.patch new file mode 100644 index 0000000..f3f56ae --- /dev/null +++ b/hdrhistogram-pr28.patch @@ -0,0 +1,65 @@ +Adpated for 0.9.1 from + +From cfff41dc89f569deb1cd0c46c4e60a95ec8a2ce2 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Fri, 1 Jan 2016 09:56:12 +0100 +Subject: [PATCH 1/2] honours LIB_SUFFIX value + +--- + src/CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +From ccdfb385fe39144f7c092d5d677a50f3c992cd72 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Fri, 1 Jan 2016 09:56:40 +0100 +Subject: [PATCH 2/2] add soname version + +--- + CMakeLists.txt | 15 +++++++++++++++ + src/CMakeLists.txt | 7 +++++++ + 2 files changed, 22 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4dd745e..7aab9cf 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,6 +6,21 @@ endif() + + project("hdr_histogram") + ++# Follow all steps below in order to calculate new ABI version when updating the library ++# NOTE: THIS IS UNRELATED to the actual project version ++# ++# 1. If the library source code has changed at all since the last update, then increment revision ++# 2. If any interfaces have been added, removed, or changed since the last update, increment current and set revision to 0. ++# 3. If any interfaces have been added since the last public release, then increment age. ++# 4. If any interfaces have been removed since the last public release, then set age to 0. ++ ++set(HDR_SOVERSION_CURRENT 1) ++set(HDR_SOVERSION_REVISION 0) ++set(HDR_SOVERSION_AGE 0) ++ ++set(HDR_VERSION ${HDR_SOVERSION_CURRENT}.${HDR_SOVERSION_AGE}.${HDR_SOVERSION_REVISION}) ++set(HDR_SOVERSION ${HDR_SOVERSION_CURRENT}) ++ + ENABLE_TESTING() + + if(UNIX) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +--- a/src/CMakeLists.txt.pr28 2016-01-01 10:03:49.583109992 +0100 ++++ a/src/CMakeLists.txt 2016-01-01 10:05:48.075702608 +0100 +@@ -6,6 +6,12 @@ add_library(hdr_histogram_static STATIC + target_link_libraries(hdr_histogram m z) + target_link_libraries(hdr_histogram_static m z) + +-install(TARGETS hdr_histogram DESTINATION lib) +-install(TARGETS hdr_histogram_static DESTINATION lib) ++if (WIN32) ++ set_target_properties(hdr_histogram PROPERTIES VERSION ${HDR_VERSION}) ++else (WIN32) ++ set_target_properties(hdr_histogram PROPERTIES VERSION ${HDR_VERSION} SOVERSION ${HDR_SOVERSION}) ++endif (WIN32) ++ ++install(TARGETS hdr_histogram DESTINATION lib${LIB_SUFFIX}) ++install(TARGETS hdr_histogram_static DESTINATION lib${LIB_SUFFIX}) + install(FILES hdr_histogram.h hdr_histogram_log.h hdr_writer_reader_phaser.h hdr_interval_recorder.h DESTINATION include/hdr) diff --git a/hdrhistogram.spec b/hdrhistogram.spec new file mode 100644 index 0000000..dde060a --- /dev/null +++ b/hdrhistogram.spec @@ -0,0 +1,127 @@ +# remirepo spec file for hdrhistogram +# +# Copyright (c) 2016 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/4.0/ +# +# Please, preserve the changelog entries +# + +%global gh_commit eb371a12b9d42b9a9a8c2497841d5fa0d44f6ca4 +%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) +%global gh_owner HdrHistogram +%global gh_project HdrHistogram_c +%global libname libhdr_histogram +%global soname 1 + +Name: hdrhistogram +Summary: A High Dynamic Range (HDR) Histogram +Version: 0.9.1 +Release: 1%{?dist} +License: CC0 or BSD +Group: System Environment/Libraries + +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 + +# See https://github.com/HdrHistogram/HdrHistogram_c/pull/28 +# honours LIB_SUFFIX option +# set soname version +Patch0: %{name}-pr28.patch + +BuildRequires: cmake > 2.8 +BuildRequires: zlib-devel + +Requires: %{name}-libs%{?_isa} = %{version}-%{release} + + +%description +HdrHistogram: A High Dynamic Range (HDR) Histogram. + +This port contains a subset of the functionality supported +by the Java implementation. The current supported features are: + +- Standard histogram with 64 bit counts (32/16 bit counts not supported) +- All iterator types (all values, recorded, percentiles, linear, logarithmic) +- Histogram serialisation (encoding version 1.2, decoding 1.0-1.2) +- Reader/writer phaser and interval recorder + + +%package devel +Summary: Header files and development libraries for %{name} +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +This package contains the header files and development libraries +for %{name}. + + +%package libs +Summary: A High Dynamic Range (HDR) Histogram C library +Group: System Environment/Libraries + +%description libs +This package contains the %{libname} library. + + +%prep +%setup -q -n %{gh_project}-%{gh_commit} + +mkdir docs +cp -pr examples docs/examples + +%patch0 -p1 -b .pr28 + +sed -e '/CMAKE_C_FLAGS/d' -i CMakeLists.txt + + +%build +export CFLAGS="%{optflags} -Wno-unknown-pragmas -std=gnu99" + +%if 0%{?rhel} == 5 +%cmake28 . +%else +%cmake . +%endif + +make %{_smp_mflags} + + +%install +make install DESTDIR="%{buildroot}" + +rm %{buildroot}/%{_libdir}/%{libname}_static.a +rm %{buildroot}/%{_bindir}/*test + + +%check +make test + + +%post libs -p /sbin/ldconfig + +%postun libs -p /sbin/ldconfig + + +%files +%doc *.md +%{_bindir}/hiccup +%{_bindir}/hdr_decoder + +%files libs +%{!?_licensedir:%global license %%doc} +%license COPYING.txt +%license LICENSE.txt +%{_libdir}/%{libname}.so.%{soname}* + +%files devel +%doc *.md +%doc docs/examples +%{_libdir}/%{libname}.so +%{_includedir}/hdr + + +%changelog +* Fri Jan 1 2016 Remi Collet - 0.9.1-1 +- initial package \ No newline at end of file -- cgit