# Generated by go2rpm 1.8.0 %bcond_without check %global debug_package %{nil} %global shortname prometheus-blackbox-exporter # https://github.com/prometheus/blackbox_exporter %global goipath github.com/prometheus/blackbox_exporter # Version >=0.25.0 requires: # * golang-github-kit-log-devel >=0.2.1 # * golang-github-prometheus-client-devel >=1.19.0 Version: 0.24.0 %gometa -f %global common_description Prometheus exporter for probing network endpoints. %global golicenses LICENSE NOTICE %global godocs CHANGELOG.md CODE_OF_CONDUCT.md CONFIGURATION.md\\\ MAINTAINERS.md README.md SECURITY.md Name: %{goname} Release: %autorelease Summary: Prometheus blackbox prober exporter License: Apache-2.0 URL: %{gourl} Source0: %{gosource} Source1: %{shortname}.conf Source2: %{shortname}.service Source3: %{shortname}.sysusers # Required for <0.25.0 with >=golang-github-prometheus-common-devel-0.50.0 Patch0: prometheus-blackbox-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/blackbox_exporter %{goipath} %install %gopkginstall install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ mv %{buildroot}%{_bindir}/blackbox_exporter %{buildroot}%{_bindir}/%{shortname} install -Dpm 0644 blackbox.yml %{buildroot}%{_sysconfdir}/prometheus/blackbox.yml install -Dpm 0644 example.yml %{buildroot}%{_datadir}/prometheus/blackbox-exporter/example.yml 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 -d config -d prober %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} %config(noreplace) %{_sysconfdir}/prometheus/blackbox.yml %doc CHANGELOG.md CODE_OF_CONDUCT.md CONFIGURATION.md MAINTAINERS.md README.md %doc SECURITY.md %license LICENSE NOTICE %{_bindir}/%{shortname} %{_datadir}/prometheus/blackbox-exporter/example.yml %{_sysusersdir}/%{shortname}.conf %{_unitdir}/%{shortname}.service %gopkgfiles %changelog %autochangelog