# Generated by go2rpm 1.3 %bcond_without check # https://github.com/prometheus/node_exporter %global goipath github.com/prometheus/node_exporter Version: 1.1.1 %gometa %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: %{goname} Release: 1%{?dist} Summary: Exporter for machine metrics # Upstream license specification: Apache-2.0 License: ASL 2.0 and MIT URL: %{gourl} Source0: %{gosource} Source1: node_exporter.conf BuildRequires: systemd-rpm-macros BuildRequires: golang(github.com/beevik/ntp) BuildRequires: golang(github.com/coreos/go-systemd/dbus) BuildRequires: golang(github.com/ema/qdisc) BuildRequires: golang(github.com/go-kit/kit/log) BuildRequires: golang(github.com/go-kit/kit/log/level) BuildRequires: golang(github.com/godbus/dbus) BuildRequires: golang(github.com/hodgesds/perf-utils) BuildRequires: golang(github.com/jsimonetti/rtnetlink) BuildRequires: golang(github.com/mattn/go-xmlrpc) BuildRequires: golang(github.com/mdlayher/wifi) BuildRequires: golang(github.com/prometheus/client_golang/prometheus) BuildRequires: golang(github.com/prometheus/client_golang/prometheus/promhttp) BuildRequires: golang(github.com/prometheus/client_model/go) BuildRequires: golang(github.com/prometheus/common/expfmt) BuildRequires: golang(github.com/prometheus/common/promlog) BuildRequires: golang(github.com/prometheus/common/promlog/flag) BuildRequires: golang(github.com/prometheus/common/version) BuildRequires: golang(github.com/prometheus/exporter-toolkit/web) BuildRequires: golang(github.com/prometheus/procfs) BuildRequires: golang(github.com/prometheus/procfs/bcache) BuildRequires: golang(github.com/prometheus/procfs/btrfs) BuildRequires: golang(github.com/prometheus/procfs/nfs) BuildRequires: golang(github.com/prometheus/procfs/sysfs) BuildRequires: golang(github.com/prometheus/procfs/xfs) BuildRequires: golang(github.com/soundcloud/go-runit/runit) BuildRequires: golang(golang.org/x/sys/unix) BuildRequires: golang(gopkg.in/alecthomas/kingpin.v2) %description %{common_description} %gopkg %prep %goprep %build export BUILDTAGS="netgo osusergo static_build" %gobuild -o %{gobuilddir}/bin/node_exporter %{goipath} %install %gopkginstall install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ install -m 0755 -vd %{buildroot}%{_sysusersdir} install -m 0644 -vp %{SOURCE1} %{buildroot}%{_sysusersdir}/ install -m 0755 -vd %{buildroot}%{_sysconfdir} install -m 0755 -vd %{buildroot}%{_sysconfdir}/systemd install -m 0755 -vd %{buildroot}%{_sysconfdir}/systemd/system install -m 0644 -vp examples/systemd/node_exporter.service %{buildroot}%{_sysconfdir}/systemd/system/ install -m 0755 -vd %{buildroot}%{_sysconfdir} install -m 0755 -vd %{buildroot}%{_sysconfdir}/sysconfig install -m 0644 -vp examples/systemd/sysconfig.node_exporter %{buildroot}%{_sysconfdir}/sysconfig/node_exporter mkdir -p %{buildroot}%{_sharedstatedir}/node_exporter mkdir -p %{buildroot}%{_sharedstatedir}/node_exporter/textfile_collector %if %{with check} %check %gocheck -d collector %endif %pre %sysusers_create_package node_exporter %{SOURCE1} %post %systemd_post node_exporter.service %preun %systemd_preun node_exporter.service %postun %systemd_postun_with_restart node_exporter.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}/sysconfig/node_exporter %config(noreplace) %{_sysconfdir}/systemd/system/node_exporter.service %{_sysusersdir}/node_exporter.conf %attr(0755,node_exporter,node_exporter) %{_sharedstatedir}/node_exporter %gopkgfiles %changelog * Wed Feb 17 22:48:22 CET 2021 Robert-André Mauchin - 1.1.1-1 - Initial package