# Disable debug rpm on EPEL/CentOS Stream %global debug_package %{nil} # https://github.com/QubitProducts/exporter_exporter %global goipath github.com/QubitProducts/exporter_exporter Version: 0.5.0 %gometa %global common_description %{expand: This provides a simple reverse proxy for prometheus exporters. It is intended as a single binary alternative to nginx/apache for use in environments where opening multiple TCP ports to all servers might be difficult (technically or politically) The advantages are: * A single port can be used to query multiple exporters (to ease firewall configuration concerns). * Can provide TLS with optional client certificate authentication. * Provides verification that the target is serving prometheus metrics. * Can be used to execute scripts that produce prometheus metrics. * up behaviour is the same as for querying individual collectors. * Small code size, minimal external depedencies, easily auditable.} %global golicenses LICENSE Name: exporter-exporter Release: 2%{?dist} Summary: A reverse proxy designed for Prometheus exporters URL: %{gourl} License: Apache-2.0 Source0: %{gosource} Source1: exporter-exporter.service Source2: expexp.yml Source3: exporter-exporter.conf Requires(post): systemd Requires(preun): systemd Requires(postun): systemd BuildRequires: systemd-rpm-macros %description %{common_description} #%%gopkg %prep %autosetup -n exporter_exporter-%{version} %build go mod vendor CGO_ENABLED=0 go build -buildmode pie -compiler gc '-tags=rpm_crashtraceback' -ldflags '-X %{goipath}/version=%{version} -compressdwarf=false -s -w' -o %{gobuilddir}/bin/%{name} %{goipath} %install install -D -p -m 0755 %{gobuilddir}/bin/%{name} %{buildroot}%{_bindir}/%{name} install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/expexp.yml install -D -p -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/%{name} mkdir -p %{buildroot}%{_sysconfdir}/expexp.d # Systemd mkdir -p %{buildroot}%{_unitdir} install -m 0644 %{SOURCE1} %{buildroot}%{_unitdir} %post -e %systemd_post %{name}.service %preun %systemd_preun %{name}.service %postun %systemd_postun_with_restart %{name}.service %files %license LICENSE %doc README.md %{_bindir}/%{name} %{_unitdir}/%{name}.service %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/expexp.yml %dir %{_sysconfdir}/expexp.d/ %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/%{name}