summaryrefslogtreecommitdiffstats
path: root/hdrhistogram.spec
blob: ca938d0227e75ff5c9aedfa3d9bb09bb39319ff2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# remirepo spec file for hdrhistogram
#
# Copyright (c) 2016-2017 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#

%global gh_commit   c9a17ce8c34691a22a5e33aa198c58d962433b8a
%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.6
Release:       2%{?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

# build with fPIC
Patch0:        %{name}-fpic.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 .fpic

grep CMAKE_C_FLAGS 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}"

# https://github.com/HdrHistogram/HdrHistogram_c/issues/32
install -p src/hdr_thread.h %{buildroot}%{_includedir}/hdr/hdr_thread.h

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
* Tue Aug 22 2017 Remi Collet <remi@fedoraproject.org> - 0.9.6-2
- honour default RPM build options

* Fri Apr 21 2017 Remi Collet <remi@fedoraproject.org> - 0.9.6-1
- update to 0.9.6

* Sun Sep  4 2016 Remi Collet <remi@fedoraproject.org> - 0.9.5-1
- update to 0.9.5

* Mon Jul 18 2016 Remi Collet <remi@fedoraproject.org> - 0.9.4-1
- update to 0.9.4

* Wed Apr  6 2016 Remi Collet <remi@fedoraproject.org> - 0.9.3-1
- update to 0.9.3

* Fri Jan  1 2016 Remi Collet <remi@fedoraproject.org> - 0.9.1-1
- initial package