summaryrefslogtreecommitdiffstats
path: root/hdrhistogram.spec
blob: 3bd2ab0879dcf238a4c0df4bfb94282d44628b28 (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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# remirepo spec file for HdrHistogram_c
#
# Copyright (c) 2016-2022 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#

%global gh_commit   b083efd27a51150201821ef6f18e0eba1f4b59f1
%global gh_short    %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner    HdrHistogram
%global gh_project  HdrHistogram_c
%global libname     libhdr_histogram
%global oldsoname   6
%global soname      106

%if 0%{?fedora} < 33 && 0%{?rhel} < 9
# to obsolete versions from remi newer than official repo
%bcond_without cleanold
%else
%bcond_with    cleanold
%endif

Name:          HdrHistogram_c%{oldsoname}php
Summary:       A High Dynamic Range (HDR) Histogram
Version:       0.11.5
Release:       1%{?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

%if 0%{?rhel} == 7
BuildRequires: cmake3 >= 3.12
BuildRequires: devtoolset-6-toolchain
%else
BuildRequires: cmake  >= 3.12
BuildRequires: gcc
BuildRequires: gcc-c++
%endif
BuildRequires: zlib-devel

Requires:   %{name}-libs%{?_isa} = %{version}-%{release}
%if %{with cleanold}
Obsoletes:  HdrHistogram_c = 0.10.0
Obsoletes:  HdrHistogram_c = 0.11.0
Obsoletes:  HdrHistogram_c = 0.11.1
%endif
Obsoletes:  hdrhistogram   < 0.11
Conflicts:  HdrHistogram_c < %{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}
Requires:   %{name}%{?_isa} = %{version}-%{release}
%if %{with cleanold}
Obsoletes:  HdrHistogram_c-devel = 0.10.0
Obsoletes:  HdrHistogram_c-devel = 0.11.0
Obsoletes:  HdrHistogram_c-devel = 0.11.1
%endif
Obsoletes:  hdrhistogram-devel   < 0.11
Conflicts:  HdrHistogram_c-devel < %{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
%if %{with cleanold}
Obsoletes:  HdrHistogram_c-libs = 0.10.0
Obsoletes:  HdrHistogram_c-libs = 0.11.0
Obsoletes:  HdrHistogram_c-libs = 0.11.1
%endif
Obsoletes:  hdrhistogram-libs   < 0.11

%description libs
This package contains the %{libname} library.


%prep
%setup -q -n %{gh_project}-%{gh_commit}
%patch0 -p1 -b .bump

mkdir docs
cp -pr examples docs/examples


%build
%if 0%{?rhel} == 7
source /opt/rh/devtoolset-6/enable

%cmake3 \
%else
%cmake \
%endif
  -DHDR_HISTOGRAM_INSTALL_STATIC=OFF \
  -S .

%if 0%{?cmake_build:1}
%cmake_build
%else
make %{_smp_mflags}
%endif


%install
%if 0%{?rhel} == 7
source /opt/rh/devtoolset-6/enable
%endif

%if 0%{?cmake_install:1}
%cmake_install
%else
make install  DESTDIR="%{buildroot}"
%endif

rm %{buildroot}/%{_bindir}/*test


%check
%if 0%{?ctest:1}
%ctest
%else
make test
%endif

if grep -r static %{buildroot}%{_libdir}/cmake; then
  : cmake configuration file contain reference to static library
  exit 1
fi


%if 0%{?fedora} < 28 && 0%{?rhel} < 8
%post   libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%endif



%files
%doc *.md
%{_bindir}/hiccup
%{_bindir}/hdr_decoder
%{_bindir}/hdr_histogram_perf

%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
%{_libdir}/cmake/hdr_histogram
%{_libdir}/pkgconfig/hdr_histogram.pc
%{_includedir}/hdr


%changelog
* Mon Mar 21 2022 Remi Collet <remi@remirepo.net> - 0.11.5-1
- update to 0.11.5

* Tue Mar  1 2022 Remi Collet <remi@remirepo.net> - 0.11.4-2
- better fix for pkgconfig file

* Tue Mar  1 2022 Remi Collet <remi@remirepo.net> - 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 <remi@remirepo.net> - 0.11.2-1
- update to 0.11.2

* Tue Dec  8 2020 Remi Collet <remi@remirepo.net> - 0.11.1-2
- bump soname to 106 and rename to HdrHistogram_c6php to allow
  parallel installation with default HdrHistogram_c

* Fri Sep 11 2020 Remi Collet <remi@remirepo.net> - 0.11.1-1
- update to 0.11.1

* Wed Aug 19 2020 Remi Collet <remi@remirepo.net> - 0.11.0-2
- fix cmake usage for F33 build

* Wed Jun 17 2020 Remi Collet <remi@remirepo.net> - 0.11.0-1
- update to 0.11.0
- rename to HdrHistogram_c to match Fedora
- drop patch merged upstream

* Mon Jun 15 2020 Remi Collet <remi@remirepo.net> - 0.10.0-1
- update to 0.10.0
- soname bump to 6
- add option to not install static libraries from
  https://github.com/HdrHistogram/HdrHistogram_c/pull/84
- add hdr_histogram_perf command

* Tue Feb 18 2020 Remi Collet <remi@remirepo.net> - 0.9.13-1
- update to 0.9.13
- soname bump to 5

* Tue Nov 19 2019 Remi Collet <remi@remirepo.net> - 0.9.12-1
- update to 0.9.12
- soname bump to 4

* Mon Jun 17 2019 Remi Collet <remi@remirepo.net> - 0.9.11-1
- update to 0.9.11

* Mon May 20 2019 Remi Collet <remi@remirepo.net> - 0.9.10-1
- update to 0.9.10

* Mon Jan 21 2019 Remi Collet <remi@remirepo.net> - 0.9.8-1
- update to 0.9.8
- soname bump to 3

* Wed Aug 22 2018 Remi Collet <remi@remirepo.net> - 0.9.7-3
- F29 cleanup

* Mon Feb 26 2018 Remi Collet <remi@remirepo.net> - 0.9.7-2
- F28 cleanup

* Fri Sep 15 2017 Remi Collet <remi@remirepo.net> - 0.9.7-1
- update to 0.9.7

* 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