grafana/grafana.spec

163 lines
6.7 KiB
RPMSpec
Raw Normal View History

#
# spec file for package grafana
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
%define GRAFANA_USER %{name}
%define GRAFANA_GROUP %{name}
%define GRAFANA_HOME %{_datadir}/%{name}
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir /var/adm/fillup-templates
%endif
Name: grafana
Accepting request 683876 from home:jfajerski:branches:server:monitoring - Update to version 6.0.1: * Bug Fixes: + utils: show string errors + Viewers with viewers_can_edit should be able to access /explore + log phantomjs output even if it timeout and include orgId when render alert - Update to version 6.0.0: * Breaking Changes: + Text Panel: The text panel does no longer by default allow unsantizied HTML. This means that if you have text panels with scripts tags they will no longer work as before. To enable unsafe javascript execution in text panels enable the settings disable_sanitize_html under the section [panels] in your Grafana ini file, or set env variable GF_PANELS_DISABLE_SANITIZE_HTML=true. + Dashboard: Panel property minSpan replaced by maxPerRow. Dashboard migration will automatically migrate all dashboard panels using the minSpan property to the new maxPerRow property + Internal Metrics Edition has been added to the build_info metric. This will break any Graphite queries using this metric. Edition will be a new label for the Prometheus metric. * New Features: + Alerting: Adds support for Google Hangouts Chat notifications + Elasticsearch: Support bucket script pipeline aggregations + Influxdb: Add support for time zone (tz) clause + Snapshots: Enable deletion of public snapshot + Provisioning: Provisioning support for alert notifiers + Explore: A whole new way to do ad-hoc metric queries and exploration. Split view in half and compare metrics & logs and much much more. Read more here + Auth: Replace remember me cookie solution for Grafana's builtin, LDAP and OAuth authentication with a solution based on short-lived tokens + AzureMonitor: Enable alerting by converting Azure Monitor API to Go + Explore A new query focused workflow for ad-hoc data exploration and troubleshooting. + Grafana Loki Integration with the new open source log aggregation system from Grafana Labs. + Gauge Panel A new standalone panel for gauges. + New Panel Editor UX improves panel editing and enables easy switching between different visualizations. + Google Stackdriver Datasource is out of beta and is officially released. + React Plugin support enables an easier way to build plugins. + Named Colors in our new improved color picker. + Removal of user session storage makes Grafana easier to deploy & improves security. * Bug Fixes: + Metrics: Fixes broken usagestats metrics for /metrics + Dashboard: Fixes kiosk mode should have &kiosk appended to the url + Dashboard: Fixes kiosk=tv mode with autofitpanels should respect header + Image rendering: Fixed image rendering issue for dashboards with auto refresh, + Dashboard: Fix only users that can edit a dashboard should be able to update panel json. + LDAP: fix allow anonymous initial bind for ldap search. + UX: Fixed scrollbar not visible initially (only after manual scroll). + Datasource admin TestData + Dashboard: Fixed scrolling issue that caused scroll to be locked to bottom. + Explore: Viewers with viewers_can_edit should be able to access /explore. + Security fix: limit access to org admin and alerting pages. + Panel Edit minInterval changes did not persist + Teams: Fixed bug when getting teams for user. + Stackdriver: fix for float64 bounds for distribution metrics + Stackdriver: no reducers available for distribution type + Influxdb: Add support for alerting on InfluxDB queries that use the non_negative_difference function + Alerting: Fix percent_diff calculation when points are nulls + Alerting: Fixed handling of alert urls with true flags + Gauge: Fix issue with gauge requests being cancelled + Gauge: Accept decimal inputs for thresholds + UI: Fix error caused by named colors that are not part of named colors palette + Search: Bug pressing special regexp chars in input fields + Permissions: No need to have edit permissions to be able to "Save as" + Search: Fix for issue with scrolling the "tags filter" dropdown + Prometheus: Query for annotation always uses 60s step regardless of dashboard range + Annotations: Fix creating annotation when graph panel has no data points position the popup outside viewport + Piechart/Flot: Fixes multiple piechart instances with donut bug + plus many minor changes and fixes - Update to version 5.4.3: * Fixes: + Alerting Invalid frequency causes division by zero in alert scheduler + Dashboard Dashboard links do not update when time range changes + Limits Support more than 1000 datasources per org + Backend fix signed in user for orgId=0 result should return active org id + Provisioning Adds orgId to user dto for provisioned dashboards - Update to version 5.4.2: * Fixes: + Datasource admin: Fix for issue creating new data source when same name exists + OAuth: Fix for oauth auto login setting, can now be set using env variable + Dashboard search: Fix for searching tags in tags filter dropdown. - Update to version 5.4.1: * Fixes: + Stackdriver: Fixes issue with data proxy and Authorization header + Units: fixedUnit for Flow:l/min and mL/min + Logging: Fix for issue where data proxy logged a secret when debug logging was enabled, now redacted. + InfluxDB: Add support for alerting on InfluxDB queries that use the cumulative_sum function. + Plugins: Panel plugins should no receive the panel-initialized event again as usual. + Embedded Graphs: Iframe graph panels should now work as usual. + Postgres: Improve PostgreSQL Query Editor if using different Schemas, + Quotas: Fixed for updating org & user quotas. + Cloudwatch: Add the AWS/SES Cloudwatch metrics of BounceRate and ComplaintRate to auto complete list. + Dashboard Search: Fixed filtering by tag issues. + Graph: Fixed time region issues, + Graph: Fixed issue with series color picker popover being placed outside window. - Update to version 5.4.0: * Breaking Changes: + Postgres/MySQL/MSSQL datasources now per default uses max open connections = unlimited (earlier 10), max idle connections = 2 (earlier 10) and connection max lifetime = 4 hours (earlier unlimited). * Features: + Alerting: Introduce alert debouncing with the FOR setting. + Alerting: Option to disable OK alert notifications + Postgres/MySQL/MSSQL: Adds support for configuration of max open/idle connections and connection max lifetime. Also, panels with multiple SQL queries will now be executed concurrently + MySQL: Graphical query builder + MySQL: Support connecting thru Unix socket for MySQL datasource + MSSQL: Add encrypt setting to allow configuration of how data sent between client and server are encrypted + Stackdriver: Not possible to authenticate using GCE metadata server + Teams: Team preferences (theme, home dashboard, timezone) support + Graph: Time regions support enabling highlight of weekdays and/or certain timespans + OAuth: Automatic redirect to sign-in with OAuth + Stackdriver: Template query editor * Fixes: + Cloudwatch: Fix invalid time range causes segmentation fault + Cloudwatch: AWS/CodeBuild metrics and dimensions + MySQL: Fix $__timeFrom() and $__timeTo() should respect local time zone + Graph: Fix legend always visible even if configured to be hidden + Elasticsearch: Fix regression when using datasource version 6.0+ and alerting - Update to version 5.3.4: * minor bug fixes - Update to version 5.3.3: * fix potential security issue https://community.grafana.com/t/grafana-5-3-3-and-4-6-5-security-update/11961 OBS-URL: https://build.opensuse.org/request/show/683876 OBS-URL: https://build.opensuse.org/package/show/server:monitoring/grafana?expand=0&rev=10
2019-03-13 09:29:03 +01:00
Version: 6.0.1
Release: 0
Summary: Dashboards and editors for Graphite, InfluxDB, OpenTSDB
License: Apache-2.0
Group: System/Monitoring
Url: http://grafana.org/
Source: %{name}-%{version}.tar.xz
Source1: %{name}-rpmlintrc
# Instructions on the build process
Source2: README
# Makefile to automate build process
Source3: Makefile
Requires: phantomjs
# Needed as a BuildRequires too, so setting up a symlink will work
BuildRequires: fdupes
BuildRequires: go >= 1.11
BuildRequires: golang-packaging
BuildRequires: libgcc_s1
BuildRequires: phantomjs
BuildRequires: shadow
Requires(post): %insserv_prereq
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{?systemd_requires}
%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}
%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"
export GOPATH=%{_builddir}/go:%{_builddir}/contrib
export GOBIN=%{_builddir}/go/bin
go install $BUILDFLAGS -ldflags '-X main.version=%{version}' $IMPORTPATH/pkg/cmd/...
%install
%goinstall
# we're missing %%gosrc and %%gofilelist... (although that *might* be ok...)
install -Dm644 {packaging/rpm/systemd/,%{buildroot}%{_unitdir}/}%{name}-server.service
install -dm755 %{buildroot}%{_sbindir}
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}-server
mv %{buildroot}/%{_bindir}/grafana-* %{buildroot}/%{_sbindir}
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
# phantomjs is used for rendering PNG images of graphs. The frontend asset
# build process downloadsa prebuilt x86_64 binary, which ends up in
# vendor/phantomjs/phantomjs. This is ugly but works for x86_64. It naturally
# will not work for other architectures, so instead we remove the phantomjs
# binary and install a symlink to the systemwide /usr/bin/phantomjs.
cp -pr tools/phantomjs %{buildroot}%{_datadir}/%{name}/tools/
rm -f %{buildroot}%{_datadir}/%{name}/tools/phantomjs/phantomjs
ln -s %{_bindir}/phantomjs %{buildroot}%{_datadir}/%{name}/tools/phantomjs/phantomjs
# 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
echo "Creating user %{GRAFANA_USER} and group %{GRAFANA_GROUP} if not present"
getent group %{GRAFANA_GROUP} > /dev/null || groupadd -r %{GRAFANA_GROUP}
getent passwd %{GRAFANA_GROUP} > /dev/null || useradd -r -g %{GRAFANA_GROUP} \
-d %{GRAFANA_HOME} -s /sbin/nologin -c "%{GRAFANA_USER} user" %{GRAFANA_GROUP}
%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)
%doc CHANGELOG* LICENSE*
%{_sbindir}/%{name}*
%{_sbindir}/rc%{name}-server
%{_unitdir}/%{name}-server.service
%{_fillupdir}/sysconfig.%{name}-server
%attr(0750,root,%{GRAFANA_GROUP}) %dir %{_sysconfdir}/%{name}
%attr(0750,root,%{GRAFANA_GROUP}) %dir %{_sysconfdir}/%{name}/provisioning
%attr(0750,root,%{GRAFANA_GROUP}) %dir %{_sysconfdir}/%{name}/provisioning/dashboards
%attr(0750,root,%{GRAFANA_GROUP}) %dir %{_datadir}/%{name}/conf
%attr(0640,root,%{GRAFANA_GROUP}) %config(noreplace) %{_sysconfdir}/%{name}/%{name}.ini
%attr(0640,root,%{GRAFANA_GROUP}) %config(noreplace) %{_sysconfdir}/%{name}/ldap.toml
%attr(0750,%{GRAFANA_USER},%{GRAFANA_GROUP}) %dir %{_localstatedir}/lib/%{name}
%attr(0750,%{GRAFANA_USER},%{GRAFANA_GROUP}) %dir %{_localstatedir}/lib/%{name}/plugins
%attr(0750,%{GRAFANA_USER},%{GRAFANA_GROUP}) %dir %{_localstatedir}/lib/%{name}/dashboards
%attr(0750,%{GRAFANA_USER},%{GRAFANA_GROUP}) %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