## 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.10.0 %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 MIT-0 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-clsx) = 2.1.1 Provides: bundled(nodejs-codemirror-autocomplete) = 6.19.1 Provides: bundled(nodejs-codemirror-language) = 6.11.3 Provides: bundled(nodejs-codemirror-lint) = 6.9.2 Provides: bundled(nodejs-codemirror-state) = 6.5.2 Provides: bundled(nodejs-codemirror-view) = 6.38.6 Provides: bundled(nodejs-dayjs) = 1.11.19 Provides: bundled(nodejs-floating-ui-dom) = 1.7.4 Provides: bundled(nodejs-highlight.js) = 11.11.1 Provides: bundled(nodejs-lezer-common) = 1.3.0 Provides: bundled(nodejs-lezer-highlight) = 1.2.3 Provides: bundled(nodejs-lodash) = 4.17.21 Provides: bundled(nodejs-mantine-code-highlight) = 8.3.6 Provides: bundled(nodejs-mantine-core) = 8.3.6 Provides: bundled(nodejs-mantine-dates) = 8.3.6 Provides: bundled(nodejs-mantine-hooks) = 8.3.6 Provides: bundled(nodejs-mantine-notifications) = 8.3.6 Provides: bundled(nodejs-microsoft-fetch-event-source) = 2.0.1 Provides: bundled(nodejs-nexucis-fuzzy) = 0.5.1 Provides: bundled(nodejs-nexucis-kvsearch) = 0.9.1 Provides: bundled(nodejs-prometheus-io-codemirror-promql) = 0.309.1 Provides: bundled(nodejs-react) = 19.2.0 Provides: bundled(nodejs-react-dom) = 19.2.0 Provides: bundled(nodejs-react-infinite-scroll-component) = 6.1.0 Provides: bundled(nodejs-react-redux) = 9.2.0 Provides: bundled(nodejs-react-router-dom) = 7.9.5 Provides: bundled(nodejs-reduxjs-toolkit) = 2.10.1 Provides: bundled(nodejs-sanitize-html) = 2.17.0 Provides: bundled(nodejs-tabler-icons-react) = 3.35.0 Provides: bundled(nodejs-tanstack-react-query) = 5.90.7 Provides: bundled(nodejs-testing-library-jest-dom) = 6.9.1 Provides: bundled(nodejs-testing-library-react) = 16.3.0 Provides: bundled(nodejs-types-lodash) = 4.17.20 Provides: bundled(nodejs-types-sanitize-html) = 2.16.0 Provides: bundled(nodejs-uiw-react-codemirror) = 4.25.3 Provides: bundled(nodejs-uplot) = 1.6.32 Provides: bundled(nodejs-uplot-react) = 1.2.4 Provides: bundled(nodejs-use-query-params) = 2.2.1 Provides: npm(prometheus-io-mantine-ui) = 0.309.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.BuildUser=Fedora \ -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 * Thu Feb 26 2026 Mikel Olasagasti Uranga - 3.10.0-1 - Update to 3.10.0 - 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