rrdtool/rrdtool.spec

317 lines
9.7 KiB
RPMSpec
Raw Normal View History

#
# spec file for package rrdtool
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: rrdtool
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: cairo-devel
BuildRequires: freetype2-devel
BuildRequires: gettext-tools
BuildRequires: glib2-devel
BuildRequires: groff
BuildRequires: intltool
BuildRequires: libart_lgpl-devel
BuildRequires: libpng-devel
BuildRequires: libtool
BuildRequires: libxml2-devel
BuildRequires: lua51-devel
BuildRequires: pango-devel
BuildRequires: python-devel
BuildRequires: ruby-devel
BuildRequires: systemd
BuildRequires: tcl-devel
BuildRequires: tcpd-devel
Requires: perl = %{perl_version}
Version: 1.4.7
Release: 0
%define cgilib_version 0.7
Source: http://oss.oetiker.ch/rrdtool/pub/rrdtool-%{version}.tar.gz
Patch1: rrdtool-lua-ruby_lib64.patch
Patch2: rrdtool-tclversion.patch
Patch3: rrdtool-tclsegfault.patch
Source1: http://www.infodrom.org/projects/cgilib/download/cgilib-%{cgilib_version}.tar.gz
Patch11: cgilib-fix_automake.patch
Source2: sysconfig.rrdcached
Source4: rrdcached-systemd-pre
Source5: rrdcached.service
Url: http://oss.oetiker.ch/rrdtool/
Summary: A tool for data logging and analysis
License: GPL-2.0+
Group: Productivity/Scientific/Math
Requires: dejavu
Requires(pre): pwdutils
%description
A tool to log and analyze data gathered from all kinds of data sources.
The data analysis part of RRDtool is based on the ability to quickly
generate graphical representations of the data values collected over a
definable time period.
%package devel
Summary: A tool for data logging and analysis - Development files
Group: Development/Libraries/Other
Requires: %name = %version
%description devel
A tool to log and analyze data gathered from all kinds of data sources.
The data analysis part of RRDtool is based on the ability to quickly
generate graphical representations of the data values collected over a
definable time period.
%package -n python-rrdtool
Summary: Python bindings for rrdtool
Group: Productivity/Scientific/Math
Requires: %name = %version
%py_requires
%description -n python-rrdtool
A tool to log and analyze data gathered from all kinds of data sources.
The data analysis part of RRDtool is based on the ability to quickly
generate graphical representations of the data values collected over a
definable time period.
This package contains the Python bindings
%package -n lua-rrdtool
Summary: Lua bindings for rrdtool
Group: Productivity/Scientific/Math
Requires: %name = %version
%description -n lua-rrdtool
A tool to log and analyze data gathered from all kinds of data sources.
The data analysis part of RRDtool is based on the ability to quickly
generate graphical representations of the data values collected over a
definable time period.
This package contains the Lua bindings
%package -n ruby-rrdtool
Summary: Ruby bindings for rrdtool
Group: Productivity/Scientific/Math
Requires: ruby
%description -n ruby-rrdtool
A tool to log and analyze data gathered from all kinds of data sources.
The data analysis part of RRDtool is based on the ability to quickly
generate graphical representations of the data values collected over a
definable time period.
This package contains the Ruby bindings
%package -n tcl-rrdtool
Summary: Tcl bindings for rrdtool
Group: Productivity/Scientific/Math
Requires: tcl
%description -n tcl-rrdtool
A tool to log and analyze data gathered from all kinds of data sources.
The data analysis part of RRDtool is based on the ability to quickly
generate graphical representations of the data values collected over a
definable time period.
This package contains the Tcl bindings
%package cached
Summary: Data caching daemon for RRDtool
Group: Productivity/Scientific/Math
Requires: %{name} = %{version}
Requires(pre): %fillup_prereq
%{?systemd_requires}
%define rrdcached_user rrdcached
%define rrdcached_group rrdcached
%description cached
rrdcached is a daemon that receives updates to existing RRD files,
accumulates them and, if enough have been received or a defined time has
passed, writes the updates to the RRD file. The daemon was written with
big setups in mind which usually runs into I/O related problems. This
daemon was written to alleviate these problems.
%prep
%setup -q -a1
%if %{_lib}==lib64
%patch1
%endif
%patch2
%patch3
pushd "cgilib-%{cgilib_version}"
%patch11
popd #cgilib
%build
# first prepare cgilib
pushd cgilib-%{cgilib_version}
echo -n > NEWS
aclocal --force
autoreconf -fiv
CGILIB_CFLAGS="%{optflags} -fPIC -I."
CGILIB_CFLAGS="$CGILIB_CFLAGS -fexcess-precision=fast"
CFLAGS="$CGILIB_CFLAGS" \
%configure
make %{?jobs:-j %jobs}
%__mkdir_p ../lb/include
%__cp *.h ../lb/include/
%__mkdir_p ../lb/lib/
%__cp -a .libs/libcgi.so* ../lb/lib/
popd #cgilib
# build rrdtool
if [ ! -d m4 ]; then mkdir m4; fi
# we need getext 0.18
#autoreconf -i -f
export LDFLAGS="-L`pwd`/lb/lib" CPPFLAGS="-I`pwd`/lb/include" \
%configure --disable-static --with-pic --enable-shared \
--enable-tcl-site \
--with-tcllib=%{_libdir} \
--with-gnu-ld \
--enable-python \
--enable-ruby \
--enable-ruby-site-install \
--disable-rpath \
--with-rrd-default-font="monospace"
make %{?jobs:-j %jobs} V=1
%install
#eval `perl -V:installarchlib`
# Override hdrdir and rubyhdrdir to avoid makefile dependencies on
# installed ruby headers to be prefixed with %{buildroot}
make \
DESTDIR=$RPM_BUILD_ROOT \
idocdir=%{_docdir}/%{name}/txt/ \
ihtmldir=%{_docdir}/%{name}/html/ \
examplesdir=%{_docdir}/%{name}/examples/ \
libdir=%{_libdir} \
pkglibdir=%tcl_archdir/tclrrd%version \
install
# we install this later again
rm -r $RPM_BUILD_ROOT%{_prefix}/lib/perl
# do not install fonts (use system fonts instead)
rm -rf $RPM_BUILD_ROOT%_datadir/rrdtool/fonts
# install correctly perl modules
pushd bindings/perl-piped
perl Makefile.PL
make DESTDIR=$RPM_BUILD_ROOT install_vendor
popd
pushd bindings/perl-shared
perl Makefile.PL
make DESTDIR=$RPM_BUILD_ROOT install_vendor
popd
%perl_process_packlist
#fix build (it would be better to split cgilib)
#sed 's/[[:space:]]*-L\/usr\/src\/packages\/BUILD\/%{name}-%{version}\/lb\/lib[[:space:]]*/ /' $RPM_BUILD_ROOT/%{_libdir}/librrd.la > tmp
#mv tmp $RPM_BUILD_ROOT/%{_libdir}/librrd.la
#sed 's/[[:space:]]*-L\/usr\/src\/packages\/BUILD\/%{name}-%{version}\/lb\/lib[[:space:]]*/ /' $RPM_BUILD_ROOT/%{_libdir}/librrd_th.la > tmp
#mv tmp $RPM_BUILD_ROOT/%{_libdir}/librrd_th.la
find "%{buildroot}" -type f -name '*.la' -exec %__rm {} \;
# install ruby bindings
pushd bindings/ruby
make DESTDIR=%{buildroot} install
popd
# documentation
install -m 644 CHANGES CONTRIBUTORS COPYING COPYRIGHT README TODO $RPM_BUILD_ROOT/%{_docdir}/%{name}
pushd doc
mkdir txt
mkdir html
mv *.txt txt/
mv *.html html/
popd
rm examples/rrdcached/Makefile*
chmod -x examples/*
chmod +x examples/rrdcached
# install rrdcached specials
install -Dm644 %{SOURCE2} %{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.rrdcached
# install systemd specific files
install -Dm755 %{SOURCE4} %{buildroot}%{_datadir}/rrdcached/rrdcached-systemd-pre
install -Dm644 %{SOURCE5} %{buildroot}%{_unitdir}/rrdcached.service
mkdir -p %{buildroot}%{_localstatedir}/lib/rrdtool/rrdcached
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-, root, root)
%doc %{_docdir}/rrdtool
%doc %{_mandir}/*/*
%{_bindir}/*
%exclude %{_bindir}/rrdcached
%{_libdir}/librrd.so.*
%{_libdir}/librrd_th.so.*
%{perl_vendorlib}/RRDp.pm
%{perl_vendorarch}/RRDs.pm
#%{perl_vendorarch}/ntmake.pl
%{perl_vendorarch}/auto/*
#%{_datadir}/%{name}
%files devel
%defattr(-, root, root)
%{_includedir}/*
%{_libdir}/librrd_th.so
%{_libdir}/librrd.so
%{_libdir}/pkgconfig/librrd.pc
%files -n python-rrdtool
%defattr(-, root, root)
%{py_sitedir}/*
%files -n lua-rrdtool
%defattr(-, root, root)
%dir %{_libdir}/lua
%dir %{_libdir}/lua/*
%{_libdir}/lua/*/rrd.so
%{_libdir}/lua/*/rrd.so.*
%files -n tcl-rrdtool
%defattr(-, root, root)
%{tcl_archdir}/*
%{_libdir}/tclrrd*.so
#%{!?rb_sitearchdir: %define rb_sitearchdir %(ruby -rrbconfig -e 'puts RbConfig::CONFIG["sitearchdir"]')}
%files -n ruby-rrdtool
%defattr(-, root, root)
%{rb_sitearchdir}/RRD.so
%files cached
%defattr(-, root, root)
%{_bindir}/rrdcached
%{_localstatedir}/adm/fillup-templates/sysconfig.rrdcached
%dir %{_localstatedir}/lib/rrdtool
%attr(-,%rrdcached_user,%rrdcached_group) %dir %{_localstatedir}/lib/rrdtool/rrdcached
%{_datadir}/rrdcached
%{_datadir}/rrdcached/rrdcached-systemd-pre
%{_unitdir}/rrdcached.service
%pre cached
getent group %rrdcached_group >/dev/null || groupadd %rrdcached_group
getent passwd %rrdcached_user >/dev/null || useradd -s /sbin/nologin -g %rrdcached_group -c %rrdcached_user -d %{_localstatedir}/lib %rrdcached_user
%service_add_pre rrdcached.service
%post cached
%service_add_post rrdcached.service
%fillup_only rrdcached
%preun cached
%service_del_preun rrdcached.service
%postun cached
%service_del_postun rrdcached.service
%changelog