Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:infrastructure:monitoring
prometheus-wireguard_exporter
prometheus-wireguard_exporter.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File prometheus-wireguard_exporter.spec of Package prometheus-wireguard_exporter
# # spec file for package prometheus-wireguard_exporter # # Copyright (c) 2024 SUSE LLC # Copyright (c) 2024 Georg Pfuetzenreuter <mail+rpm@georg-pfuetzenreuter.net> # # 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 name3 wireguard_exporter %define name2 prometheus_%{name3} Name: prometheus-wireguard_exporter Version: 3.6.6 Release: 0 Summary: Prometheus exporter for WireGuard License: MIT Group: System/Monitoring URL: https://github.com/MindFlavor/prometheus_wireguard_exporter Source0: %{name2}-%{version}.tar.zst Source1: vendor.tar.zst Source2: %{name}.sysuser Source3: %{name}.service Source4: %{name}.sysconfig Source5: %{name}.apparmor BuildRequires: apparmor-rpm-macros BuildRequires: cargo-packaging BuildRequires: sysuser-tools Recommends: sudo %systemd_ordering %description A Prometheus exporter for WireGuard, written in Rust. This tool exports the "wg show all dump" (or "wg show <interface> dump" if you specify a config file) results in a format that Prometheus can understand. %prep %autosetup -a 1 -n %{name2}-%{version} # generate annotated sysconfig file awk -F\| '/\| `PROMETHEUS/{ gsub("`", "") gsub(" ", "", $3); print "## Description: " $8 "\n## Choices: " $5 "\n## Default: " $6 "\n#" $3 "=\n" }' README.md > sysconfig-stage test $(wc -l < sysconfig-stage) == 40 || exit 1 # assert expected result to notice changes on updates cat %{SOURCE4} sysconfig-stage > sysconfig %build %{cargo_build} %sysusers_generate_pre %{SOURCE2} %{name} %{name}-user.conf %install %{cargo_install} install -vdm 0755 %{buildroot}%{_fillupdir} %{buildroot}%{_sbindir} %{buildroot}%{_sysconfdir}/apparmor.d %{buildroot}%{_sysusersdir} %{buildroot}%{_unitdir} # rename for consistency with other exporters, move to sbin because it requires root privileges (or very lenient capabilities) mv %{buildroot}%{_bindir}/%{name2} %{buildroot}%{_sbindir}/%{name3} install -vm 0644 %{SOURCE2} %{buildroot}%{_sysusersdir} install -vm 0644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}.service install -vm 0644 sysconfig %{buildroot}%{_fillupdir}/sysconfig.%{name} install -vm 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/apparmor.d/%{name} ln -sv %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name} %check %{cargo_test} %pre -f %{name}.pre %service_add_pre %{name}.service %post %{apparmor_reload %{_sysconfdir}/apparmor.d/%{name}} %{fillup_only -n %{name}} %service_add_post %{name}.service %preun %service_del_preun %{name}.service %postun %service_del_postun %{name}.service %files %license LICENSE %doc README.md %{_sbindir}/%{name3} %{_sbindir}/rc%{name} %{_fillupdir}/sysconfig.%{name} %{_sysusersdir}/%{name}.sysuser %{_unitdir}/%{name}.service %dir %{_sysconfdir}/apparmor.d %config %{_sysconfdir}/apparmor.d/%{name} %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor