+# TODO:
+# - SysV init script for rrdcached, post/postun/etc.
#
# Conditional build:
-%bcond_without python # Python binding
-#
-%include /usr/lib/rpm/macros.perl
+%bcond_without lua # LUA binding
+%bcond_without perl # Perl binding
+%bcond_without python # Python binding
+%bcond_without ruby # Ruby binding
+%bcond_without tcl # Tcl binding
+%bcond_without ceph # Ceph (RADOS) storage support
+%bcond_without rrd_graph # all rrd_graph functions (depend on cairo+pango)
+%bcond_without rrdcgi # building of rrdcgi (depends on rrd_graph)
+
+%if %{without rrd_graph}
+%undefine with_rrdcgi
+%endif
+
%define pdir RRDp
Summary: RRDtool - round robin database
Summary(pl.UTF-8): RRDtool - baza danych typu round-robin
Summary(ru.UTF-8): RRDtool - база данных с "циклическим обновлением"
Summary(uk.UTF-8): RRDtool - це система зберігання та показу серійних даних
Name: rrdtool
-Version: 1.3.8
-Release: 2
+Version: 1.7.2
+Release: 3
License: GPL v2+ + FLOSS exception
Group: Applications/Databases
-Source0: http://oss.oetiker.ch/rrdtool/pub/%{name}-%{version}.tar.gz
-# Source0-md5: 0de79494ab969cebfbfae3d237de18fe
+Source0: https://oss.oetiker.ch/rrdtool/pub/%{name}-%{version}.tar.gz
+# Source0-md5: 638e3a0a1609d97e9f82e8832759dcd2
Patch0: %{name}-tcl-path.patch
-Patch1: autoconf264.patch
+Patch1: %{name}-missing.patch
+Patch2: %{name}-build.patch
URL: http://oss.oetiker.ch/rrdtool/
-BuildRequires: autoconf >= 2.59
+BuildRequires: autoconf >= 2.60
BuildRequires: automake
-BuildRequires: cairo-devel
-BuildRequires: gettext-devel
-BuildRequires: intltool
-BuildRequires: libpng-devel >= 2:1.2.8
+%{?with_ceph:BuildRequires: ceph-devel}
+BuildRequires: gettext-tools >= 0.18
+BuildRequires: glib2-devel >= 1:2.28.7
+BuildRequires: groff
+BuildRequires: libdbi-devel
BuildRequires: libtool
-BuildRequires: libxml2-devel
-BuildRequires: pango-devel
-BuildRequires: perl-devel >= 1:5.8.0
+BuildRequires: libwrap-devel
+BuildRequires: libxml2-devel >= 1:2.7.8
BuildRequires: pkgconfig
-%if %{with python}
-BuildRequires: python
-BuildRequires: python-devel
+BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.745
+%if %{with rrd_graph}
+BuildRequires: glib2-devel >= 1:2.58.1
+BuildRequires: libpng-devel >= 2:1.4.8
+BuildRequires: pango-devel >= 1:1.28.7
+%endif
+%if %{with lua}
+BuildRequires: lua51 >= 5.1
+BuildRequires: lua51-devel >= 5.1
%endif
+%if %{with perl}
+BuildRequires: perl-devel >= 1:5.8.0
BuildRequires: rpm-perlprov
-BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.272
+%endif
+%if %{with python}
+BuildRequires: python >= 1:2.3
+BuildRequires: python-devel >= 1:2.3
+%endif
+%if %{with ruby}
+BuildRequires: rpm-rubyprov
BuildRequires: ruby-devel
+%endif
+%if %{with tcl}
BuildRequires: tcl-devel
-BuildRequires: zlib-devel >= 1.2.1
-Requires: libpng >= 1.2.8
-Requires: zlib >= 1.2.1
+%endif
+%if %{with rrd_graph}
+Requires: glib2 >= 1:2.58.1
+%else
+Requires: glib2 >= 1:2.28.7
+%endif
+%{?with_rrd_graph:Requires: libpng >= 2:1.4.8}
+Requires: libxml2 >= 1:2.7.8
+%{?with_rrd_graph:Requires: pango >= 1:1.28.7}
Suggests: fonts-TTF-DejaVu
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
sieci, temperatura w pomieszczeniu, obciążenie serwera). Składuje dane
w "skondensowanej" postaci, która nie rozrasta się z biegiem czasu
oraz pozwala na produkowanie wykresów z użytecznymi danymi. Może być
-używane poprzez prosty skrypcik (shell lub perl), frontendy czy inne
+używane poprzez prosty skrypcik (shell lub Perl), frontendy czy inne
interfejsy użytkownika.
%description -l pt_BR.UTF-8
сохраняет данные в очень компактной форме, так что данные не будут
занимать все больше и больше места с течением времени и предоставляет
разумное графическое представление информации. Может быть использована
-как из простых скриптов (shell, perl, etc) или встроена в программы,
+как из простых скриптов (shell, Perl, etc) или встроена в программы,
которые опрашивают сетевые устройства и показывают данные в удобном
для пользователя виде.
прості wrapper-скрипти, так і через фронтенди, що опитують мережеві
пристрої та надають дружній інтерфейс користувача.
+%package cached
+Summary: Data caching daemon for RRDtool
+Summary(pl.UTF-8): Demon pamięci podręcznej danych dla RRDtoola
+Group: Daemons
+Requires: %{name} = %{version}-%{release}
+
+%description cached
+Data caching daemon for RRDtool.
+
+%description cached -l pl.UTF-8
+Demon pamięci podręcznej danych dla RRDtoola.
+
%package devel
Summary: RRDtool development
Summary(pl.UTF-8): Narzędzia programistyczne pakietu RRDtool
Summary(uk.UTF-8): RRDtool - бібліотечні лінки та файли хедерів
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
-Requires: cgilibc-devel >= 0.5
-Requires: libpng-devel >= 2:1.2.8
-Requires: zlib-devel >= 1.2.1
+%if %{with rrd_graph}
+Requires: glib2-devel >= 1:2.58.1
+%else
+Requires: glib2-devel >= 1:2.28.7
+%endif
+Requires: libdbi-devel
+Requires: libwrap-devel
+Requires: libxml2-devel >= 1:2.7.8
+%{?with_rrd_graph:Requires: pango-devel >= 1:1.28.7}
%description devel
RRDtool development files.
%description static -l uk.UTF-8
Статичні бібліотеки для розробки програм, що використовують RRDtool.
+%package doc
+Summary: RRDtool documentation
+Summary(pl.UTF-8): Dokumentacja do RRDtoola
+Group: Documentation
+BuildArch: noarch
+
+%description doc
+RRD is the Acronym for Round Robin Database. RRD is a system to store
+and display time-series data (i.e. network bandwidth, machine-room
+temperature, server load average).
+
+This package contains documentation on using RRD.
+
+%description doc -l pl.UTF-8
+RRD jest akronimem Round Robin Database. Jest to system pozwalający na
+składowanie i wyświetlanie czasowych serii danych (np. przepustowość
+sieci, temperatura w pomieszczeniu, obciążenie serwera).
+
+Ten pakiet zawiera dokumentację użytkownika dla RRD.
+
+%package -n lua-rrdtool
+Summary: RRD module for Lua
+Summary(pl.UTF-8): Moduł RRD dla języka Lua
+Group: Development/Languages
+Requires: %{name} = %{version}-%{release}
+Requires: lua51
+
+%description -n lua-rrdtool
+Lua interface to RRDtool.
+
+%description -n lua-rrdtool -l pl.UTF-8
+Interfejs języka Lua do RRDtoola.
+
%package -n perl-rrdtool
Summary: Access RRDtool from Perl
Summary(pl.UTF-8): Dostęp do RRDtoola z poziomu Perla
Summary(pl.UTF-8): Pythonowy interfejs do RRDtoola
Group: Development/Languages/Python
Requires: %{name} = %{version}-%{release}
-%pyrequires_eq python-libs
+Requires: python-libs
%description -n python-rrdtool
Python interface to RRDtool, the graphing and logging utility.
Summary(pl.UTF-8): Interfejs języka Ruby do RRDtoola
Group: Development/Languages/Python
Requires: %{name} = %{version}-%{release}
-%{?ruby_mod_ver_requires_eq}
%description -n ruby-rrdtool
Ruby interface to RRDtool, the graphing and logging utility.
%setup -q
%patch0 -p1
%patch1 -p1
+%patch2 -p1
-sed -i -e 's#\$TCL_PACKAGE_PATH#%{_prefix}/lib#g' configure.ac
+%{__sed} -i -e 's#\$TCL_PACKAGE_PATH#%{_prefix}/lib#g' configure.ac
+%{__sed} -i -e 's#/lib/lua/#/%{_lib}/lua/#g' configure.ac
+
+%{__sed} -E -i -e '1s,#!\s*/usr/bin/python(\s|$),#!%{__python}\1,' \
+ examples/stripes.py
+
+%{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+tclsh@TCL_VERSION@(\s|$),#!%{__tclsh}\1,' \
+ bindings/tcl/ifOctets.tcl.in
+
+# We only want .txt and .html files for the main documentation
+install -d docs/{html,/txt}
+%{__mv} doc/*.txt docs/txt
+%{__mv} doc/*.html docs/html
+
+# Put Perl docs in Perl package
+install -d perl-docs/html
+%{__mv} docs/html/RRD*.html perl-docs/html
%build
%{__libtoolize}
-%{__aclocal}
+%{__aclocal} -I m4
%{__autoconf}
%{__autoheader}
%{__automake}
%configure \
+ LUA=/usr/bin/lua5.1 \
+ --disable-silent-rules \
+ %{!?with_ceph:--disable-librados} \
+ %{!?with_rrd_graph:--disable-rrd_graph} \
+ %{!?with_rrdcgi:--disable-rrdcgi} \
+ %{!?with_lua:--disable-lua} \
+ %{!?with_perl:--disable-perl} \
+ %{!?with_python:--disable-python} \
+ %{!?with_ruby:--disable-ruby} \
+ %{!?with_tcl:--disable-tcl} \
--with-perl-options="INSTALLDIRS=vendor"
# empty RUBY_MAKE_OPTIONS as workaround for some make weirdness
# (tried to install without DESTDIR on plain make)
%{__make} \
- RUBY_MAKE_OPTIONS=
+ RUBY_MAKE_OPTIONS= \
+ LUA_CFLAGS=-I/usr/include/lua51
%install
rm -rf $RPM_BUILD_ROOT
examplesdir=%{_examplesdir}/%{name}-%{version} \
RUBYARCHDIR=$RPM_BUILD_ROOT%{ruby_archdir}
-rm -rf $RPM_BUILD_ROOT%{_prefix}/{doc,html}
-rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/ntmake.pl
-rm -f $RPM_BUILD_ROOT%{perl_vendorarch}/auto/RRDs/.packlist
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/librrd.la
+%{__rm} -r $RPM_BUILD_ROOT%{_docdir}
+
+%if %{with lua}
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/lua/5.1/*.{la,a}
+%endif
+
+%if %{with perl}
+%{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/auto/RRDs/.packlist
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc CHANGES CONTRIBUTORS NEWS README THREADS TODO doc/*.html
-%attr(755,root,root) %{_bindir}/rrd*
+%doc CHANGES CONTRIBUTORS COPYRIGHT NEWS THREADS TODO
%attr(755,root,root) %{_libdir}/librrd.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/librrd.so.4
-%attr(755,root,root) %{_libdir}/librrd_th.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/librrd_th.so.4
+%attr(755,root,root) %ghost %{_libdir}/librrd.so.8
+%{?with_rrdcgi:%attr(755,root,root) %{_bindir}/rrdcgi}
+%attr(755,root,root) %{_bindir}/rrdcreate
+%attr(755,root,root) %{_bindir}/rrdinfo
+%attr(755,root,root) %{_bindir}/rrdtool
+%attr(755,root,root) %{_bindir}/rrdupdate
%{_mandir}/man1/bin_dec_hex.1*
%{_mandir}/man1/cdeftutorial.1*
%{_mandir}/man1/rpntutorial.1*
-%{_mandir}/man1/rrd*.1*
+%{_mandir}/man1/rrd-beginners.1*
+%{_mandir}/man1/rrd_pdpcalc.1*
+%{_mandir}/man1/rrdbuild.1*
+%{?with_rrdcgi:%{_mandir}/man1/rrdcgi.1*}
+%{_mandir}/man1/rrdcreate.1*
+%{_mandir}/man1/rrddump.1*
+%{_mandir}/man1/rrdfetch.1*
+%{_mandir}/man1/rrdfirst.1*
+%{_mandir}/man1/rrdgraph*.1*
+%{_mandir}/man1/rrdinfo.1*
+%{_mandir}/man1/rrdlast.1*
+%{_mandir}/man1/rrdlastupdate.1*
+%{_mandir}/man1/rrdlist.1*
+%{?with_ceph:%{_mandir}/man1/rrdrados.1*}
+%{_mandir}/man1/rrdresize.1*
+%{_mandir}/man1/rrdrestore.1*
+%{_mandir}/man1/rrdthreads.1*
+%{_mandir}/man1/rrdtool.1*
+%{_mandir}/man1/rrdtune.1*
+%{_mandir}/man1/rrdtutorial.1*
+%{_mandir}/man1/rrdupdate.1*
+%{_mandir}/man1/rrdxport.1*
+
+%files cached
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/rrdcached
+%{_mandir}/man1/rrdcached.1*
+%{_mandir}/man1/rrdflushcached.1*
+%{systemdunitdir}/rrdcached.service
+%{systemdunitdir}/rrdcached.socket
%files devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/librrd.so
-%attr(755,root,root) %{_libdir}/librrd_th.so
-%{_libdir}/librrd.la
-%{_libdir}/librrd_th.la
%{_includedir}/rrd*.h
-%{_pkgconfigdir}/*.pc
-%{_examplesdir}/%{name}-%{version}
+%{_pkgconfigdir}/librrd.pc
+%{_mandir}/man3/librrd.3*
%files static
%defattr(644,root,root,755)
%{_libdir}/librrd.a
-%{_libdir}/librrd_th.a
+%files doc
+%defattr(644,root,root,755)
+%doc docs/html docs/txt
+%{_examplesdir}/%{name}-%{version}
+
+%if %{with lua}
+%files -n lua-rrdtool
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/lua/5.1/rrd.so*
+%{_mandir}/man1/rrdlua.1*
+%endif
+
+%if %{with perl}
%files -n perl-rrdtool
%defattr(644,root,root,755)
+%doc perl-docs/html/*
%{perl_vendorlib}/RRDp.pm
%{perl_vendorarch}/RRDs.pm
%dir %{perl_vendorarch}/auto/RRDs
-%{perl_vendorarch}/auto/RRDs/RRDs.bs
%attr(755,root,root) %{perl_vendorarch}/auto/RRDs/RRDs.so
%{_mandir}/man3/RRDp.3*
%{_mandir}/man3/RRDs.3*
+%endif
%if %{with python}
%files -n python-rrdtool
%defattr(644,root,root,755)
-%attr(755,root,root) %{py_sitedir}/rrdtoolmodule.so
+%attr(755,root,root) %{py_sitedir}/rrdtool.so
%if "%{py_ver}" > "2.4"
-%{py_sitedir}/py_rrdtool-*.egg-info
+%{py_sitedir}/rrdtool-*.egg-info
%endif
%endif
+%if %{with ruby}
%files -n ruby-rrdtool
%defattr(644,root,root,755)
%attr(755,root,root) %{ruby_archdir}/RRD.so
+%endif
+%if %{with tcl}
%files -n tcl-rrdtool
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/tclrrd%{version}.so
%{_prefix}/lib/tclrrd%{version}
+%endif