Files
telegraf/telegraf.spec
Jeff Kowalczyk ee12bd96e3 - Update to version 1.32.3:
* Telegraf v1.32.3
  * Update changelog for v1.32.3
  * Update build_version.txt for v1.32.3
  * chore: Make docs
  * fix(inputs.snmp_trap): Remove timeout deprecation (#16145)
  * fix(inputs.netflow): Cast TCP ports to uint16 (#16197)
  * fix(common.socket): Use read buffer size config setting as a datagram reader buffer size (#16156)
  * chore: Update go to v1.23.3 (#16180)
  * chore: Fix linter findings for `revive:exported` in `plugins/inputs/m*` (#16191)
  * chore: Enable `revive:enforce-repeated-arg-type-style` rule (#16182)
  * chore(deps): Bump github.com/rclone/rclone from 1.67.0 to 1.68.1 (#16178)
  * chore: Enable `testifylint:go-require` checker (#16158)
  * chore: Enable `revive:enforce-slice-style` rule (#16173)
  * fix(agent): Restore setup order of stateful plugins to Init() then SetState() (#16123)
  * chore(deps): Bump golangci-lint from v1.61.0 to v1.62.0 (#16172)
  * chore(deps): Bump github.com/tidwall/gjson from 1.17.1 to 1.18.0 (#16174)
  * chore(deps): Bump golang.org/x/text from 0.19.0 to 0.20.0 (#16177)
  * chore(deps): Bump github.com/aws/aws-sdk-go-v2/credentials from 1.17.37 to 1.17.44 (#16175)
  * chore(deps): Bump github.com/sijms/go-ora/v2 from 2.8.19 to 2.8.22 (#16176)
  * chore: Fix linter findings for `revive:exported` in `plugins/inputs/l*` (#16167)
  * chore(parsers.prometheus): Do not warn about unknown format without headers (#16166)
  * fix(inputs.gnmi): Register connection statistics before creating client (#16171)
  * chore: Fix linter findings for `revive:enforce-slice-style` in `plugins/inputs/[a-d]*` and `plugins/common` (#16161)
  * chore(processors.regex): Change logging severity to debug (#16151)
  * fix(inputs.snmp): Fix crash when trying to format fields from unknown OIDs (#16155)
  * chore(outputs.influxdb_v2): Cleanup code and tests (#16147)
  * docs(specs): Add specification for partial-write errors (#16034)
  * chore(deps): Bump github.com/vmware/govmomi from 0.39.0 to 0.45.1 (#16135)
  * chore(deps): Bump github.com/golang-jwt/jwt/v4 from 4.5.0 to 4.5.1 (#16136)

OBS-URL: https://build.opensuse.org/package/show/devel:languages:go/telegraf?expand=0&rev=95
2024-11-18 21:40:14 +00:00

92 lines
2.6 KiB
RPMSpec

#
# spec file for package telegraf
#
# Copyright (c) 2024 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%define _config_dir %{_sysconfdir}/%{name}
Name: telegraf
Version: 1.32.3
Release: 0
Summary: The plugin-driven server agent for collecting & reporting metrics
License: MIT
Group: System/Monitoring
URL: https://github.com/influxdata/telegraf
Source: %{name}-%{version}.tar.xz
Source1: vendor.tar.xz
Patch0: harden_telegraf.service.patch
BuildRequires: git-core
BuildRequires: golang-packaging
BuildRequires: systemd-rpm-macros
BuildRequires: golang(API) >= 1.22
%{?systemd_ordering}
%description
Telegraf is an agent written in Go for collecting, processing, aggregating, and writing metrics.
Design goals are to have a minimal memory footprint with a plugin system so that developers in the community can
easily add support for collecting metrics from local or remote services.
%prep
%setup -q
%setup -q -T -D -a 1
%patch -P 0 -p1
%build
# Build the binary.
go build \
-mod=vendor \
%ifnarch ppc64 ppc64le
-buildmode=pie \
%endif
./cmd/telegraf;
./telegraf config > etc/telegraf.conf
%install
# Install the binary.
install -D -m 0755 %{name} "%{buildroot}/%{_bindir}/%{name}"
mkdir -p %{buildroot}/%{_config_dir}
mkdir -p %{buildroot}/%{_config_dir}/%{name}.d
install -m644 etc/%{name}.conf %{buildroot}/%{_config_dir}
install -D -m 644 scripts/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
sed -i '/User=/d' %{buildroot}%{_unitdir}/%{name}.service
mkdir -p %{buildroot}%{_sbindir}
ln -s %{_sbindir}/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
%files
%{_sbindir}/rc%{name}
%{_unitdir}/%{name}.service
%doc CHANGELOG.md CONTRIBUTING.md README.md
%license LICENSE
%dir %{_config_dir}
%config(noreplace) %{_config_dir}/%{name}.conf
%{_bindir}/%{name}
%changelog