Fetching contributors…
Cannot retrieve contributors at this time
99 lines (80 sloc) 2.83 KB
# Put the RPM in the current directory.
%define _rpmdir .
# Find the tarball produced by `make dist' in the current directory.
%define _sourcedir %(echo $PWD)
Version: %(echo @VERSION@ | sed 's/-/_/g')
Release: 1
Summary: A scalable, distributed Time Series Database
BuildArch: noarch
Group: Service/Monitoring
License: LGPLv2.1+
Source: @PACKAGE@-@VERSION@.tar.gz
Requires: gnuplot
# Disable the stupid stuff rpm distros include in the build process by
# default:
# Disable any prep shell actions. replace them with simply 'true'
%define __spec_prep_pre true
%define __spec_prep_post true
# Disable any build shell actions. replace them with simply 'true'
%define __spec_build_pre cd %{_builddir}
%define __spec_build_post true
# Disable any install shell actions. replace them with simply 'true'
%define __spec_install_pre cd %{_builddir}
%define __spec_install_post true
# Disable any clean shell actions. replace them with simply 'true'
%define __spec_clean_pre cd %{_builddir}
%define __spec_clean_post true
OpenTSDB is a distributed, scalable Time Series Database (TSDB) written on top
of HBase. OpenTSDB was written to address a common need: store, index and
serve metrics collected from computer systems (network gear, operating
systems, applications) at a large scale, and make this data easily accessible
and graphable.
Thanks to HBase's scalability, OpenTSDB allows you to collect many thousands
of metrics from thousands of hosts and applications, at a high rate (every few
seconds). OpenTSDB will never delete or downsample data and can easily store
billions of data points.
%setup -q -n @PACKAGE@-@VERSION@
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
mkdir -p %{buildroot}/var/cache/opentsdb
mkdir -p %{buildroot}%{_datarootdir}/opentsdb/plugins
# TODO: Use alternatives to manage the init script and configuration.
rm -rf %{buildroot}
%attr(0755,root,root) %{_bindir}/*
%attr(0755,root,root) %{_datarootdir}/opentsdb/bin/*.sh
%attr(0755,root,root) %{_datarootdir}/opentsdb/plugins
%attr(0755,root,root) %{_datarootdir}/opentsdb/tools/*
%attr(0755,root,root) %{_datarootdir}/opentsdb/etc/init.d/opentsdb
%config %{_datarootdir}/opentsdb/etc/opentsdb/opentsdb.conf
%config %{_datarootdir}/opentsdb/etc/opentsdb/logback.xml
%dir %{_localstatedir}/cache/opentsdb
if [ $1 -eq 1 ]; then
# we're installing the first version of this package
ln -s %{_datarootdir}/opentsdb/etc/opentsdb /etc/opentsdb
ln -s %{_datarootdir}/opentsdb/etc/init.d/opentsdb /etc/init.d/opentsdb
exit 0
if [ $1 -eq 0 ]; then
# we're removing last version of this package
rm -rf /etc/opentsdb
rm -rf /etc/init.d/opentsdb
exit 0