grafana/grafana.spec

164 lines
6.3 KiB
RPMSpec
Raw Normal View History

#
# spec file for package grafana
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir /var/adm/fillup-templates
%endif
Name: grafana
Accepting request 1094843 from home:mkittler:branches:server:monitoring - Update to version 10.0.1: * Security fixes - Fix authentication bypass using Azure AD OAuth (CVE-2023-3128, bsc#1212641) * Features and enhancements - Alerting: Update alerting module to 20230524181453-a8e75e4dfdda. - Schema: Improve Dashboard kind docs and remove deprecated props. * Bug fixes - Alerting: Fix notification policies inheritance algorithm. - CodeEditor: Ensure suggestions only apply to the instance of the edit…. - Plugins: Wrap original check health error. - Alerting: Add heuristics back to datasource healthchecks. - Alerting: Fix "show all instances". - Alerting: Fix broken UI because of query being optional for some ExpressionQuer…. - Alerting: Fix email template for text/plain emails. - Alerting: Fix provisioned templates being ignored by alertmanager. - Alerting: Support newer http_config struct. - Auth: Show invite button if disable login form is set to false. - Azure: Fix Kusto auto-completion for Azure datasources. - CloudMonitoring: Improve parsing of GCM labels. - Command Palette: Links opened in a new tab now route correctly when Grafana is served under a subpath. - Command palette: Include help links. - Dashboards: Remove Explore option from panel menu when panel's datasource uid is "-- Dashboard --". - Dashboards: Variables - Improve slow template variable loading due same variable loaded multiple times on time range change. - Explore: Fixed Starred query history tab to show all starred queries. - Explore: Improve logs volume panel empty state. - Explore: Run remaining queries when one is removed from a pane. - Heatmap: Sort fields by numeric names when single frame. - InfluxDB: Interpolate retention policies. - Log Context: Fix split view button using the wrong query. - Loki: Fix error when empty template variables response. - Loki: Fix including of template variables in variable query editor. - NestedFolders: Fix select all in folder view selecting items out of folder. - Pyroscope: Fix wrong defaults when importing query from different datasource. - SQLStore: Align SQLite IsUniqueConstraintViolation() with other backend implementations. - Templating: Fix updating of definition to empty string. - Tempo: Use pipe in TraceQL by default for multi-value variables. - TextPanel: Fix styling missing the disclosure triangle. - Util: Fix panic when generating UIDs concurrently. - XYChart/Trend: Fix min/max and units/decimals X field overrides. - XYChart: Fix formatting of axis ticks (units, decimals). - XYChart: Fix variable interpolation in datalinks/toggletip. - Update to version 10.0.0: * Breaking changes - Angular is deprecated and turned off by default for new Grafana Cloud stacks - Grafana legacy alerting is deprecated and no longer accepts internal or external contributions - API keys are migrating to service accounts - The experimental “dashboard previews” feature is removed - Usernames are now case-insensitive by default - Grafana OAuth integrations do not work anymore with email lookups - The “Alias” field in the CloudWatch data source is removed - Athena data source plugin must be updated to version >=2.9.3 - Redshift data source plugin must be updated to version >=1.8.3 - DoiT International BigQuery plugin no longer supported - Checkout https://grafana.com/docs/grafana/next/breaking-changes/breaking-changes-v10-0 for details * Features and enhancements - Themes: Unify secondary button and ToolbarButton. * Bug fixes - Query Editor: Ensure dropdown menus position correctly. - Drawer: Fixes closeOnMaskClick false issue. OBS-URL: https://build.opensuse.org/request/show/1094843 OBS-URL: https://build.opensuse.org/package/show/server:monitoring/grafana?expand=0&rev=109
2023-06-23 14:40:38 +02:00
Version: 10.0.1
Release: 0
Summary: The open-source platform for monitoring and observability
License: AGPL-3.0-only
Group: System/Monitoring
URL: http://grafana.org/
Source: %{name}-%{version}.tar.gz
Source1: vendor.tar.gz
Source2: %{name}-rpmlintrc
# Instructions on the build process
Source3: README
# Makefile to automate build process
Source4: Makefile
Source5: 0001-Add-source-code-reference.patch
BuildRequires: fdupes
BuildRequires: git-core
BuildRequires: golang-packaging
BuildRequires: wire
BuildRequires: golang(API) >= 1.19
Requires(post): %fillup_prereq
Requires: group(grafana)
Requires: user(grafana)
%systemd_ordering
# Exclude s390 on SLE12, since golang 1.14 itself is not built for this arch on SLE12
# See https://build.suse.de/package/view_file/SUSE:SLE-12:Update/go1.14/go1.14.spec?expand=1
%if 0%{?suse_version} == 1315
ExcludeArch: s390
%endif
%description
A graph and dashboard builder for visualizing time series metrics.
Grafana provides ways to create, explore, and share
dashboards and data with teams.
%prep
%setup -q -n grafana-%{version}
%setup -q -T -D -a 1 -n grafana-%{version}
%build
%goprep github.com/grafana/grafana
# Manual build in order to inject ldflags so grafana correctly displays
# the version in the footer of each page. Note that we're only injecting
# main.version, not main.commit or main.buildstamp as is done in the upstream
# build.go, because we don't have access to the git commit history here.
# (The %%gobuild macro can't take quoted strings; they get split up when
# expanded to $extra_flags in process_build() in /usr/lib/rpm/golang.sh.)
export IMPORTPATH="github.com/grafana/grafana"
export BUILDFLAGS="-v -p 4 -x -buildmode=pie -mod=vendor"
export GOPATH=%{_builddir}/go:%{_builddir}/contrib
export GOBIN=%{_builddir}/go/bin
wire gen -tags 'oss' ./pkg/server ./pkg/cmd/grafana-cli/runner
go install $BUILDFLAGS -ldflags '-X main.version=%{version}' $IMPORTPATH/pkg/cmd/...
%install
%goinstall
Accepting request 1078603 from home:mkittler:branches:server:monitoring - Update to 9.4.7 (2023-03-16) * Bug fixes - Alerting: Update scheduler to receive rule updates only from database. - Influxdb: Re-introduce backend migration feature toggle. - Security: Fixes for CVE-2023-1410. * Breaking changes The InfluxDB backend migration feature toggle (influxdbBackendMigration) has been reintroduced in this version as issues were discovered with backend processing of InfluxDB data. Unless this feature toggle is enabled, all InfluxDB data will be parsed in the frontend. This frontend processing is the default behavior. In Grafana 9.4.4, InfluxDB data parsing started to be handled in the backend. If you have upgraded to 9.4.4 and then added new transformations on InfluxDB data, those panels will fail to render. To resolve this either: - Remove the affected panel and re-create it - Edit the `time` field as `Time` in `panel.json` or `dashboard.json` - Remove 0002-Update-exporter-toolkit-to-version-0.7.3.patch as the exporter toolkit has been updated by upstream - Install wrapper scripts under /usr/sbin - Install actual binaries under /usr/libexec/grafana (or /usr/lib under older distributions) and create a simlink for wrapper scripts and the service (which expect the binary to be under /usr/share/grafana/bin) - Update to 9.4.3 (2023-03-02) * Bug fixes - Alerting: Use background context for maintenance function. - Update to 9.4.2 (2023-03-02) * Bug fixes - Alerting: Fix boolean default in migration from false to 0. - Update to 9.4.0 (2023-02-28) * Features and enhancements - Alerting: Add endpoint for querying state history. - Alerting: Add label query parameters to state history endpoint. - Alerting: Add static label to all state history entries. - Alerting: Mark AM configuration as applied. - Azure Monitor: Enable multiple resource queries. - InfluxDB: Move database information into jsondata. - Query Caching: Add per-panel query caching TTL. - Table: Add row number column option. - Tempo: Remove tempoApmTable feature flag. - Transformations: Selectively apply transformation to queries. * Bug fixes - AccessControl: Clear user permission cache for update org user role. - Alerting: Fix handling of special floating-point cases when writing observed values to annotations. - Auth: Rotate token patch. - ContextMenu: Consider y coord when determining bottom collision. - Elasticsearch: Fix consistent label order in alerting. - Explore: Fix graph not updating when changing config. - Heatmap: Support heatmap rows with non-timeseries X axis. - Login: Fix panic when a user is upserted by a background process. - MSSQL: Add support for macro function calls. - MySQL: Quote identifiers that include special characters. - Navigation: Sign in button now works correctly when served under a sub path. - Nested Folder: Fix for SQLite not to overwrite the parent on restarts. - PanelChrome: Adds display mode to support transparent option. - Plugins: Case-sensitive routes for standalone pages. - Plugins: Prefer to use the data source UID when querying. - SQLStore: Fix folder migration for MySQL < 5.7. - Search: Fix not being able to clear sort value. - Tempo: Fix span name being dropped from the query. * Plugin development fixes & changes - PanelChrome: Implement hover header. - Update to 9.3.7 (2023-02-28) * Bug fixes - Alerting: Validate that tags are 100 characters or less. - Expressions: Fixes the issue showing expressions editor. - Logs: Fix stats not being updated when log results change. - Plugins: Fix circular reference in customOptions leading to MarshalJSON errors. - Time Series Panel: Fix legend text selection in Firefox. OBS-URL: https://build.opensuse.org/request/show/1078603 OBS-URL: https://build.opensuse.org/package/show/server:monitoring/grafana?expand=0&rev=101
2023-04-13 13:52:38 +02:00
# install binaries and service
install -Dm644 {packaging/rpm/systemd/,%{buildroot}%{_unitdir}/}%{name}-server.service
install -dm755 %{buildroot}%{_sbindir}
Accepting request 1078603 from home:mkittler:branches:server:monitoring - Update to 9.4.7 (2023-03-16) * Bug fixes - Alerting: Update scheduler to receive rule updates only from database. - Influxdb: Re-introduce backend migration feature toggle. - Security: Fixes for CVE-2023-1410. * Breaking changes The InfluxDB backend migration feature toggle (influxdbBackendMigration) has been reintroduced in this version as issues were discovered with backend processing of InfluxDB data. Unless this feature toggle is enabled, all InfluxDB data will be parsed in the frontend. This frontend processing is the default behavior. In Grafana 9.4.4, InfluxDB data parsing started to be handled in the backend. If you have upgraded to 9.4.4 and then added new transformations on InfluxDB data, those panels will fail to render. To resolve this either: - Remove the affected panel and re-create it - Edit the `time` field as `Time` in `panel.json` or `dashboard.json` - Remove 0002-Update-exporter-toolkit-to-version-0.7.3.patch as the exporter toolkit has been updated by upstream - Install wrapper scripts under /usr/sbin - Install actual binaries under /usr/libexec/grafana (or /usr/lib under older distributions) and create a simlink for wrapper scripts and the service (which expect the binary to be under /usr/share/grafana/bin) - Update to 9.4.3 (2023-03-02) * Bug fixes - Alerting: Use background context for maintenance function. - Update to 9.4.2 (2023-03-02) * Bug fixes - Alerting: Fix boolean default in migration from false to 0. - Update to 9.4.0 (2023-02-28) * Features and enhancements - Alerting: Add endpoint for querying state history. - Alerting: Add label query parameters to state history endpoint. - Alerting: Add static label to all state history entries. - Alerting: Mark AM configuration as applied. - Azure Monitor: Enable multiple resource queries. - InfluxDB: Move database information into jsondata. - Query Caching: Add per-panel query caching TTL. - Table: Add row number column option. - Tempo: Remove tempoApmTable feature flag. - Transformations: Selectively apply transformation to queries. * Bug fixes - AccessControl: Clear user permission cache for update org user role. - Alerting: Fix handling of special floating-point cases when writing observed values to annotations. - Auth: Rotate token patch. - ContextMenu: Consider y coord when determining bottom collision. - Elasticsearch: Fix consistent label order in alerting. - Explore: Fix graph not updating when changing config. - Heatmap: Support heatmap rows with non-timeseries X axis. - Login: Fix panic when a user is upserted by a background process. - MSSQL: Add support for macro function calls. - MySQL: Quote identifiers that include special characters. - Navigation: Sign in button now works correctly when served under a sub path. - Nested Folder: Fix for SQLite not to overwrite the parent on restarts. - PanelChrome: Adds display mode to support transparent option. - Plugins: Case-sensitive routes for standalone pages. - Plugins: Prefer to use the data source UID when querying. - SQLStore: Fix folder migration for MySQL < 5.7. - Search: Fix not being able to clear sort value. - Tempo: Fix span name being dropped from the query. * Plugin development fixes & changes - PanelChrome: Implement hover header. - Update to 9.3.7 (2023-02-28) * Bug fixes - Alerting: Validate that tags are 100 characters or less. - Expressions: Fixes the issue showing expressions editor. - Logs: Fix stats not being updated when log results change. - Plugins: Fix circular reference in customOptions leading to MarshalJSON errors. - Time Series Panel: Fix legend text selection in Firefox. OBS-URL: https://build.opensuse.org/request/show/1078603 OBS-URL: https://build.opensuse.org/package/show/server:monitoring/grafana?expand=0&rev=101
2023-04-13 13:52:38 +02:00
install -dm755 %{buildroot}%{_libexecdir}/%{name}
install -m755 --target-directory=%{buildroot}%{_sbindir} packaging/wrappers/%{name}*
mv --target-directory=%{buildroot}%{_libexecdir}/%{name} %{buildroot}/%{_bindir}/%{name}*
# create "rc symlink" (https://en.opensuse.org/openSUSE:Systemd_packaging_guidelines#rc_symlink)
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-server
# add symlink to binary where systemd unit file expects it to be
install -dm755 %{buildroot}%{_datadir}/%{name}/bin
ln -s %{_libexecdir}/%{name}/%{name} %{buildroot}%{_datadir}/%{name}/bin/%{name}
install -Dm644 packaging/rpm/sysconfig/%{name}-server \
%{buildroot}%{_fillupdir}/sysconfig.%{name}-server
install -d -m0750 %{buildroot}%{_localstatedir}/lib/%{name}
install -d -m0750 %{buildroot}%{_localstatedir}/log/%{name}
install -d -m0755 %{buildroot}/%{_localstatedir}/lib/%{name}/plugins
install -d -m0755 %{buildroot}/%{_localstatedir}/lib/%{name}/dashboards
install -d -m0755 %{buildroot}%{_sysconfdir}/%{name}/provisioning/dashboards
install -Dm640 conf/sample.ini %{buildroot}%{_sysconfdir}/%{name}/%{name}.ini
install -Dm640 {conf/,%{buildroot}%{_sysconfdir}/%{name}/}ldap.toml
install -Dm644 {conf/,%{buildroot}%{_datadir}/%{name}/conf/}defaults.ini
install -m644 {conf/,%{buildroot}%{_datadir}/%{name}/conf/}sample.ini
install -Dm644 {conf/provisioning/dashboards/,%{buildroot}%{_datadir}/%{name}/conf/provisioning/dashboards/}sample.yaml
install -Dm644 {conf/provisioning/datasources/,%{buildroot}%{_datadir}/%{name}/conf/provisioning/datasources/}sample.yaml
cp -pr public %{buildroot}%{_datadir}/%{name}/
install -d -m755 %{buildroot}%{_datadir}/%{name}/vendor
install -d -m755 %{buildroot}%{_datadir}/%{name}/tools
# Do *not* use %%fudpes -s -- this will result in grafana failing to load
# all the plugins (something in the plugin scanner can't cope with files
# in there being symlinks).
%fdupes %{buildroot}/%{_datadir}
%check
#gotest github.com/grafana/grafana/pkg...
%pre
%service_add_pre %{name}-server.service
%post
%{fillup_only -n %{name}-server}
%service_add_post %{name}-server.service
%preun
%service_del_preun %{name}-server.service
%postun
%service_del_postun %{name}-server.service
%files
%defattr(-,root,root)
%license LICENSE*
%doc CHANGELOG*
%{_sbindir}/%{name}*
%{_sbindir}/rc%{name}-server
Accepting request 1078603 from home:mkittler:branches:server:monitoring - Update to 9.4.7 (2023-03-16) * Bug fixes - Alerting: Update scheduler to receive rule updates only from database. - Influxdb: Re-introduce backend migration feature toggle. - Security: Fixes for CVE-2023-1410. * Breaking changes The InfluxDB backend migration feature toggle (influxdbBackendMigration) has been reintroduced in this version as issues were discovered with backend processing of InfluxDB data. Unless this feature toggle is enabled, all InfluxDB data will be parsed in the frontend. This frontend processing is the default behavior. In Grafana 9.4.4, InfluxDB data parsing started to be handled in the backend. If you have upgraded to 9.4.4 and then added new transformations on InfluxDB data, those panels will fail to render. To resolve this either: - Remove the affected panel and re-create it - Edit the `time` field as `Time` in `panel.json` or `dashboard.json` - Remove 0002-Update-exporter-toolkit-to-version-0.7.3.patch as the exporter toolkit has been updated by upstream - Install wrapper scripts under /usr/sbin - Install actual binaries under /usr/libexec/grafana (or /usr/lib under older distributions) and create a simlink for wrapper scripts and the service (which expect the binary to be under /usr/share/grafana/bin) - Update to 9.4.3 (2023-03-02) * Bug fixes - Alerting: Use background context for maintenance function. - Update to 9.4.2 (2023-03-02) * Bug fixes - Alerting: Fix boolean default in migration from false to 0. - Update to 9.4.0 (2023-02-28) * Features and enhancements - Alerting: Add endpoint for querying state history. - Alerting: Add label query parameters to state history endpoint. - Alerting: Add static label to all state history entries. - Alerting: Mark AM configuration as applied. - Azure Monitor: Enable multiple resource queries. - InfluxDB: Move database information into jsondata. - Query Caching: Add per-panel query caching TTL. - Table: Add row number column option. - Tempo: Remove tempoApmTable feature flag. - Transformations: Selectively apply transformation to queries. * Bug fixes - AccessControl: Clear user permission cache for update org user role. - Alerting: Fix handling of special floating-point cases when writing observed values to annotations. - Auth: Rotate token patch. - ContextMenu: Consider y coord when determining bottom collision. - Elasticsearch: Fix consistent label order in alerting. - Explore: Fix graph not updating when changing config. - Heatmap: Support heatmap rows with non-timeseries X axis. - Login: Fix panic when a user is upserted by a background process. - MSSQL: Add support for macro function calls. - MySQL: Quote identifiers that include special characters. - Navigation: Sign in button now works correctly when served under a sub path. - Nested Folder: Fix for SQLite not to overwrite the parent on restarts. - PanelChrome: Adds display mode to support transparent option. - Plugins: Case-sensitive routes for standalone pages. - Plugins: Prefer to use the data source UID when querying. - SQLStore: Fix folder migration for MySQL < 5.7. - Search: Fix not being able to clear sort value. - Tempo: Fix span name being dropped from the query. * Plugin development fixes & changes - PanelChrome: Implement hover header. - Update to 9.3.7 (2023-02-28) * Bug fixes - Alerting: Validate that tags are 100 characters or less. - Expressions: Fixes the issue showing expressions editor. - Logs: Fix stats not being updated when log results change. - Plugins: Fix circular reference in customOptions leading to MarshalJSON errors. - Time Series Panel: Fix legend text selection in Firefox. OBS-URL: https://build.opensuse.org/request/show/1078603 OBS-URL: https://build.opensuse.org/package/show/server:monitoring/grafana?expand=0&rev=101
2023-04-13 13:52:38 +02:00
%dir %{_libexecdir}/%{name}
%{_libexecdir}/%{name}/%{name}*
%{_unitdir}/%{name}-server.service
%{_fillupdir}/sysconfig.%{name}-server
%attr(0755,root,root) %dir %{_sysconfdir}/%{name}
%attr(0755,root,root) %dir %{_sysconfdir}/%{name}/provisioning
%attr(0755,root,root) %dir %{_sysconfdir}/%{name}/provisioning/dashboards
%attr(0755,root,grafana) %dir %{_datadir}/%{name}/conf
%attr(0640,root,grafana) %config(noreplace) %{_sysconfdir}/%{name}/%{name}.ini
%attr(0640,root,grafana) %config(noreplace) %{_sysconfdir}/%{name}/ldap.toml
%attr(0755,grafana,grafana) %dir %{_localstatedir}/lib/%{name}
%attr(0755,grafana,grafana) %dir %{_localstatedir}/lib/%{name}/plugins
%attr(0755,grafana,grafana) %dir %{_localstatedir}/lib/%{name}/dashboards
%attr(0750,grafana,grafana) %dir %{_localstatedir}/log/%{name}
%doc %{_datadir}/%{name}/conf/sample.ini
%doc %{_datadir}/%{name}/conf/provisioning/dashboards/sample.yaml
%doc %{_datadir}/%{name}/conf/provisioning/datasources/sample.yaml
%config %{_datadir}/%{name}/conf/defaults.ini
%{_datadir}/%{name}
%changelog