File grafana-status-panel.spec of Package grafana-status-panel.24267
#
# spec file for package grafana-status-panel
#
# Copyright (c) 2021 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/
#
Name: grafana-status-panel
Version: 1.0.11
Release: 0
Summary: Grafana Status panel
License: Apache-2.0
Group: System/Monitoring
URL: https://github.com/Vonage/Grafana_Status_panel
Source: grafana_status_panel-1.0.10.tar.xz
# v1.0.11 is the same as v1.0.10, but with the contents of the 'dist'
# directory signed by the upstream Grafana folks. For background on
# this, see https://github.com/Vonage/Grafana_Status_panel/issues/189
# The difficulty packaging this is that nobody seems to have actually
# pushed that signature (the stuff in MANIFEST.txt) to a git repo
# anywhere, so we can't just use the _service file as usual to make
# a nice source tarball. Instead, we've got the existing v1.0.10
# release, plus the following zip file, which was downloaded from
# https://grafana.com/grafana/plugins/vonage-status-panel/?tab=installation
# See further down in the build section for how this is used...
Source1: vonage-status-panel-1.0.11.zip
Requires: grafana
BuildRequires: fdupes
BuildRequires: grafana
BuildRequires: unzip
BuildRequires: xz
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
This is a plugin meant to be used as a centralized view for the status of
component in a glance. It is very similar to the Single Stat panel, but it
can hold multiple values from the same data source. Each value can be used
to customize the panel in different ways:
Mark the severity of the component
Mark if the component is disabled
Show extra data in the panel about the component
%prep
%setup -q -n grafana_status_panel-1.0.10 -a 1
%build
# vonage-status-panel-1.0.11.zip extracts to the vonage-status-panel directory,
# so grab everything from there and move it back to 'dist'. Also, for the sake
# of consistency, we're copying dist/plugin.json to src/plugin.json, so that
# the version number is correct in all places.
pushd vonage-status-panel && \
find . -type f -exec mv {} ../dist/{} \;
popd
cp dist/plugin.json src/plugin.json
%install
%define grafana_plugin_dir %{_localstatedir}/lib/grafana/plugins
install -Dd -m0755 %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/dist/css
install -Dd -m0755 %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/src/css
install -Dd -m0755 %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/dist/img
install -Dd -m0755 %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/src/img
install -D -m0644 package.json %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/
install -D -m0644 package-lock.json %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/
install -D -m0644 Gruntfile.js %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/
install -D -m0644 dist/MANIFEST.txt %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/dist
install -D -m0644 dist/README.md %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/dist
install -D -m0644 dist/editor.html %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/dist
install -D -m0644 dist/module.html %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/dist
install -D -m0644 dist/module.js %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/dist
install -D -m0644 dist/module.js.map %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/dist
install -D -m0644 dist/plugin.json %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/dist
install -D -m0644 dist/status_ctrl.js %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/dist
install -D -m0644 dist/status_ctrl.js.map %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/dist
install -D -m0644 dist/css/* %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/dist/css
install -D -m0644 dist/img/* %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/dist/img
install -D -m0644 src/editor.html %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/src
install -D -m0644 src/module.html %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/src
install -D -m0644 src/module.js %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/src
install -D -m0644 src/plugin.json %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/src
install -D -m0644 src/status_ctrl.js %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/src
install -D -m0644 src/css/* %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/src/css
install -D -m0644 src/img/* %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/src/img
%fdupes -s %{buildroot}%{grafana_plugin_dir}/vonage-status-panel/
%files
%attr(0755,grafana,grafana) %dir %{_localstatedir}/lib/grafana
%attr(0755,grafana,grafana) %dir %{_localstatedir}/lib/grafana/plugins
%doc README.md
%license LICENSE.txt
%dir %{grafana_plugin_dir}/vonage-status-panel
%dir %{grafana_plugin_dir}/vonage-status-panel/dist
%dir %{grafana_plugin_dir}/vonage-status-panel/dist/css
%dir %{grafana_plugin_dir}/vonage-status-panel/dist/img
%dir %{grafana_plugin_dir}/vonage-status-panel/src
%dir %{grafana_plugin_dir}/vonage-status-panel/src/css
%dir %{grafana_plugin_dir}/vonage-status-panel/src/img
%{grafana_plugin_dir}/vonage-status-panel/Gruntfile.js
%{grafana_plugin_dir}/vonage-status-panel/package.json
%{grafana_plugin_dir}/vonage-status-panel/package-lock.json
# MANIFEST.txt is the plugin signature. README.md is already specified as
# a doc, but we also need it here in 'dist', because it's listed in the
# manifest, and the plugin will fail signature verification without it.
%{grafana_plugin_dir}/vonage-status-panel/dist/MANIFEST.txt
%{grafana_plugin_dir}/vonage-status-panel/dist/README.md
%{grafana_plugin_dir}/vonage-status-panel/dist/editor.html
%{grafana_plugin_dir}/vonage-status-panel/dist/module.html
%{grafana_plugin_dir}/vonage-status-panel/dist/module.js
%{grafana_plugin_dir}/vonage-status-panel/dist/module.js.map
%{grafana_plugin_dir}/vonage-status-panel/dist/plugin.json
%{grafana_plugin_dir}/vonage-status-panel/dist/status_ctrl.js
%{grafana_plugin_dir}/vonage-status-panel/dist/status_ctrl.js.map
%{grafana_plugin_dir}/vonage-status-panel/src/editor.html
%{grafana_plugin_dir}/vonage-status-panel/src/module.html
%{grafana_plugin_dir}/vonage-status-panel/src/module.js
%{grafana_plugin_dir}/vonage-status-panel/src/plugin.json
%{grafana_plugin_dir}/vonage-status-panel/src/status_ctrl.js
%{grafana_plugin_dir}/vonage-status-panel/dist/css/*
%{grafana_plugin_dir}/vonage-status-panel/src/css/*
%{grafana_plugin_dir}/vonage-status-panel/dist/img/*
%{grafana_plugin_dir}/vonage-status-panel/src/img/*
%changelog