%define debug_package %{nil} Name: lsws-prometheus-exporter Version: 0.2.1 Release: 2%{?dist} Summary: LiteSpeed Prometheus Exporter License: GPL-3.0-or-later URL: https://github.com/litespeedtech/litespeed-prometheus-exporter Source0: %{url}/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: %{name}.service Source2: %{name}.env Source3: credential.conf.example BuildRequires: golang >= 1.21 BuildRequires: systemd-rpm-macros # Upstream pins the Go toolchain (go.mod requires go 1.25). Let the # toolchain auto-download a published patch release if the builder ships # an older compiler. %global gotoolchain go1.25.10 %description The LiteSpeed Prometheus Exporter is a specially designed Prometheus application and uses the LiteSpeed Enterprise or the OpenLiteSpeed Web Server controller to export Prometheus compatible data which can also be used by Grafana and other compatible applications. %prep %autosetup -n litespeed-prometheus-exporter-%{version} cp -p %{SOURCE3} . %build export CGO_ENABLED=0 export GOOS=linux # go.mod requires Go 1.25; let the toolchain auto-download a published patch # release when the builder ships an older compiler. Fedora's go.env defaults # (GOPROXY=direct, GOSUMDB=off) break the verified toolchain fetch, so point # at the module proxy and re-enable the checksum DB for this build. export GOTOOLCHAIN=%{gotoolchain} export GOPROXY=https://proxy.golang.org,direct export GOSUMDB=sum.golang.org go mod tidy go build -o %{name} -trimpath -ldflags \ "-w -s -X main.version=%{version} -X main.gitRepo=v%{version}" %install install -Dpm 0755 %{name} %{buildroot}%{_bindir}/%{name} install -Dpm 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service install -Dpm 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/%{name} %post %systemd_post %{name}.service %preun %systemd_preun %{name}.service %postun %systemd_postun_with_restart %{name}.service %files %license LICENSE %doc README.md credential.conf.example %{_bindir}/%{name} %{_unitdir}/%{name}.service %config(noreplace) %{_sysconfdir}/sysconfig/%{name} %changelog * Mon Jun 08 2026 Cody Robertson - 0.2.1-2 - Ship credential.conf.example: systemd LoadCredential drop-in that supplies the basic-auth password from a tmpfs credential instead of the command line * Mon Jun 08 2026 Cody Robertson - 0.2.1-1 - Update to upstream 0.2.1 - Drop bundled basic auth patch; upstream now provides --username/--password-file - Build from the tagged release archive with a pinned Go toolchain * Tue May 20 2025 Cody Robertson - 0.1.2-1 - Update from upstream * Wed Oct 04 2023 Cody Robertson - 0.0.1-3 - Update service file to use environment file * Tue Oct 03 2023 Cody Robertson - 0.0.1-2 - Add patch to support basic auth * Tue Oct 03 2023 Cody Robertson - 0.0.1-1 - Initial package