## START: Set by rpmautospec ## (rpmautospec version 0.6.0) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 4; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # Generated by go2rpm 1.10.0 %bcond_without check %global shortname prometheus-node-exporter # https://github.com/prometheus/node_exporter %global goipath github.com/prometheus/node_exporter Version: 1.7.0 %gometa -L -f # Remove in F42: %global godevelheader %{expand: Obsoletes: golang-github-prometheus-node-exporter-devel < 1.6.1-2 } %global common_description %{expand: Prometheus exporter for hardware and OS metrics exposed by *NIX kernels, written in Go with pluggable metric collectors.} %global golicenses LICENSE NOTICE %global godocs docs examples CHANGELOG.md CODE_OF_CONDUCT.md\\\ CONTRIBUTING.md MAINTAINERS.md SECURITY.md README.md Name: node-exporter Release: %autorelease Summary: Exporter for machine metrics License: Apache-2.0 URL: %{gourl} Source: %{gosource} Source: %{shortname}.sysusers Source: %{shortname}.service Source: %{shortname}.conf Source: %{shortname}.logrotate Source: %{shortname}-tmpfiles.conf # Replace defaults paths for config files Patch: defaults-paths.patch BuildRequires: systemd-rpm-macros Requires(pre): shadow-utils Obsoletes: golang-github-prometheus-node-exporter < 1.6.1-2 Provides: node_exporter %description %{common_description} %gopkg %prep %goprep %autopatch -p1 # Don't build runit collector rm -rf collector/runit.go %generate_buildrequires %go_generate_buildrequires %build export BUILDTAGS="netgo osusergo static_build" export LDFLAGS="-X github.com/prometheus/common/version.Version=%{version} \ -X github.com/prometheus/common/version.Revision=%{release} \ -X github.com/prometheus/common/version.Branch=tarball \ -X github.com/prometheus/common/version.BuildDate=$(date -u -d@$SOURCE_DATE_EPOCH +%%Y%%m%%d)" %gobuild -o %{gobuilddir}/bin/node_exporter %{goipath} %install %gopkginstall install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ mv %{buildroot}%{_bindir}/node_exporter %{buildroot}%{_bindir}/%{shortname} pushd %{buildroot}%{_bindir} ln -s %{shortname} node_exporter popd install -Dpm0644 %{S:1} %{buildroot}%{_sysusersdir}/%{shortname}.conf install -Dpm0644 %{S:2} %{buildroot}%{_unitdir}/%{shortname}.service pushd %{buildroot}%{_unitdir} ln -s %{shortname}.service node_exporter.service popd install -Dpm0644 %{S:3} %{buildroot}%{_sysconfdir}/default/%{shortname} install -Dpm0644 example-rules.yml %{buildroot}%{_datadir}/prometheus/node-exporter/example-rules.yml install -Dpm0644 %{S:4} %{buildroot}%{_sysconfdir}/logrotate.d/%{shortname} mkdir -vp %{buildroot}%{_sharedstatedir}/prometheus/node-exporter # Install tmpfiles.d definition mkdir -p %{buildroot}%{_tmpfilesdir} install -m 0644 %{S:5} %{buildroot}%{_tmpfilesdir}/%{name}.conf # Build man pages. mkdir -vp %{buildroot}/%{_mandir}/man1/ %{buildroot}%{_bindir}/%{shortname} --help-man > \ %{buildroot}/%{_mandir}/man1/%{shortname}.1 sed -i '/^ /d; /^.SH "NAME"/,+1c.SH "NAME"\nprometheus-node-exporter \\- The Prometheus Node-Exporter' \ %{buildroot}/%{_mandir}/man1/%{shortname}.1 %if %{with check} %check %gocheck -d collector %endif %pre %sysusers_create_compat %{SOURCE1} %post %systemd_post %{shortname}.service %preun %systemd_preun %{shortname}.service %postun %systemd_postun_with_restart %{shortname}.service %files %license LICENSE NOTICE %doc docs examples CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md %doc MAINTAINERS.md SECURITY.md README.md %{_bindir}/* %config(noreplace) %{_sysconfdir}/default/%{shortname} %config(noreplace) %{_sysconfdir}/logrotate.d/%{shortname} %{_sysusersdir}/%{shortname}.conf %{_unitdir}/%{shortname}.service %{_unitdir}/node_exporter.service %{_mandir}/man1/%{shortname}.1* %{_datadir}/prometheus/node-exporter/example-rules.yml %dir %attr(0755,prometheus,prometheus) %{_sharedstatedir}/prometheus %dir %attr(0755,prometheus,prometheus) %{_sharedstatedir}/prometheus/node-exporter %{_tmpfilesdir}/%{name}.conf %gopkgfiles %changelog ## START: Generated by rpmautospec * Sun Feb 11 2024 Maxwell G - 1.7.0-4 - Rebuild for golang 1.22.0 * Thu Jan 25 2024 Fedora Release Engineering - 1.7.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Sun Jan 21 2024 Fedora Release Engineering - 1.7.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Sat Jan 13 2024 Mikel Olasagasti Uranga - 1.7.0-1 - Update to 1.7.0 - Closes rhbz#2250145 rhbz#2258169 * Sat Jan 13 2024 Mikel Olasagasti Uranga - 1.6.1-2 - Add tmpfiles definition - Closes rhbz#2258169 * Sat Jan 13 2024 Mikel Olasagasti Uranga - 1.6.1-1 - Initial package, rename from golang-github-prometheus-node-exporter - Closes rhbz#2250145 ## END: Generated by rpmautospec