]> TLD Linux GIT Repositories - packages/rrdtool.git/blob - rrdtool.spec
- install init script and sysconfig file
[packages/rrdtool.git] / rrdtool.spec
1 # TODO:
2 # - SysV init script for rrdcached, post/postun/etc.
3 #
4 # Conditional build:
5 %bcond_without  lua             # LUA binding
6 %bcond_without  perl            # Perl binding
7 %bcond_without  python          # Python binding
8 %bcond_without  ruby            # Ruby binding
9 %bcond_without  tcl             # Tcl binding
10 %bcond_without  ceph            # Ceph (RADOS) storage support
11 %bcond_without  rrd_graph       # all rrd_graph functions (depend on cairo+pango)
12 %bcond_without  rrdcgi          # building of rrdcgi (depends on rrd_graph)
13
14 %if %{without rrd_graph}
15 %undefine       with_rrdcgi
16 %endif
17
18 # ceph >= 14.0 no longer support 32-bit archs
19 %ifarch %{ix86}
20 %undefine       with_ceph
21 %endif
22
23 %define pdir    RRDp
24 Summary:        RRDtool - round robin database
25 Summary(pl.UTF-8):      RRDtool - baza danych typu round-robin
26 Summary(pt_BR.UTF-8):   Round Robin Database, uma ferramenta para construção de gráficos
27 Summary(ru.UTF-8):      RRDtool - база данных с "циклическим обновлением"
28 Summary(uk.UTF-8):      RRDtool - це система зберігання та показу серійних даних
29 Name:           rrdtool
30 Version:        1.7.2
31 Release:        2
32 License:        GPL v2+ + FLOSS exception
33 Group:          Applications/Databases
34 Source0:        https://oss.oetiker.ch/rrdtool/pub/%{name}-%{version}.tar.gz
35 # Source0-md5:  638e3a0a1609d97e9f82e8832759dcd2
36 Patch0:         %{name}-tcl-path.patch
37 Patch1:         %{name}-missing.patch
38 Patch2:         groff.patch
39 URL:            http://oss.oetiker.ch/rrdtool/
40 BuildRequires:  autoconf >= 2.60
41 BuildRequires:  automake
42 %{?with_ceph:BuildRequires:     ceph-devel}
43 BuildRequires:  gettext-tools >= 0.18
44 BuildRequires:  glib2-devel >= 1:2.28.7
45 BuildRequires:  groff
46 BuildRequires:  libdbi-devel
47 BuildRequires:  libtool
48 BuildRequires:  libwrap-devel
49 BuildRequires:  libxml2-devel >= 1:2.7.8
50 BuildRequires:  pkgconfig
51 BuildRequires:  rpm-pythonprov
52 BuildRequires:  rpmbuild(macros) >= 1.272
53 %if %{with rrd_graph}
54 BuildRequires:  cairo-devel >= 1.10.2
55 BuildRequires:  libpng-devel
56 BuildRequires:  pango-devel >= 1:1.28.7
57 %endif
58 %if %{with lua}
59 BuildRequires:  lua51 >= 5.1
60 BuildRequires:  lua51-devel >= 5.1
61 %endif
62 %if %{with perl}
63 BuildRequires:  perl-devel >= 1:5.8.0
64 BuildRequires:  rpm-perlprov
65 %endif
66 %if %{with python}
67 BuildRequires:  python >= 1:2.3
68 BuildRequires:  python-devel >= 1:2.3
69 %endif
70 %if %{with ruby}
71 BuildRequires:  rpm-rubyprov
72 BuildRequires:  ruby-devel
73 %endif
74 %if %{with tcl}
75 BuildRequires:  tcl-devel
76 %endif
77 %{?with_rrd_graph:Requires:     cairo >= 1.10.2}
78 Requires:       glib2 >= 1:2.28.7
79 Requires:       libxml2 >= 1:2.7.8
80 %{?with_rrd_graph:Requires:     pango >= 1:1.28.7}
81 Suggests:       fonts-TTF-DejaVu
82 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
83
84 %description
85 RRD is the Acronym for Round Robin Database. RRD is a system to store
86 and display time-series data (i.e. network bandwidth, machine-room
87 temperature, server load average). It stores the data in a very
88 compact way that will not expand over time, and it presents useful
89 graphs by processing the data to enforce a certain data density. It
90 can be used either via simple wrapper scripts (from shell or Perl) or
91 via frontends that poll network devices and put a friendly user
92 interface on it.
93
94 %description -l pl.UTF-8
95 RRD jest akronimem Round Robin Database. Jest to system pozwalający na
96 składowanie i wyświetlanie czasowych serii danych (np. przepustowość
97 sieci, temperatura w pomieszczeniu, obciążenie serwera). Składuje dane
98 w "skondensowanej" postaci, która nie rozrasta się z biegiem czasu
99 oraz pozwala na produkowanie wykresów z użytecznymi danymi. Może być
100 używane poprzez prosty skrypcik (shell lub Perl), frontendy czy inne
101 interfejsy użytkownika.
102
103 %description -l pt_BR.UTF-8
104 RRD e' um sistema para armazenar e apresentar series temporais de
105 dados (i.e. utilização de rede, temperaturas, cargas em servidores).
106 Os dados são armazenados em uma forma compacta que não se expande com
107 o tempo, e gráficos podem ser apresentados processando-se esses dados.
108 RRD pode ser utilizado com wrapper scripts (em shell ou Perl) ou
109 através de front-ends.
110
111 %description -l ru.UTF-8
112 RRD - соращение для "Round Robin Database" (база данных с "циклическим
113 обновлением"). RRD - система для сохранения и показа информации за
114 определенный промежуток времени (например скорость передачи данных в
115 сети, температуру в машинном зале, среднюю загрузку сервера). Она
116 сохраняет данные в очень компактной форме, так что данные не будут
117 занимать все больше и больше места с течением времени и предоставляет
118 разумное графическое представление информации. Может быть использована
119 как из простых скриптов (shell, Perl, etc) или встроена в программы,
120 которые опрашивают сетевые устройства и показывают данные в удобном
121 для пользователя виде.
122
123 %description -l uk.UTF-8
124 Назва RRD - це акронім для Round Robin Database. RRD - це система
125 зберігання та показу серійних даних (наприклад, полоси каналу,
126 температура гермозони, завантаження сервера). RRD зберігає дані дуже
127 компактно і так, що розмір бази даних не збільшується з часом, та
128 презентує корисні графіки обробляючи дані з тим, щоб встановити
129 потрібну щільність вибірки в часі. RRD можна використовувати як через
130 прості wrapper-скрипти, так і через фронтенди, що опитують мережеві
131 пристрої та надають дружній інтерфейс користувача.
132
133 %package cached
134 Summary:        Data caching daemon for RRDtool
135 Summary(pl.UTF-8):      Demon pamięci podręcznej danych dla RRDtoola
136 Group:          Daemons
137 Requires:       %{name} = %{version}-%{release}
138
139 %description cached
140 Data caching daemon for RRDtool.
141
142 %description cached -l pl.UTF-8
143 Demon pamięci podręcznej danych dla RRDtoola.
144
145 %package devel
146 Summary:        RRDtool development
147 Summary(pl.UTF-8):      Narzędzia programistyczne pakietu RRDtool
148 Summary(pt_BR.UTF-8):   Bibliotecas e arquivos de inclusão da librrd
149 Summary(ru.UTF-8):      RRDtool - Заголовки, необходимые для разработки
150 Summary(uk.UTF-8):      RRDtool - бібліотечні лінки та файли хедерів
151 Group:          Development/Libraries
152 Requires:       %{name} = %{version}-%{release}
153 %{?with_rrd_graph:Requires:     cairo-devel >= 1.10.2}
154 Requires:       glib2-devel >= 1:2.28.7
155 Requires:       libdbi-devel
156 Requires:       libwrap-devel
157 Requires:       libxml2-devel >= 1:2.7.8
158 %{?with_rrd_graph:Requires:     pango-devel >= 1:1.28.7}
159
160 %description devel
161 RRDtool development files.
162
163 %description devel -l pl.UTF-8
164 Narzędzia programistyczne pakietu RRDtool.
165
166 %description devel -l pt_BR.UTF-8
167 RRD e' um sistema para armazenar e apresentar series temporais de
168 dados (i.e. utilização de rede, temperaturas, cargas em servidores).
169
170 Este pacote contem arquivos de desenvolvimento do RRD.
171
172 %description devel -l ru.UTF-8
173 RRD - соращение для "Round Robin Database" (база данных с "циклическим
174 обновлением"). RRD - система для сохранения и показа информации за
175 определенный промежуток времени (например скорость передачи данных в
176 сети, температуру в машинном зале, среднюю загрузку сервера).
177
178 Этот пакет позволяет создавать программы, которые используют это
179 библиотеку непосредственно.
180
181 %description devel -l uk.UTF-8
182 RRDtool - библиотечные линки и файлы хедеров.
183
184 %package static
185 Summary:        RRDtool static library
186 Summary(pl.UTF-8):      Statyczne biblioteki RRDtool
187 Summary(pt_BR.UTF-8):   Biblioteca estática librrd
188 Summary(ru.UTF-8):      RRDtool - Статические библиотеки
189 Summary(uk.UTF-8):      Статичні бібліотеки RRDtool
190 Group:          Development/Libraries
191 Requires:       %{name}-devel = %{version}-%{release}
192
193 %description static
194 RRDtool static library.
195
196 %description static -l pl.UTF-8
197 Statyczne biblioteki RRDtool.
198
199 %description static -l pt_BR.UTF-8
200 RRD e' um sistema para armazenar e apresentar series temporais de
201 dados (i.e. utilização de rede, temperaturas, cargas em servidores).
202
203 Este pacote contem a biblioteca estática do RRD.
204
205 %description static -l ru.UTF-8
206 RRD - соращение для "Round Robin Database" (база данных с "циклическим
207 обновлением"). RRD - система для сохранения и показа информации за
208 определенный промежуток времени (например скорость передачи данных в
209 сети, температуру в машинном зале, среднюю загрузку сервера). Этот
210 пакет позволяет создавать статически слинкованные программы, которые
211 используют это библиотеку непосредственно.
212
213 %description static -l uk.UTF-8
214 Статичні бібліотеки для розробки програм, що використовують RRDtool.
215
216 %package doc
217 Summary:        RRDtool documentation
218 Summary(pl.UTF-8):      Dokumentacja do RRDtoola
219 Group:          Documentation
220 # noarch subpackages only when building with rpm5
221 %if "%{_rpmversion}" >= "5"
222 BuildArch:      noarch
223 %endif
224
225 %description doc
226 RRD is the Acronym for Round Robin Database. RRD is a system to store
227 and display time-series data (i.e. network bandwidth, machine-room
228 temperature, server load average).
229
230 This package contains documentation on using RRD.
231
232 %description doc -l pl.UTF-8
233 RRD jest akronimem Round Robin Database. Jest to system pozwalający na
234 składowanie i wyświetlanie czasowych serii danych (np. przepustowość
235 sieci, temperatura w pomieszczeniu, obciążenie serwera).
236
237 Ten pakiet zawiera dokumentację użytkownika dla RRD.
238
239 %package -n lua-rrdtool
240 Summary:        RRD module for Lua
241 Summary(pl.UTF-8):      Moduł RRD dla języka Lua
242 Group:          Development/Languages
243 Requires:       %{name} = %{version}-%{release}
244 Requires:       lua51
245
246 %description -n lua-rrdtool
247 Lua interface to RRDtool.
248
249 %description -n lua-rrdtool -l pl.UTF-8
250 Interfejs języka Lua do RRDtoola.
251
252 %package -n perl-rrdtool
253 Summary:        Access RRDtool from Perl
254 Summary(pl.UTF-8):      Dostęp do RRDtoola z poziomu Perla
255 Group:          Development/Languages/Perl
256 Requires:       %{name} = %{version}-%{release}
257
258 %description -n perl-rrdtool
259 Perl modules to access RRDtool: RRDs to access RRDtool as shared
260 module and RRDp to access RRDtool via a set of pipes.
261
262 %description -n perl-rrdtool -l pl.UTF-8
263 Moduły Perla pozwalające na dostęp do RRDtoola: RRDs do dostępu do
264 RRDtoola jako modułu dzielonego oraz RRDp do dostępu poprzez zestaw
265 potoków.
266
267 %package -n python-rrdtool
268 Summary:        Python interface to RRDtool
269 Summary(pl.UTF-8):      Pythonowy interfejs do RRDtoola
270 Group:          Development/Languages/Python
271 Requires:       %{name} = %{version}-%{release}
272 Requires:       python-libs
273
274 %description -n python-rrdtool
275 Python interface to RRDtool, the graphing and logging utility.
276
277 %description -n python-rrdtool -l pl.UTF-8
278 Interfejs Pythona do RRDtoola - narzędzia do tworzenia wykresów i
279 logowania.
280
281 %package -n ruby-rrdtool
282 Summary:        Ruby interface to RRDtool
283 Summary(pl.UTF-8):      Interfejs języka Ruby do RRDtoola
284 Group:          Development/Languages/Python
285 Requires:       %{name} = %{version}-%{release}
286
287 %description -n ruby-rrdtool
288 Ruby interface to RRDtool, the graphing and logging utility.
289
290 %description -n ruby-rrdtool -l pl.UTF-8
291 Interfejs języka Ruby do RRDtoola - narzędzia do tworzenia wykresów i
292 logowania.
293
294 %package -n tcl-rrdtool
295 Summary:        Tcl extension to access the RRD library
296 Summary(pl.UTF-8):      Rozszerzenie Tcl-a pozwalające na dostęp do biblioteki Tcl
297 Group:          Development/Languages/Tcl
298 Requires:       %{name} = %{version}-%{release}
299 Requires:       tcl
300
301 %description -n tcl-rrdtool
302 Tcl extension to access the RRD library.
303
304 %description -n tcl-rrdtool -l pl.UTF-8
305 Rozszerzenie Tcl-a pozwalające na dostęp do biblioteki Tcl.
306
307 %prep
308 %setup -q
309 %patch0 -p1
310 %patch1 -p1
311 %patch2 -p1
312
313 %{__sed} -i -e 's#\$TCL_PACKAGE_PATH#%{_prefix}/lib#g' configure.ac
314 %{__sed} -i -e 's#/lib/lua/#/%{_lib}/lua/#g' configure.ac
315
316 %{__sed} -E -i -e '1s,#!\s*/usr/bin/python(\s|$),#!%{__python}\1,' \
317       examples/stripes.py
318
319 %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+tclsh@TCL_VERSION@(\s|$),#!%{__tclsh}\1,' \
320       bindings/tcl/ifOctets.tcl.in
321
322 # We only want .txt and .html files for the main documentation
323 install -d docs/{html,/txt}
324 mv doc/*.txt docs/txt
325 mv doc/*.html docs/html
326
327 # Put Perl docs in Perl package
328 install -d perl-docs/html
329 mv docs/html/RRD*.html perl-docs/html
330
331 %build
332 %{__libtoolize}
333 %{__aclocal} -I m4
334 %{__autoconf}
335 %{__autoheader}
336 %{__automake}
337 %configure \
338         LUA=/usr/bin/lua5.1 \
339         --disable-silent-rules \
340         %{!?with_ceph:--disable-librados} \
341         %{!?with_rrd_graph:--disable-rrd_graph} \
342         %{!?with_rrdcgi:--disable-rrdcgi} \
343         %{!?with_lua:--disable-lua} \
344         %{!?with_perl:--disable-perl} \
345         %{!?with_python:--disable-python} \
346         %{!?with_ruby:--disable-ruby} \
347         %{!?with_tcl:--disable-tcl} \
348         --with-perl-options="INSTALLDIRS=vendor"
349
350 # empty RUBY_MAKE_OPTIONS as workaround for some make weirdness
351 # (tried to install without DESTDIR on plain make)
352 %{__make} \
353         RUBY_MAKE_OPTIONS= \
354         LUA_CFLAGS=-I/usr/include/lua51
355
356 %install
357 rm -rf $RPM_BUILD_ROOT
358 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
359
360 %{__make} install \
361         DESTDIR=$RPM_BUILD_ROOT \
362         perl_sitearch=%{perl_vendorarch} \
363         pythondir=%{py_sitedir} \
364         examplesdir=%{_examplesdir}/%{name}-%{version} \
365         RUBYARCHDIR=$RPM_BUILD_ROOT%{ruby_archdir}
366
367 %{__rm} $RPM_BUILD_ROOT%{_libdir}/librrd.la
368 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}
369
370 %if %{with lua}
371 %{__rm} $RPM_BUILD_ROOT%{_libdir}/lua/5.1/*.{la,a}
372 %endif
373
374 %if %{with perl}
375 %{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/auto/RRDs/.packlist
376 %endif
377
378 %clean
379 rm -rf $RPM_BUILD_ROOT
380
381 %post   -p /sbin/ldconfig
382 %postun -p /sbin/ldconfig
383
384 %files
385 %defattr(644,root,root,755)
386 %doc CHANGES CONTRIBUTORS NEWS THREADS TODO
387 %attr(755,root,root) %{_libdir}/librrd.so.*.*.*
388 %attr(755,root,root) %ghost %{_libdir}/librrd.so.8
389 %{?with_rrdcgi:%attr(755,root,root) %{_bindir}/rrdcgi}
390 %attr(755,root,root) %{_bindir}/rrdcreate
391 %attr(755,root,root) %{_bindir}/rrdinfo
392 %attr(755,root,root) %{_bindir}/rrdtool
393 %attr(755,root,root) %{_bindir}/rrdupdate
394 %{_mandir}/man1/bin_dec_hex.1*
395 %{_mandir}/man1/cdeftutorial.1*
396 %{_mandir}/man1/rpntutorial.1*
397 %{_mandir}/man1/rrd-beginners.1*
398 %{_mandir}/man1/rrd_pdpcalc.1*
399 %{_mandir}/man1/rrdbuild.1*
400 %{?with_rrdcgi:%{_mandir}/man1/rrdcgi.1*}
401 %{_mandir}/man1/rrdcreate.1*
402 %{_mandir}/man1/rrddump.1*
403 %{_mandir}/man1/rrdfetch.1*
404 %{_mandir}/man1/rrdfirst.1*
405 %{_mandir}/man1/rrdgraph*.1*
406 %{_mandir}/man1/rrdinfo.1*
407 %{_mandir}/man1/rrdlast.1*
408 %{_mandir}/man1/rrdlastupdate.1*
409 %{_mandir}/man1/rrdlist.1*
410 %{?with_ceph:%{_mandir}/man1/rrdrados.1*}
411 %{_mandir}/man1/rrdresize.1*
412 %{_mandir}/man1/rrdrestore.1*
413 %{_mandir}/man1/rrdthreads.1*
414 %{_mandir}/man1/rrdtool.1*
415 %{_mandir}/man1/rrdtune.1*
416 %{_mandir}/man1/rrdtutorial.1*
417 %{_mandir}/man1/rrdupdate.1*
418 %{_mandir}/man1/rrdxport.1*
419
420 %files cached
421 %defattr(644,root,root,755)
422 %attr(755,root,root) %{_bindir}/rrdcached
423 %{_mandir}/man1/rrdcached.1*
424 %{_mandir}/man1/rrdflushcached.1*
425
426 %files devel
427 %defattr(644,root,root,755)
428 %attr(755,root,root) %{_libdir}/librrd.so
429 %{_includedir}/rrd*.h
430 %{_pkgconfigdir}/librrd.pc
431 %{_mandir}/man3/librrd.3*
432
433 %files static
434 %defattr(644,root,root,755)
435 %{_libdir}/librrd.a
436
437 %files doc
438 %defattr(644,root,root,755)
439 %doc docs/html docs/txt
440 %{_examplesdir}/%{name}-%{version}
441
442 %if %{with lua}
443 %files -n lua-rrdtool
444 %defattr(644,root,root,755)
445 %attr(755,root,root) %{_libdir}/lua/5.1/rrd.so*
446 %{_mandir}/man1/rrdlua.1*
447 %endif
448
449 %if %{with perl}
450 %files -n perl-rrdtool
451 %defattr(644,root,root,755)
452 %doc perl-docs/html/*
453 %{perl_vendorlib}/RRDp.pm
454 %{perl_vendorarch}/RRDs.pm
455 %dir %{perl_vendorarch}/auto/RRDs
456 %attr(755,root,root) %{perl_vendorarch}/auto/RRDs/RRDs.so
457 %{_mandir}/man3/RRDp.3*
458 %{_mandir}/man3/RRDs.3*
459 %endif
460
461 %if %{with python}
462 %files -n python-rrdtool
463 %defattr(644,root,root,755)
464 %attr(755,root,root) %{py_sitedir}/rrdtool.so
465 %if "%{py_ver}" > "2.4"
466 %{py_sitedir}/rrdtool-*.egg-info
467 %endif
468 %endif
469
470 %if %{with ruby}
471 %files -n ruby-rrdtool
472 %defattr(644,root,root,755)
473 %attr(755,root,root) %{ruby_archdir}/RRD.so
474 %endif
475
476 %if %{with tcl}
477 %files -n tcl-rrdtool
478 %defattr(644,root,root,755)
479 %attr(755,root,root) %{_libdir}/tclrrd%{version}.so
480 %{_prefix}/lib/tclrrd%{version}
481 %endif