File tempo.spec of Package tempo

#
# spec file for package tempo
#
# 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/
#

%global services tempo.target tempo.service tempo@.service

Name:           tempo
Version:        2.9.0
Release:        0
Summary:        A high volume, minimal dependency distributed tracing backend
License:        AGPL-3.0
URL:            https://grafana.com/oss/tempo/
Source0:        %{name}-%{version}.tar.zst
Source2:        tempo.conf
Source1:        config.yml
Source3:        tempo@.service
Source4:        tempo.target
Patch1:         pie.patch
BuildRequires:  golang-packaging
BuildRequires:  zstd
BuildRequires:  go >= 1.25.1
BuildRequires:  pkgconfig(systemd)
BuildRequires:  sysuser-shadow
BuildRequires:  sysuser-tools
%{?systemd_ordering}
%{?sysusers_requires}
%description
Grafana Tempo is an open source, easy-to-use and high-scale distributed tracing
backend. Tempo is cost-efficient, requiring only object storage to operate, and
is deeply integrated with Grafana, Prometheus, and Loki.

Tempo is Jaeger, Zipkin, Kafka, OpenCensus and OpenTelemetry compatible. It
ingests batches in any of the mentioned formats, buffers them and then writes
them to Azure, GCS, S3 or local disk. As such, it is robust, cheap and easy to
operate!

Tempo implements TraceQL, a traces-first query language inspired by LogQL and
PromQL. This query language allows users to very precisely and easily select
spans and jump directly to the spans fulfilling the specified conditions

%prep
%autosetup -p1

%build
make VERSION=%{version} GIT_BRANCH=main GIT_REVISION=v%{version} tempo-query tempo-cli tempo tempo-vulture
%sysusers_generate_pre %{SOURCE2} %{name}                        %{name}.conf

%install
install -D -m 0644 -t %{buildroot}%{_unitdir}/ tools/packaging/tempo.service %{SOURCE3} %{SOURCE4}
install -D -m 0644 -t %{buildroot}%{_sysusersdir}/ %{SOURCE2}
install -D -m 0755 -t %{buildroot}%{_bindir}/ bin/linux/*
install -D -m 0750 -d %{buildroot}/var/lib/tempo %{buildroot}%{_sysconfdir}/tempo
install -D -m 0640 %{SOURCE1} %{buildroot}%{_sysconfdir}/tempo/config.yml

%check
bin/linux/tempo --version

%pre -f %{name}.pre
%service_add_pre %{services}

%preun
%service_del_preun %{services}

%post
%service_add_post %{services}

%postun
%service_del_postun %{services}

%files
%license LICENSE LICENSING.md
%doc ADOPTERS.md CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md GOVERNANCE.md MAINTAINERS.md README.md RELEASES.MD SECURITY.md WORKFLOW.md
%config(noreplace) %attr(-,root,tempo) %{_sysconfdir}/tempo
%{_unitdir}/tempo.service
%{_unitdir}/tempo@.service
%{_unitdir}/tempo.target
%{_sysusersdir}/%{name}.conf
%{_bindir}/tempo
%{_bindir}/tempo-cli
%{_bindir}/tempo-query
%{_bindir}/tempo-vulture
%dir %attr(-,tempo,tempo) /var/lib/tempo

%changelog
openSUSE Build Service is sponsored by