%global lbuildir %{_builddir}/%{name}-%{version}/%{name}-%{version}.linux-amd64 %global debug_package %{nil} Name: alertmanager Version: 0.15.2 Release: 1%{?dist} Summary: Prometheus Alertmanager. License: ASL 1.0 URL: https://prometheus.io/ Source0: https://github.com/prometheus/%{name}/releases/download/v%{version}/%{name}-%{version}.linux-amd64.tar.gz Source1: %{name}.service %{?systemd_requires} BuildRequires: systemd %description The Alertmanager handles alerts sent by client applications such as the Prometheus server. It takes care of deduplicating, grouping, and routing them to the correct receiver integrations such as email, PagerDuty, or OpsGenie. It also takes care of silencing and inhibition of alerts. %prep %setup -c -q %build %pre getent group %{name} >/dev/null || groupadd -r %{name} getent passwd %{name} >/dev/null || \ useradd -r -g %{name} -d /var/lib/%{name} -s /sbin/nologin \ -c "Prometheus Alertmanager" %{name} exit 0 %post %systemd_post %{name}.service %preun %systemd_preun %{name}.service %postun %systemd_postun_with_restart %{name}.service %install rm -rf %{buildroot} %{__mkdir_p} %{buildroot}/%{_sbindir} %{__install} -p %{lbuildir}/%{name} %{buildroot}/%{_sbindir}/ %{__install} -p %{lbuildir}/amtool %{buildroot}/%{_sbindir}/ %{__install} -p -D %{SOURCE1} %{buildroot}/%{_unitdir}/%{name}.service %{__install} -p -D %{lbuildir}/%{name}.yml %{buildroot}/%{_sysconfdir}/%{name}/%{name}.yml %{__mkdir_p} %{buildroot}/%{_usr}/share/%{name} %{__install} -p -D %{lbuildir}/{LICENSE,NOTICE} %{buildroot}/%{_usr}/share/%{name} %{__mkdir_p} %{buildroot}/%{_sysconfdir}/sysconfig %{__cat} < %{buildroot}/%{_sysconfdir}/sysconfig/%{name} OPTIONS='--config.file=%{_sysconfdir}/%{name}/%{name}.yml --storage.path=%{_sharedstatedir}/%{name}/data' EOF %{__mkdir_p} %{buildroot}/%{_sharedstatedir}/%{name} %files %defattr(644,%{name},%{name},755) %attr(755,-,-) /usr/sbin/%{name} %attr(755,-,-) /usr/sbin/amtool %{_usr}/share/%{name}/NOTICE %config %{_unitdir}/%{name}.service %config(noreplace) %{_sysconfdir}/%{name}/%{name}.yml %config(noreplace) %{_sysconfdir}/sysconfig/%{name} %license %{_usr}/share/%{name}/LICENSE %dir %{_sharedstatedir}/%{name} %changelog * Wed Oct 17 2018 Disk Stats - 0.15.2-1 - rebuilt