Initial package config

RESOLVES: RHEL-24050

Signed-off-by: Felix Kolwa <fkolwa@redhat.com>
This commit is contained in:
Felix Kolwa 2024-07-16 12:54:26 +02:00
parent 08b9b164e2
commit 63176a6e94
4 changed files with 114 additions and 0 deletions

1
.gitignore vendored
View File

@ -0,0 +1 @@
/opentelemetry-collector-0.102.1.tar.gz

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

@ -0,0 +1,106 @@
%global goipath github.com/os-observability/redhat-opentelemetry-collector
Version: 0.102.1
ExcludeArch: %{ix86} s390 ppc ppc64 aarch64
%gometa
%global common_description %{expand:
Collector with the supported components for a Red Hat build of OpenTelemetry}
%global golicenses LICENSE
%global godocs README.md
Name: opentelemetry-collector
Release: 1%{?dist}
Summary: Red Hat build of OpenTelemetry
License: Apache-2.0
Source0: opentelemetry-collector-0.102.1.tar.gz
BuildRequires: systemd
BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
BuildRequires: binutils
BuildRequires: git
Requires(pre): /usr/sbin/useradd, /usr/bin/getent
Requires(postun): /usr/sbin/userdel
%description
%{common_description}
%prep
mkdir -p _build
mkdir -p _build/bin
%setup -q -n redhat-opentelemetry-collector-0.102.1
%build
go build -v -buildmode pie -mod vendor -o %{gobuilddir}/bin/opentelemetry-collector
%define debug_package %{nil}
%install
# create expected directory layout
mkdir -p %{buildroot}%{_sysconfdir}/opentelemetry-collector
mkdir -p %{buildroot}%{_sysconfdir}/opentelemetry-collector/configs
mkdir -p %{buildroot}%{_unitdir}
# install files
install -p -m 0644 ./00-default-receivers.yaml %{buildroot}%{_sysconfdir}/opentelemetry-collector/configs/00-default-receivers.yaml
install -p -m 0644 ./opentelemetry-collector.service %{buildroot}%{_unitdir}/%{name}.service
install -m 0755 -vd %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
install -m 0755 -p ./opentelemetry-collector-with-options %{buildroot}%{_bindir}/
%pre
/usr/bin/getent group observability > /dev/null || /usr/sbin/groupadd -r observability
/usr/bin/getent passwd observability > /dev/null || /usr/sbin/useradd -r -M -s /sbin/nologin -g observability -G systemd-journal observability
%postun
/usr/sbin/userdel observability
%post
/bin/systemctl --system daemon-reload 2>&1
%preun
if [ $1 -eq 0 ]; then
/bin/systemctl --quiet stop %{name}.service
/bin/systemctl --quiet disable %{name}.service
fi
%posttrans
/bin/systemctl is-enabled %{name}.service >/dev/null 2>&1
if [ $? -eq 0 ]; then
/bin/systemctl restart %{name}.service >/dev/null
fi
%check
%gocheck
%files
%{_unitdir}/%{name}.service
%{_sysconfdir}/opentelemetry-collector/configs/00-default-receivers.yaml
%license %{golicenses}
%doc %{godocs}
%{_bindir}/*
%changelog
* Tue Jul 16 2024 Benedikt Bongartz <bongartz@redhat.com> - 0.102.1-1
- rpm: trim date (#89) (Ben B)
- Add transform processor (#88) (Ruben Vargas)
* Fri Jun 28 2024 Benedikt Bongartz <bongartz@redhat.com> - 0.102.1
- move microshift specifics into another rpm
- bump collector version to 0.102.0
* Fri Apr 12 2024 Benedikt Bongartz <bongartz@redhat.com> - 0.95.0
- add observability user that is part of the systemd-journal group
- add opentelemetry collector config folder (`/etc/opentelemetry-collector/configs`)
- add opentelemetry collector default config
- add microshift manifests
* Thu Feb 1 21:59:10 CET 2024 Nina Olear <nolear@redhat.com> - 0.93.4
- First package for Copr

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (opentelemetry-collector-0.102.1.tar.gz) = 0bad66a38ed7fecd38457191961bbf49075b0ffe4848b46ce56e967389046dfba8ada9a911535822078d90a4ddd2e0a32979f2554bddcf20727984d0fc5b2e03