# Generated by go2rpm 1.8.0 %bcond_without check %global debug_package %{nil} %global shortname druggeri-nut-exporter # https://github.com/DRuggeri/nut_exporter %global goipath github.com/DRuggeri/nut_exporter Version: 3.1.1 %gometa -f %global common_description Network UPS Tools Prometheus Exporter. %global golicenses LICENSE %global godocs README.md Name: %{goname} Release: %autorelease Summary: Network UPS Tools Prometheus Exporter License: Apache-2.0 URL: %{gourl} Source0: %{gosource} Source1: %{shortname}.conf Source2: %{shortname}.service Source3: %{shortname}.sysusers # Required with >=golang-github-prometheus-common-devel-0.50.0 Patch0: druggeri-nut-exporter-new-version-collector-package.patch BuildRequires: systemd-rpm-macros Requires(pre): shadow-utils %description %{common_description} %gopkg %prep %goprep %autopatch -p1 %generate_buildrequires %go_generate_buildrequires %build %gobuild -o %{gobuilddir}/bin/nut_exporter %{goipath} %install %gopkginstall install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ mv %{buildroot}%{_bindir}/nut_exporter %{buildroot}%{_bindir}/%{shortname} install -Dpm 0644 %{S:1} %{buildroot}%{_sysconfdir}/default/%{shortname} install -Dpm 0644 %{S:2} %{buildroot}%{_unitdir}/%{shortname}.service install -Dpm 0644 %{S:3} %{buildroot}%{_sysusersdir}/%{shortname}.conf %if %{with check} %check %gocheck %endif %pre %sysusers_create_compat %{S:3} %post %systemd_post %{shortname}.service %preun %systemd_preun %{shortname}.service %postun %systemd_postun_with_restart %{shortname}.service %files %config(noreplace) %{_sysconfdir}/default/%{shortname} %doc README.md %license LICENSE %{_bindir}/%{shortname} %{_sysusersdir}/%{shortname}.conf %{_unitdir}/%{shortname}.service %gopkgfiles %changelog %autochangelog