Name: prometheus Version: 3.5.0 Release: %autorelease Summary: The Prometheus monitoring server License: Apache-2.0 URL: https://github.com/prometheus/prometheus Source0: https://github.com/prometheus/prometheus/archive/refs/tags/v%{version}.tar.gz Source1: %{name}.service Source2: %{name}.sysusers Source3: %{name}.conf Source4: %{name}-tmpfiles.conf Source5: %{name}-service.preset ExclusiveArch: x86_64 aarch64 BuildRequires: golang >= 1.23.0 BuildRequires: git BuildRequires: make BuildRequires: nodejs BuildRequires: nodejs-npm BuildRequires: systemd-rpm-macros BuildRequires: typescript BuildRequires: yamllint BuildRequires: yarnpkg %{?systemd_requires} %{?sysusers_requires_compat} %description %{summary}. %package promtool Summary: Tooling for the Prometheus monitoring system %description promtool %{summary}. %prep %setup -q -n prometheus-%{version} %build #https://gitlab.archlinux.org/archlinux/packaging/packages/prometheus/-/blob/main/PKGBUILD pushd web/ui GOOS= GOARCH= go generate -x -v popd make ui-install make assets make npm_licenses make assets-compress go generate -tags plugins ./plugins RPM_LD_FLAGS="-extldflags '%{build_ldflags}' \ -X github.com/prometheus/common/version.Version=%{version} \ -X github.com/prometheus/common/version.Revision=%{version} \ -X github.com/prometheus/common/version.Branch=tarball \ -X github.com/prometheus/common/version.BuildUser=pgdev@fedora-copr \ -X github.com/prometheus/common/version.BuildDate=$(date -u '+%%Y%%m%%d-%%H:%%M:%%S' --date=@${SOURCE_DATE_EPOCH})" go build \ -buildmode=pie \ -mod=readonly \ -modcacherw \ -ldflags "-compressdwarf=false -linkmode external $RPM_LD_FLAGS" \ ./cmd/prometheus go build \ -buildmode=pie \ -mod=readonly \ -modcacherw \ -ldflags "-compressdwarf=false -linkmode external $RPM_LD_FLAGS" \ ./cmd/promtool %install install --mode=0755 -D prometheus %{buildroot}%{_bindir}/prometheus install --mode=0755 -D promtool %{buildroot}%{_bindir}/promtool install --directory %{buildroot}%{_datadir}/prometheus/web/ui cp --recursive web/ui/static %{buildroot}%{_datadir}/prometheus/web/ui/ install --mode=0640 -D documentation/examples/prometheus.yml %{buildroot}%{_sysconfdir}/sysconfig/prometheus/prometheus.yml install --mode=0640 -D %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/prometheus/prometheus install --directory %{buildroot}%{_docdir}/prometheus/examples cp --recursive documentation/examples/prometheus*.yml %{buildroot}%{_docdir}/prometheus/examples/ install --mode=0644 -D %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service install --mode=0644 -D %{SOURCE2} %{buildroot}%{_sysusersdir}/%{name}.conf install --mode=0644 -D %{SOURCE4} %{buildroot}%{_exec_prefix}/lib/tmpfiles.d/prometheus.conf install --mode=0644 -D %{SOURCE5} %{buildroot}%{_prefix}/lib/systemd/system-preset/90-prometheus.preset %files %license LICENSE %{_bindir}/prometheus %{_datadir}/prometheus/web/ui %attr(640,root,prometheus) %config %{_sysconfdir}/sysconfig/prometheus/prometheus.yml %attr(640,root,prometheus) %config %{_sysconfdir}/sysconfig/prometheus/prometheus %{_docdir}/prometheus/examples %{_unitdir}/%{name}.service %{_sysusersdir}/%{name}.conf %{_exec_prefix}/lib/tmpfiles.d/prometheus.conf %{_prefix}/lib/systemd/system-preset/90-prometheus.preset %files promtool %license LICENSE %{_bindir}/promtool %pre %sysusers_create_compat %{SOURCE1} %post %systemd_post prometheus.service %preun %systemd_preun prometheus.service %postun %systemd_postun prometheus.service %changelog %autochangelog