## START: Set by rpmautospec ## (rpmautospec version 0.8.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # Generated by go2rpm 1.19.0 %bcond check 1 # https://github.com/prometheus/prometheus %global goipath github.com/prometheus/prometheus Version: 3.9.1 %gometa -L -f Name: prometheus Release: %autorelease Summary: Prometheus monitoring system and time series database # Generated by go-vendor-tools License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 URL: %{gourl} Source0: %{gosource} # Generated by go-vendor-tools Source1: %{archivename}-vendor.tar.bz2 Source2: go-vendor-tools.toml Source3: %{name}.service Source4: %{name}.sysusers Source5: %{name}.yml Source6: %{name}.conf Source7: %{name}.logrotate Source8: README.consoles Source20: https://github.com/prometheus/prometheus/releases/download/v%{version}/prometheus-web-ui-%{version}.tar.gz # Debian patch for default settings Patch: 0001-Add-default-settings-adapted-for-Debian.patch # Fix for a goleak test Patch: 0001-Use-full-path-for-Fedora.patch BuildRequires: go-vendor-tools BuildRequires: systemd-rpm-macros Requires(pre): shadow-utils Provides: bundled(nodejs-bootstrap) = 4.6.2 Provides: bundled(nodejs-codemirror-autocomplete) = 6.17.0 Provides: bundled(nodejs-codemirror-commands) = 6.6.0 Provides: bundled(nodejs-codemirror-language) = 6.10.2 Provides: bundled(nodejs-codemirror-lint) = 6.8.1 Provides: bundled(nodejs-codemirror-search) = 6.5.6 Provides: bundled(nodejs-codemirror-state) = 6.3.3 Provides: bundled(nodejs-codemirror-view) = 6.29.1 Provides: bundled(nodejs-css.escape) = 1.5.1 Provides: bundled(nodejs-downshift) = 9.0.6 Provides: bundled(nodejs-forevolve-bootstrap-dark) = 4.0.2 Provides: bundled(nodejs-fortawesome-fontawesome-svg-core) = 6.5.2 Provides: bundled(nodejs-fortawesome-free-solid-svg-icons) = 6.5.2 Provides: bundled(nodejs-fortawesome-react-fontawesome) = 0.2.0 Provides: bundled(nodejs-fsevents) = 2.3.3 Provides: bundled(nodejs-http-proxy-middleware) = 3.0.0 Provides: bundled(nodejs-jquery) = 3.7.1 Provides: bundled(nodejs-jquery.flot.tooltip) = 0.9.0 Provides: bundled(nodejs-lezer-common) = 1.2.1 Provides: bundled(nodejs-lezer-highlight) = 1.2.0 Provides: bundled(nodejs-lezer-lr) = 1.4.2 Provides: bundled(nodejs-moment) = 2.30.1 Provides: bundled(nodejs-moment-timezone) = 0.5.45 Provides: bundled(nodejs-nexucis-fuzzy) = 0.4.1 Provides: bundled(nodejs-nexucis-kvsearch) = 0.8.1 Provides: bundled(nodejs-popper.js) = 1.14.3 Provides: bundled(nodejs-prometheus-io-codemirror-promql) = 0.55.1 Provides: bundled(nodejs-react) = 17.0.2 Provides: bundled(nodejs-react-copy-to-clipboard) = 5.1.0 Provides: bundled(nodejs-react-dom) = 17.0.2 Provides: bundled(nodejs-react-infinite-scroll-component) = 6.1.0 Provides: bundled(nodejs-react-resize-detector) = 7.1.2 Provides: bundled(nodejs-react-router-dom) = 5.3.4 Provides: bundled(nodejs-reactstrap) = 8.10.1 Provides: bundled(nodejs-react-test-renderer) = 17.0.2 Provides: bundled(nodejs-sanitize-html) = 2.13.0 Provides: bundled(nodejs-sass) = 1.77.6 Provides: bundled(nodejs-tempusdominus-bootstrap-4) = 5.39.2 Provides: bundled(nodejs-tempusdominus-core) = 5.19.3 Provides: npm(prometheus-io) = 0.55.1 Provides: npm(prometheus-io-app) = 0.55.1 Obsoletes: golang-github-prometheus < 2.55.1-8 %description The Prometheus monitoring system and time series database. %prep %goprep -p1 %setup -q -T -D -a1 -a20 %{forgesetupargs} tar -xf %{S:1} # copy pre-generated web/ui static content and compress it # required to create EmbedFS cp -r static/ web/ui/ rm -rf static sh scripts/compress_assets.sh %generate_buildrequires %go_vendor_license_buildrequires -c %{S:2} %build %global gomodulesmode GO111MODULE=on export BUILDTAGS="netgo builtinassets" # PREBUILT_ASSETS_STATIC_DIR is used starting v3.0 export PREBUILT_ASSETS_STATIC_DIR=web/ui/static export LDFLAGS="-X github.com/prometheus/common/version.Version=%{version} \ -X github.com/prometheus/common/version.Revision=%{release} \ -X github.com/prometheus/common/version.Branch=tarball \ -X github.com/prometheus/common/version.BuildDate=$(date -u -d@$SOURCE_DATE_EPOCH +%%Y%%m%%d)" for cmd in cmd/* ; do %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd done %install %go_vendor_license_install -c %{S:2} install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ install -Dpm0644 %{S:4} %{buildroot}%{_sysusersdir}/%{name}.conf install -Dpm0644 %{S:3} %{buildroot}%{_unitdir}/%{name}.service install -Dpm0644 %{S:6} %{buildroot}%{_sysconfdir}/default/%{name} install -Dpm0644 %{S:5} %{buildroot}%{_sysconfdir}/prometheus/prometheus.yml install -Dpm0644 %{S:7} %{buildroot}%{_sysconfdir}/logrotate.d/prometheus mkdir -vp %{buildroot}%{_sysconfdir}/prometheus/consoles install -Dpm0644 %{S:8} %{buildroot}%{_sysconfdir}/prometheus/consoles/README.consoles mkdir -vp %{buildroot}%{_sysconfdir}/prometheus/console_libraries install -Dpm0644 %{S:8} %{buildroot}%{_sysconfdir}/prometheus/console_libraries/README.consoles mkdir -vp %{buildroot}%{_sharedstatedir}/prometheus # Build man pages. mkdir -vp %{buildroot}/%{_mandir}/man1/ %{buildroot}%{_bindir}/%{name} --help-man > \ %{buildroot}/%{_mandir}/man1/%{name}.1 %{buildroot}%{_bindir}/promtool --help-man > \ %{buildroot}/%{_mandir}/man1/promtool.1 sed -i '/^ /d; /^.SH "NAME"/,+1c.SH "NAME"\nprometheus \\- The Prometheus monitoring server' \ %{buildroot}/%{_mandir}/man1/%{name}.1 sed -i '/^ /d; /^.SH "NAME"/,+1c.SH "NAME"\npromtool \\- Tooling for the Prometheus monitoring system' \ %{buildroot}/%{_mandir}/man1/promtool.1 # Workaround to fix ppc64le's unknown race condition. # There are other solutions like not using the same binary but that means copying the binary to a different place. This is simpler. # Message error in logs looks like: # debugedit: Failed to open input file '/builddir/build/BUILD/prometheus-3.9.1-build/BUILDROOT/usr/bin/promtool': Text file busy sleep 1 %pre %sysusers_create_compat %{SOURCE4} %post %systemd_post %{name}.service %preun %systemd_preun %{name}.service %postun %systemd_postun_with_restart %{name}.service %check %go_vendor_license_check -c %{S:2} %if %{with check} # TestDocumentation & TestAutoReloadConfig* fail due to defaults-paths.patch as # it changes the path of the default configuration file for test in "TestDocumentation" "TestAutoReloadConfig_ValidToValid" "TestAutoReloadConfig_ValidToInvalidToValid" \ "TestInvalidFileUpdate" "TestUpdateFileWithPartialWrites" "TestShutdown" \ ; do awk -i inplace '/^func.*'"$test"'\(/ { print; print "\tt.Skip(\"disabled failing test\")"; next}1' $(grep -rl $test) done %gocheck2 -t github.com/prometheus/prometheus/discovery/azure -t documentation/examples/remote_storage -t internal -t web %endif %files -f %{go_vendor_license_filelist} %doc docs CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md MAINTAINERS.md %doc README.md RELEASE.md SECURITY.md discovery/README.md %{_bindir}/prometheus %{_bindir}/promtool %dir %{_sysconfdir}/prometheus/ %dir %{_sysconfdir}/prometheus/consoles %dir %{_sysconfdir}/prometheus/console_libraries %config(noreplace) %{_sysconfdir}/prometheus/prometheus.yml %config(noreplace) %{_sysconfdir}/default/%{name} %config(noreplace) %{_sysconfdir}/logrotate.d/prometheus %{_sysconfdir}/prometheus/consoles/README.consoles %{_sysconfdir}/prometheus/console_libraries/README.consoles %{_mandir}/man1/%{name}.1* %{_mandir}/man1/promtool.1* %{_unitdir}/prometheus.service %{_sysusersdir}/prometheus.conf %dir %attr(0755,prometheus,prometheus) %{_sharedstatedir}/prometheus %changelog ## START: Generated by rpmautospec * Wed Feb 25 2026 Mikel Olasagasti Uranga - 3.9.1-1 - Update to 3.9.1 - Closes rhbz#2390501 * Mon Feb 23 2026 Mikel Olasagasti Uranga - 2.55.1-1 - Initial package after renaming from golang-github-prometheus - Closes rhbz#2383787 ## END: Generated by rpmautospec