2018-02-12 14:24:13 +01:00
|
|
|
#
|
|
|
|
# spec file for package telegraf
|
|
|
|
#
|
2019-09-09 12:00:07 +02:00
|
|
|
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
2018-02-12 14:24:13 +01:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2019-09-09 12:00:07 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2018-02-12 14:24:13 +01:00
|
|
|
#
|
|
|
|
|
2019-09-09 12:00:07 +02:00
|
|
|
|
2018-02-12 14:24:13 +01:00
|
|
|
Name: telegraf
|
2019-09-09 12:00:07 +02:00
|
|
|
Version: 1.12.0
|
2019-03-27 10:18:32 +01:00
|
|
|
Release: 0
|
2018-02-12 14:24:13 +01:00
|
|
|
Summary: The plugin-driven server agent for collecting & reporting metrics
|
2019-09-09 12:00:07 +02:00
|
|
|
License: MIT
|
2018-02-12 14:24:13 +01:00
|
|
|
Group: System/Monitoring
|
2019-09-09 12:00:07 +02:00
|
|
|
Url: https://github.com/influxdata/telegraf
|
2018-02-12 14:24:13 +01:00
|
|
|
Source: %{name}-%{version}.tar.gz
|
2019-09-09 12:00:07 +02:00
|
|
|
# run dep ensure --vendor-only (in a container)
|
2019-03-27 10:18:32 +01:00
|
|
|
Source1: %{name}-deps.tar.xz
|
2018-02-12 14:24:13 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2019-09-09 12:00:07 +02:00
|
|
|
BuildRequires: git-core
|
2018-02-12 14:24:13 +01:00
|
|
|
BuildRequires: go >= 1.7
|
|
|
|
BuildRequires: golang-packaging
|
2019-03-27 18:46:38 +01:00
|
|
|
BuildRequires: systemd-rpm-macros
|
|
|
|
%{?systemd_ordering}
|
2018-02-12 14:24:13 +01:00
|
|
|
|
|
|
|
## Features ##
|
|
|
|
|
2019-03-27 10:18:32 +01:00
|
|
|
Patch0: 0001-Generic-SQL-output-plugin-for-Telegraf.patch
|
2018-02-12 14:24:13 +01:00
|
|
|
|
|
|
|
## /Features ##
|
|
|
|
|
2019-03-27 10:18:32 +01:00
|
|
|
%define _influxdata_dir %{_builddir}/src/github.com/influxdata
|
|
|
|
%define _telegraf_dir %{_influxdata_dir}/%{name}
|
2018-02-12 14:24:13 +01:00
|
|
|
%define _config_dir %{_sysconfdir}/%{name}
|
|
|
|
|
|
|
|
%description
|
|
|
|
Telegraf is an agent written in Go for collecting, processing, aggregating, and writing metrics.
|
|
|
|
|
|
|
|
%prep
|
2019-03-27 10:18:32 +01:00
|
|
|
mkdir -p %{_influxdata_dir}
|
|
|
|
tar -C %{_influxdata_dir} -xzf %{SOURCE0}
|
|
|
|
cd %{_influxdata_dir}
|
|
|
|
# If there is allready telegraf then remove it
|
|
|
|
rm -rf %{name}
|
|
|
|
ln -sf %{name}-%{version} %{name}
|
|
|
|
cd %{name}
|
2019-09-09 12:00:07 +02:00
|
|
|
tar -xJf %{SOURCE1}
|
2019-03-27 10:18:32 +01:00
|
|
|
%patch0 -p1
|
2018-02-12 14:24:13 +01:00
|
|
|
|
|
|
|
%build
|
2019-09-09 12:00:07 +02:00
|
|
|
%ifnarch ppc64 ppc64le
|
2019-03-01 08:50:25 +01:00
|
|
|
export LDFLAGS="-buildmode=pie"
|
2019-09-09 12:00:07 +02:00
|
|
|
%endif
|
|
|
|
export GOPATH="%{_builddir}:$GOPATH"
|
2018-02-12 14:24:13 +01:00
|
|
|
cd %{_telegraf_dir}
|
|
|
|
make %{name}
|
|
|
|
|
|
|
|
%install
|
|
|
|
mkdir -p %{buildroot}%{_bindir}
|
|
|
|
install -m755 %{_telegraf_dir}/%{name} %{buildroot}%{_bindir}/%{name}
|
|
|
|
|
|
|
|
mkdir -p %{buildroot}/%{_config_dir}
|
|
|
|
install -m644 %{_telegraf_dir}/etc/%{name}.conf %{buildroot}/%{_config_dir}
|
|
|
|
|
2019-03-01 08:50:25 +01:00
|
|
|
install -D -m 644 %{_telegraf_dir}/scripts/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
|
|
|
|
sed -i '/User=/d' %{buildroot}%{_unitdir}/%{name}.service
|
|
|
|
mkdir -p %{buildroot}%{_sbindir}
|
|
|
|
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rc%{name}
|
|
|
|
|
|
|
|
%pre
|
|
|
|
%service_add_pre %{name}.service
|
|
|
|
|
|
|
|
%post
|
|
|
|
%service_add_post %{name}.service
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%service_del_preun %{name}.service
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%service_del_postun %{name}.service
|
|
|
|
|
2018-02-12 14:24:13 +01:00
|
|
|
%files
|
2019-03-01 08:50:25 +01:00
|
|
|
%{_sbindir}/rc%{name}
|
|
|
|
%{_unitdir}/%{name}.service
|
2018-02-12 14:24:13 +01:00
|
|
|
%doc src/github.com/influxdata/%{name}/CHANGELOG.md
|
|
|
|
%doc src/github.com/influxdata/%{name}/CONTRIBUTING.md
|
|
|
|
%license src/github.com/influxdata/%{name}/LICENSE
|
|
|
|
%doc src/github.com/influxdata/%{name}/README.md
|
|
|
|
%dir %{_config_dir}
|
2019-09-18 13:56:40 +02:00
|
|
|
%config(noreplace) %{_config_dir}/%{name}.conf
|
2018-02-12 14:24:13 +01:00
|
|
|
%{_bindir}/%{name}
|
|
|
|
|
|
|
|
%changelog
|