|
| 1 | +%global debug_package %{nil} |
| 2 | + |
| 3 | +Name: prometheus3 |
| 4 | +Version: 3.4.0 |
| 5 | +Release: 1%{?dist} |
| 6 | +Summary: The Prometheus monitoring system and time series database. |
| 7 | +License: ASL 2.0 |
| 8 | +URL: https://prometheus.io |
| 9 | +Provides: prometheus |
| 10 | + |
| 11 | +Source0: https://github.com/prometheus/prometheus/releases/download/v%{version}/prometheus-%{version}.linux-amd64.tar.gz |
| 12 | +Source1: %{name}.service |
| 13 | +Source2: %{name}.default |
| 14 | + |
| 15 | +%{?systemd_requires} |
| 16 | +%if 0%{?fedora} >= 19 |
| 17 | +BuildRequires: systemd-rpm-macros |
| 18 | +%endif |
| 19 | +Requires(pre): shadow-utils |
| 20 | + |
| 21 | +%description |
| 22 | + |
| 23 | +Prometheus is a systems and service monitoring system. It collects metrics from |
| 24 | +configured targets at given intervals, evaluates rule expressions, displays the |
| 25 | +results, and can trigger alerts if some condition is observed to be true. |
| 26 | + |
| 27 | +%prep |
| 28 | +%setup -q -n prometheus-%{version}.linux-amd64 |
| 29 | + |
| 30 | +%build |
| 31 | +/bin/true |
| 32 | + |
| 33 | +%install |
| 34 | +mkdir -vp %{buildroot}%{_sharedstatedir}/prometheus |
| 35 | +install -D -m 755 prometheus %{buildroot}%{_bindir}/prometheus |
| 36 | +install -D -m 755 promtool %{buildroot}%{_bindir}/promtool |
| 37 | +install -D -m 644 prometheus.yml %{buildroot}%{_sysconfdir}/prometheus/prometheus.yml |
| 38 | +install -D -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/prometheus.service |
| 39 | +install -D -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/default/prometheus |
| 40 | + |
| 41 | +%pre |
| 42 | +getent group prometheus >/dev/null || groupadd -r prometheus |
| 43 | +getent passwd prometheus >/dev/null || \ |
| 44 | + useradd -r -g prometheus -d %{_sharedstatedir}/prometheus -s /sbin/nologin \ |
| 45 | + -c "Prometheus services" prometheus |
| 46 | +exit 0 |
| 47 | + |
| 48 | +%post |
| 49 | +%systemd_post prometheus.service |
| 50 | + |
| 51 | +%preun |
| 52 | +%systemd_preun prometheus.service |
| 53 | + |
| 54 | +%postun |
| 55 | +%systemd_postun prometheus.service |
| 56 | + |
| 57 | +%files |
| 58 | +%defattr(-,root,root,-) |
| 59 | +%{_bindir}/prometheus |
| 60 | +%{_bindir}/promtool |
| 61 | +%config(noreplace) %{_sysconfdir}/prometheus/prometheus.yml |
| 62 | +%{_unitdir}/prometheus.service |
| 63 | +%config(noreplace) %{_sysconfdir}/default/prometheus |
| 64 | +%dir %attr(755, prometheus, prometheus)%{_sharedstatedir}/prometheus |
0 commit comments