2018-03-07 11:11:57 +01:00
|
|
|
#
|
|
|
|
# spec file for package grafana
|
|
|
|
#
|
2021-01-21 16:08:15 +01:00
|
|
|
# Copyright (c) 2021 SUSE LLC
|
2018-03-07 11:11:57 +01:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2019-05-28 14:44:25 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2018-03-07 11:11:57 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2019-12-05 16:43:17 +01:00
|
|
|
#Compat macro for new _fillupdir macro introduced in Nov 2017
|
|
|
|
%if ! %{defined _fillupdir}
|
|
|
|
%define _fillupdir /var/adm/fillup-templates
|
|
|
|
%endif
|
2019-08-08 16:15:00 +02:00
|
|
|
|
2018-03-07 11:11:57 +01:00
|
|
|
Name: grafana
|
2021-05-28 09:40:20 +02:00
|
|
|
Version: 7.5.7
|
2019-12-05 16:43:17 +01:00
|
|
|
Release: 0
|
2021-04-19 15:28:13 +02:00
|
|
|
Summary: The open-source platform for monitoring and observability
|
2018-03-07 11:11:57 +01:00
|
|
|
License: Apache-2.0
|
|
|
|
Group: System/Monitoring
|
2019-12-05 16:43:17 +01:00
|
|
|
URL: http://grafana.org/
|
2020-03-19 09:58:44 +01:00
|
|
|
Source: %{name}-%{version}.tar.gz
|
|
|
|
Source1: vendor.tar.gz
|
|
|
|
Source2: %{name}-rpmlintrc
|
2019-12-05 16:43:17 +01:00
|
|
|
# Instructions on the build process
|
2020-03-19 09:58:44 +01:00
|
|
|
Source3: README
|
2019-12-05 16:43:17 +01:00
|
|
|
# Makefile to automate build process
|
2020-03-19 09:58:44 +01:00
|
|
|
Source4: Makefile
|
2021-04-19 15:28:13 +02:00
|
|
|
Patch1: drop-grafana-aws-sdk-0.3.0-module.patch
|
2018-03-07 11:11:57 +01:00
|
|
|
BuildRequires: fdupes
|
2020-03-19 09:58:44 +01:00
|
|
|
BuildRequires: git-core
|
2018-03-07 11:11:57 +01:00
|
|
|
BuildRequires: golang-packaging
|
2020-11-24 17:42:19 +01:00
|
|
|
BuildRequires: golang(API) >= 1.15
|
2019-12-05 16:43:17 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2020-11-24 17:42:19 +01:00
|
|
|
Requires(post): %fillup_prereq
|
|
|
|
Requires: group(grafana)
|
|
|
|
Requires: user(grafana)
|
|
|
|
%systemd_ordering
|
|
|
|
|
|
|
|
%go_nostrip
|
2018-03-07 11:11:57 +01:00
|
|
|
|
2020-06-04 01:19:01 +02:00
|
|
|
# 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
|
|
|
|
|
2018-03-07 11:11:57 +01:00
|
|
|
%description
|
2019-12-05 16:43:17 +01:00
|
|
|
A graph and dashboard builder for visualizing time series metrics.
|
2018-03-07 11:11:57 +01:00
|
|
|
|
2019-12-05 16:43:17 +01:00
|
|
|
Grafana provides ways to create, explore, and share
|
|
|
|
dashboards and data with teams.
|
2018-03-07 11:11:57 +01:00
|
|
|
|
|
|
|
%prep
|
2019-12-05 16:43:17 +01:00
|
|
|
%setup -q -n grafana-%{version}
|
2020-03-19 09:58:44 +01:00
|
|
|
%setup -q -T -D -a 1 -n grafana-%{version}
|
2021-02-26 15:07:38 +01:00
|
|
|
%patch1 -p1
|
2018-03-07 11:11:57 +01:00
|
|
|
|
|
|
|
%build
|
|
|
|
%goprep github.com/grafana/grafana
|
2019-12-05 16:43:17 +01:00
|
|
|
# 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"
|
2020-03-19 09:58:44 +01:00
|
|
|
export BUILDFLAGS="-v -p 4 -x -buildmode=pie -mod=vendor"
|
2019-12-05 16:43:17 +01:00
|
|
|
export GOPATH=%{_builddir}/go:%{_builddir}/contrib
|
|
|
|
export GOBIN=%{_builddir}/go/bin
|
|
|
|
go install $BUILDFLAGS -ldflags '-X main.version=%{version}' $IMPORTPATH/pkg/cmd/...
|
2018-03-07 11:11:57 +01:00
|
|
|
|
|
|
|
%install
|
|
|
|
%goinstall
|
|
|
|
|
2019-12-05 16:43:17 +01:00
|
|
|
# we're missing %%gosrc and %%gofilelist... (although that *might* be ok...)
|
2018-03-07 11:11:57 +01:00
|
|
|
|
2019-12-05 16:43:17 +01:00
|
|
|
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}
|
2018-03-07 11:11:57 +01:00
|
|
|
|
2019-12-05 16:43:17 +01:00
|
|
|
install -Dm644 packaging/rpm/sysconfig/%{name}-server \
|
|
|
|
%{buildroot}%{_fillupdir}/sysconfig.%{name}-server
|
2019-10-27 14:49:03 +01:00
|
|
|
|
2019-12-05 16:43:17 +01:00
|
|
|
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
|
2019-10-27 14:49:03 +01:00
|
|
|
|
2018-03-07 11:11:57 +01:00
|
|
|
install -Dm640 conf/sample.ini %{buildroot}%{_sysconfdir}/%{name}/%{name}.ini
|
|
|
|
install -Dm640 {conf/,%{buildroot}%{_sysconfdir}/%{name}/}ldap.toml
|
2019-12-05 16:43:17 +01:00
|
|
|
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
|
2019-08-08 16:15:00 +02:00
|
|
|
|
2018-03-07 11:11:57 +01:00
|
|
|
# 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
|
2019-12-05 16:43:17 +01:00
|
|
|
#gotest github.com/grafana/grafana/pkg...
|
2018-03-07 11:11:57 +01:00
|
|
|
|
|
|
|
%pre
|
|
|
|
%service_add_pre %{name}-server.service
|
2019-12-05 16:43:17 +01:00
|
|
|
|
2018-03-07 11:11:57 +01:00
|
|
|
%post
|
2019-12-05 16:43:17 +01:00
|
|
|
%{fillup_only -n %{name}-server}
|
2018-03-07 11:11:57 +01:00
|
|
|
%service_add_post %{name}-server.service
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%service_del_preun %{name}-server.service
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%service_del_postun %{name}-server.service
|
|
|
|
|
|
|
|
%files
|
2019-12-05 16:43:17 +01:00
|
|
|
%defattr(-,root,root)
|
|
|
|
%license LICENSE*
|
|
|
|
%doc CHANGELOG*
|
|
|
|
%{_sbindir}/%{name}*
|
2018-03-07 11:11:57 +01:00
|
|
|
%{_sbindir}/rc%{name}-server
|
2019-12-05 16:43:17 +01:00
|
|
|
%{_unitdir}/%{name}-server.service
|
2018-03-07 11:11:57 +01:00
|
|
|
%{_fillupdir}/sysconfig.%{name}-server
|
2019-12-05 16:43:17 +01:00
|
|
|
%attr(0755,root,root) %dir %{_sysconfdir}/%{name}
|
|
|
|
%attr(0755,root,root) %dir %{_sysconfdir}/%{name}/provisioning
|
|
|
|
%attr(0755,root,root) %dir %{_sysconfdir}/%{name}/provisioning/dashboards
|
2020-11-24 17:42:19 +01:00
|
|
|
%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}
|
2019-12-05 16:43:17 +01:00
|
|
|
%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}
|
2018-03-07 11:11:57 +01:00
|
|
|
|
|
|
|
%changelog
|