Blame SPECS/grafana.spec

50fcc5
%global grafana_arches %{lua: go_arches = {}
50fcc5
  for arch in rpm.expand("%{go_arches}"):gmatch("%S+") do
50fcc5
    go_arches[arch] = 1
50fcc5
  end
50fcc5
  for arch in rpm.expand("%{nodejs_arches}"):gmatch("%S+") do
50fcc5
    if go_arches[arch] then
50fcc5
      print(arch .. " ")
50fcc5
  end
50fcc5
end}
50fcc5
0d3998
# Unbundle Grafana vendor sources and instead use BuildRequires
50fcc5
# only on platforms that have enough golang devel support.
50fcc5
%if 0%{?rhel} == 0
50fcc5
%global           unbundle_vendor_sources 1
50fcc5
%endif
50fcc5
0d3998
%if 0%{?fedora} >= 30
0d3998
# Use vendor sources until both Fedora and Grafana properly support golang modules
0d3998
%global           unbundle_vendor_sources 0
0d3998
%endif
0d3998
50fcc5
50fcc5
Name:             grafana
0d3998
Version:          6.3.6
0d3998
Release:          1%{?dist}
50fcc5
Summary:          Metrics dashboard and graph editor
50fcc5
License:          ASL 2.0
50fcc5
URL:              https://grafana.org
50fcc5
50fcc5
# Source0 contains the tagged upstream sources
50fcc5
Source0:          https://github.com/grafana/grafana/archive/v%{version}/%{name}-%{version}.tar.gz
50fcc5
50fcc5
# Source1 contains the front-end javascript modules bundled into a webpack
50fcc5
Source1:          grafana_webpack-%{version}.tar.gz
50fcc5
50fcc5
# Source2 is the script to create the above webpack from grafana sources
50fcc5
Source2:          make_grafana_webpack.sh
50fcc5
50fcc5
# Patches for upstream
50fcc5
Patch1:           001-login-oauth-use-oauth2-exchange.patch
50fcc5
Patch2:           002-remove-jaeger-tracing.patch
50fcc5
Patch3:           003-new-files.patch
0d3998
Patch4:           004-xerrors.patch
0d3998
Patch5:           005-mute-shellcheck-grafana-cli.patch
50fcc5
50fcc5
# Intersection of go_arches and nodejs_arches
50fcc5
ExclusiveArch:    %{grafana_arches}
50fcc5
50fcc5
# omit golang debugsource, see BZ995136 and related
0d3998
%global           dwz_low_mem_die_limit 0
50fcc5
%global           _debugsource_template %{nil}
50fcc5
50fcc5
%global           GRAFANA_USER %{name}
50fcc5
%global           GRAFANA_GROUP %{name}
50fcc5
%global           GRAFANA_HOME %{_datadir}/%{name}
50fcc5
50fcc5
# grafana-server service daemon uses systemd
50fcc5
%{?systemd_requires}
50fcc5
Requires(pre):    shadow-utils
50fcc5
0d3998
BuildRequires:    git, systemd, golang, go-srpm-macros
50fcc5
50fcc5
Recommends: grafana-cloudwatch = %{version}-%{release}
50fcc5
Recommends: grafana-elasticsearch = %{version}-%{release}
50fcc5
Recommends: grafana-azure-monitor = %{version}-%{release}
50fcc5
Recommends: grafana-graphite = %{version}-%{release}
50fcc5
Recommends: grafana-influxdb = %{version}-%{release}
50fcc5
Recommends: grafana-loki = %{version}-%{release}
50fcc5
Recommends: grafana-mssql = %{version}-%{release}
50fcc5
Recommends: grafana-mysql = %{version}-%{release}
50fcc5
Recommends: grafana-opentsdb = %{version}-%{release}
50fcc5
Recommends: grafana-postgres = %{version}-%{release}
50fcc5
Recommends: grafana-prometheus = %{version}-%{release}
50fcc5
Recommends: grafana-stackdriver = %{version}-%{release}
0d3998
Recommends: grafana-pcp
50fcc5
50fcc5
%if 0%{?unbundle_vendor_sources}
50fcc5
# golang build deps. These allow us to unbundle vendor golang source.
50fcc5
BuildRequires: golang(github.com/aws/aws-sdk-go)
50fcc5
BuildRequires: golang(github.com/benbjohnson/clock)
50fcc5
BuildRequires: golang(github.com/beorn7/perks/quantile)
50fcc5
BuildRequires: golang(github.com/bmizerany/assert)
50fcc5
BuildRequires: golang(github.com/bradfitz/gomemcache/memcache)
50fcc5
BuildRequires: golang(github.com/BurntSushi/toml)
50fcc5
BuildRequires: golang(github.com/codahale/hdrhistogram)
50fcc5
BuildRequires: golang(github.com/codegangsta/cli)
50fcc5
BuildRequires: golang(github.com/davecgh/go-spew/spew)
50fcc5
BuildRequires: golang(github.com/denisenkom/go-mssqldb)
50fcc5
BuildRequires: golang(github.com/facebookgo/inject)
50fcc5
BuildRequires: golang(github.com/facebookgo/structtag)
50fcc5
BuildRequires: golang(github.com/fatih/color)
50fcc5
BuildRequires: golang(github.com/go-ini/ini)
50fcc5
BuildRequires: golang(google.golang.org/appengine)
50fcc5
BuildRequires: golang(golang.org/x/sys/unix)
50fcc5
BuildRequires: golang(github.com/go-macaron/binding)
50fcc5
BuildRequires: golang(github.com/go-macaron/gzip)
50fcc5
BuildRequires: golang(github.com/go-macaron/inject)
50fcc5
BuildRequires: golang(github.com/go-macaron/session)
50fcc5
BuildRequires: golang(google.golang.org/genproto/googleapis/rpc/status)
50fcc5
BuildRequires: golang(github.com/gobwas/glob)
50fcc5
BuildRequires: golang(github.com/gobwas/glob/compiler)
50fcc5
BuildRequires: golang(github.com/gobwas/glob/match)
50fcc5
BuildRequires: golang(github.com/gobwas/glob/syntax)
50fcc5
BuildRequires: golang(github.com/gobwas/glob/syntax/ast)
50fcc5
BuildRequires: golang(github.com/gobwas/glob/syntax/lexer)
50fcc5
BuildRequires: golang(github.com/gobwas/glob/util/runes)
50fcc5
BuildRequires: golang(github.com/gobwas/glob/util/strings)
50fcc5
BuildRequires: golang(github.com/gopherjs/gopherjs/js)
50fcc5
BuildRequires: golang(github.com/gorilla/websocket)
50fcc5
BuildRequires: golang(github.com/gosimple/slug)
50fcc5
BuildRequires: golang(github.com/go-sql-driver/mysql)
50fcc5
BuildRequires: golang(github.com/go-stack/stack)
50fcc5
BuildRequires: golang(github.com/go-xorm/builder)
50fcc5
BuildRequires: golang(github.com/go-xorm/core)
50fcc5
BuildRequires: golang(github.com/go-xorm/xorm)
50fcc5
BuildRequires: golang(google.golang.org/grpc)
50fcc5
BuildRequires: golang(github.com/hashicorp/go-hclog)
50fcc5
# need grpc_broker in go-plugin >= 1.0.0-1
50fcc5
BuildRequires: golang(github.com/hashicorp/go-plugin)
50fcc5
BuildRequires: golang(github.com/hashicorp/go-version)
50fcc5
BuildRequires: golang(github.com/hashicorp/yamux)
50fcc5
BuildRequires: golang(github.com/inconshreveable/log15)
50fcc5
BuildRequires: golang(github.com/jmespath/go-jmespath)
50fcc5
BuildRequires: golang(github.com/jtolds/gls)
50fcc5
BuildRequires: golang(github.com/klauspost/compress/flate)
50fcc5
BuildRequires: golang(github.com/klauspost/compress/gzip)
50fcc5
BuildRequires: golang(github.com/klauspost/compress/snappy)
50fcc5
BuildRequires: golang(github.com/klauspost/cpuid)
50fcc5
BuildRequires: golang(github.com/klauspost/crc32)
50fcc5
BuildRequires: golang(github.com/kr/pretty)
50fcc5
BuildRequires: golang(github.com/kr/text)
50fcc5
BuildRequires: golang(github.com/lib/pq)
50fcc5
BuildRequires: golang(github.com/mattn/go-colorable)
50fcc5
BuildRequires: golang(github.com/mattn/go-isatty)
50fcc5
BuildRequires: golang(github.com/mattn/go-sqlite3)
50fcc5
BuildRequires: golang(github.com/matttproud/golang_protobuf_extensions/pbutil)
50fcc5
BuildRequires: golang(github.com/mitchellh/go-testing-interface)
50fcc5
BuildRequires: golang(github.com/oklog/run)
50fcc5
BuildRequires: golang(github.com/opentracing/opentracing-go)
50fcc5
BuildRequires: golang(github.com/patrickmn/go-cache)
50fcc5
BuildRequires: golang(github.com/pkg/errors)
50fcc5
BuildRequires: golang(github.com/prometheus/client_golang/api)
50fcc5
BuildRequires: golang(github.com/prometheus/client_golang/api/prometheus/v1)
50fcc5
BuildRequires: golang(github.com/prometheus/client_model/go)
50fcc5
BuildRequires: golang-github-prometheus-common-devel
50fcc5
BuildRequires: golang(github.com/prometheus/common/expfmt)
50fcc5
BuildRequires: golang(github.com/prometheus/common/model)
50fcc5
BuildRequires: golang(github.com/prometheus/common/expfmt)
50fcc5
BuildRequires: golang(github.com/prometheus/procfs)
50fcc5
BuildRequires: golang(github.com/prometheus/procfs/internal/util)
50fcc5
BuildRequires: golang(github.com/prometheus/procfs)
50fcc5
BuildRequires: golang(github.com/prometheus/procfs/internal/util)
50fcc5
BuildRequires: golang(github.com/prometheus/procfs/nfs)
50fcc5
BuildRequires: golang(github.com/prometheus/procfs/xfs)
50fcc5
BuildRequires: golang(github.com/rainycape/unidecode)
50fcc5
BuildRequires: golang(github.com/sergi/go-diff/diffmatchpatch)
50fcc5
BuildRequires: golang(github.com/smartystreets/assertions)
50fcc5
BuildRequires: golang(github.com/smartystreets/goconvey/convey)
50fcc5
BuildRequires: golang(github.com/smartystreets/goconvey/convey/gotest)
50fcc5
BuildRequires: golang(github.com/smartystreets/goconvey/convey/reporting)
50fcc5
BuildRequires: golang(github.com/teris-io/shortid)
50fcc5
BuildRequires: golang(github.com/Unknwon/com)
50fcc5
BuildRequires: golang(github.com/VividCortex/mysqlerr)
50fcc5
BuildRequires: golang(github.com/yudai/gojsondiff)
50fcc5
BuildRequires: golang(github.com/yudai/golcs)
50fcc5
BuildRequires: golang(golang.org/x/crypto/pbkdf2)
50fcc5
BuildRequires: golang(golang.org/x/crypto/ed25519)
50fcc5
BuildRequires: golang(golang.org/x/crypto/md4)
50fcc5
BuildRequires: golang(golang.org/x/net/context)
50fcc5
BuildRequires: golang(golang.org/x/net/context/ctxhttp)
50fcc5
BuildRequires: golang(golang.org/x/net/http2)
50fcc5
BuildRequires: golang(golang.org/x/net/http2/hpack)
50fcc5
BuildRequires: golang(golang.org/x/net/http/httpguts)
50fcc5
BuildRequires: golang(golang.org/x/net/idna)
50fcc5
BuildRequires: golang(golang.org/x/net/internal/timeseries)
50fcc5
BuildRequires: golang(golang.org/x/net/trace)
50fcc5
BuildRequires: golang(golang.org/x/text/collate)
50fcc5
BuildRequires: golang(golang.org/x/text/collate/build)
50fcc5
BuildRequires: golang(golang.org/x/text/internal/colltab)
50fcc5
BuildRequires: golang(golang.org/x/text/internal/gen)
50fcc5
BuildRequires: golang(golang.org/x/text/internal/tag)
50fcc5
BuildRequires: golang(golang.org/x/text/internal/triegen)
50fcc5
BuildRequires: golang(golang.org/x/text/internal/ucd)
50fcc5
BuildRequires: golang(golang.org/x/oauth2)
50fcc5
BuildRequires: golang(golang.org/x/oauth2/google)
50fcc5
BuildRequires: golang(golang.org/x/oauth2/internal)
50fcc5
BuildRequires: golang(golang.org/x/oauth2/jws)
50fcc5
BuildRequires: golang(golang.org/x/oauth2/jwt)
50fcc5
BuildRequires: golang(github.com/golang/protobuf/proto)
50fcc5
BuildRequires: golang(github.com/golang/protobuf/ptypes)
50fcc5
BuildRequires: golang(github.com/golang/protobuf/ptypes)
50fcc5
BuildRequires: golang(github.com/golang/protobuf/ptypes/duration)
50fcc5
BuildRequires: golang(github.com/golang/protobuf/ptypes/any)
50fcc5
BuildRequires: golang(github.com/golang/protobuf/ptypes/timestamp)
50fcc5
BuildRequires: golang(cloud.google.com/go/compute/metadata)
50fcc5
BuildRequires: golang(gopkg.in/alexcesaro/quotedprintable.v3)
50fcc5
BuildRequires: golang(gopkg.in/asn1-ber.v1)
50fcc5
BuildRequires: golang(github.com/go-bufio/bufio)
50fcc5
BuildRequires: golang(github.com/go-ini/ini)
50fcc5
BuildRequires: golang(github.com/go-macaron/macaron)
50fcc5
BuildRequires: golang(github.com/go-redis/redis)
50fcc5
BuildRequires: golang(gopkg.in/square/go-jose.v2)
50fcc5
BuildRequires: golang(gopkg.in/square/go-jose.v2/cipher)
50fcc5
BuildRequires: golang(gopkg.in/square/go-jose.v2/json)
0d3998
%if 0%{fedora} >= 31
0d3998
BuildRequires: golang(gopkg.in/yaml.v2)
0d3998
%else
50fcc5
BuildRequires: golang(github.com/go-yaml/yaml)
0d3998
%endif
50fcc5
BuildRequires: golang(golang.org/x/sync/errgroup)
50fcc5
BuildRequires: golang(gopkg.in/ldap.v3)
50fcc5
BuildRequires: golang(gopkg.in/mail.v2)
0d3998
BuildRequires: golang(github.com/jonboulle/clockwork)
50fcc5
%endif
50fcc5
50fcc5
# Declare all nodejs modules bundled in the webpack - this is for security
50fcc5
# purposes so if nodejs-foo ever needs an update, affected packages can be
50fcc5
# easily identified. This is generated from package-lock.json once the webpack
50fcc5
# has been built with make_webpack.sh.
50fcc5
Provides: bundled(nodejs-abbrev) = 1.1.1
50fcc5
Provides: bundled(nodejs-ansi-regex) = 2.1.1
50fcc5
Provides: bundled(nodejs-ansi-styles) = 2.2.1
50fcc5
Provides: bundled(nodejs-argparse) = 1.0.10
50fcc5
Provides: bundled(nodejs-array-find-index) = 1.0.2
50fcc5
Provides: bundled(nodejs-async) = 1.5.2
50fcc5
Provides: bundled(nodejs-balanced-match) = 1.0.0
50fcc5
Provides: bundled(nodejs-brace-expansion) = 1.1.11
50fcc5
Provides: bundled(nodejs-builtin-modules) = 1.1.1
50fcc5
Provides: bundled(nodejs-camelcase) = 2.1.1
50fcc5
Provides: bundled(nodejs-camelcase-keys) = 2.1.0
50fcc5
Provides: bundled(nodejs-chalk) = 1.1.3
50fcc5
Provides: bundled(nodejs-coffee-script) = 1.10.0
50fcc5
Provides: bundled(nodejs-colors) = 1.1.2
50fcc5
Provides: bundled(nodejs-concat-map) = 0.0.1
50fcc5
Provides: bundled(nodejs-currently-unhandled) = 0.4.1
50fcc5
Provides: bundled(nodejs-dateformat) = 1.0.12
50fcc5
Provides: bundled(nodejs-decamelize) = 1.2.0
50fcc5
Provides: bundled(nodejs-error-ex) = 1.3.2
50fcc5
Provides: bundled(nodejs-escape-string-regexp) = 1.0.5
50fcc5
Provides: bundled(nodejs-esprima) = 2.7.3
50fcc5
Provides: bundled(nodejs-eventemitter2) = 0.4.14
50fcc5
Provides: bundled(nodejs-exit) = 0.1.2
50fcc5
Provides: bundled(nodejs-find-up) = 1.1.2
50fcc5
Provides: bundled(nodejs-findup-sync) = 0.3.0
50fcc5
Provides: bundled(nodejs-fs.realpath) = 1.0.0
50fcc5
Provides: bundled(nodejs-get-stdin) = 4.0.1
50fcc5
Provides: bundled(nodejs-getobject) = 0.1.0
50fcc5
Provides: bundled(nodejs-glob) = 7.0.6
50fcc5
Provides: bundled(nodejs-graceful-fs) = 4.1.15
50fcc5
Provides: bundled(nodejs-grunt) = 1.0.1
50fcc5
Provides: bundled(nodejs-grunt-cli) = 1.2.0
50fcc5
Provides: bundled(nodejs-grunt-known-options) = 1.1.1
50fcc5
Provides: bundled(nodejs-grunt-legacy-log) = 1.0.2
50fcc5
Provides: bundled(nodejs-lodash) = 4.17.11
50fcc5
Provides: bundled(nodejs-grunt-legacy-log-utils) = 1.0.0
50fcc5
Provides: bundled(nodejs-grunt-legacy-util) = 1.0.0
50fcc5
Provides: bundled(nodejs-has-ansi) = 2.0.0
50fcc5
Provides: bundled(nodejs-hooker) = 0.2.3
50fcc5
Provides: bundled(nodejs-hosted-git-info) = 2.7.1
50fcc5
Provides: bundled(nodejs-iconv-lite) = 0.4.24
50fcc5
Provides: bundled(nodejs-indent-string) = 2.1.0
50fcc5
Provides: bundled(nodejs-inflight) = 1.0.6
50fcc5
Provides: bundled(nodejs-inherits) = 2.0.3
50fcc5
Provides: bundled(nodejs-is-arrayish) = 0.2.1
50fcc5
Provides: bundled(nodejs-is-builtin-module) = 1.0.0
50fcc5
Provides: bundled(nodejs-is-finite) = 1.0.2
50fcc5
Provides: bundled(nodejs-is-utf8) = 0.2.1
50fcc5
Provides: bundled(nodejs-isexe) = 2.0.0
50fcc5
Provides: bundled(nodejs-js-yaml) = 3.5.5
50fcc5
Provides: bundled(nodejs-load-json-file) = 1.1.0
50fcc5
Provides: bundled(nodejs-loud-rejection) = 1.6.0
50fcc5
Provides: bundled(nodejs-map-obj) = 1.0.1
50fcc5
Provides: bundled(nodejs-meow) = 3.7.0
50fcc5
Provides: bundled(nodejs-minimatch) = 3.0.4
50fcc5
Provides: bundled(nodejs-minimist) = 1.2.0
50fcc5
Provides: bundled(nodejs-nopt) = 3.0.6
50fcc5
Provides: bundled(nodejs-normalize-package-data) = 2.4.2
50fcc5
Provides: bundled(nodejs-number-is-nan) = 1.0.1
50fcc5
Provides: bundled(nodejs-object-assign) = 4.1.1
50fcc5
Provides: bundled(nodejs-once) = 1.4.0
50fcc5
Provides: bundled(nodejs-parse-json) = 2.2.0
50fcc5
Provides: bundled(nodejs-path-exists) = 2.1.0
50fcc5
Provides: bundled(nodejs-path-is-absolute) = 1.0.1
50fcc5
Provides: bundled(nodejs-path-type) = 1.1.0
50fcc5
Provides: bundled(nodejs-pify) = 2.3.0
50fcc5
Provides: bundled(nodejs-pinkie) = 2.0.4
50fcc5
Provides: bundled(nodejs-pinkie-promise) = 2.0.1
50fcc5
Provides: bundled(nodejs-read-pkg) = 1.1.0
50fcc5
Provides: bundled(nodejs-read-pkg-up) = 1.0.1
50fcc5
Provides: bundled(nodejs-redent) = 1.0.0
50fcc5
Provides: bundled(nodejs-repeating) = 2.0.1
50fcc5
Provides: bundled(nodejs-resolve) = 1.1.7
50fcc5
Provides: bundled(nodejs-rimraf) = 2.2.8
50fcc5
Provides: bundled(nodejs-safer-buffer) = 2.1.2
50fcc5
Provides: bundled(nodejs-semver) = 5.6.0
50fcc5
Provides: bundled(nodejs-signal-exit) = 3.0.2
50fcc5
Provides: bundled(nodejs-spdx-correct) = 3.1.0
50fcc5
Provides: bundled(nodejs-spdx-exceptions) = 2.2.0
50fcc5
Provides: bundled(nodejs-spdx-expression-parse) = 3.0.0
50fcc5
Provides: bundled(nodejs-spdx-license-ids) = 3.0.3
50fcc5
Provides: bundled(nodejs-sprintf-js) = 1.0.3
50fcc5
Provides: bundled(nodejs-strip-ansi) = 3.0.1
50fcc5
Provides: bundled(nodejs-strip-bom) = 2.0.0
50fcc5
Provides: bundled(nodejs-strip-indent) = 1.0.1
50fcc5
Provides: bundled(nodejs-supports-color) = 2.0.0
50fcc5
Provides: bundled(nodejs-trim-newlines) = 1.0.0
50fcc5
Provides: bundled(nodejs-underscore.string) = 3.2.3
50fcc5
Provides: bundled(nodejs-validate-npm-package-license) = 3.0.4
50fcc5
Provides: bundled(nodejs-which) = 1.2.14
50fcc5
Provides: bundled(nodejs-wrappy) = 1.0.2
50fcc5
Provides: bundled(nodejs-yarn) = 1.13.0
50fcc5
50fcc5
50fcc5
%description
50fcc5
Grafana is an open source, feature rich metrics dashboard and graph editor for
50fcc5
Graphite, InfluxDB & OpenTSDB.
50fcc5
50fcc5
50fcc5
%package cloudwatch
50fcc5
Requires: %{name} = %{version}-%{release}
50fcc5
Summary: Grafana cloudwatch datasource
50fcc5
50fcc5
%description cloudwatch
50fcc5
The Grafana cloudwatch datasource.
50fcc5
50fcc5
%package elasticsearch
50fcc5
Requires: %{name} = %{version}-%{release}
50fcc5
Summary: Grafana elasticsearch datasource
50fcc5
50fcc5
%description elasticsearch
50fcc5
The Grafana elasticsearch datasource.
50fcc5
50fcc5
%package azure-monitor
50fcc5
Requires: %{name} = %{version}-%{release}
50fcc5
Summary: Grafana azure-monitor datasource
50fcc5
50fcc5
%description azure-monitor
50fcc5
The Grafana azure-monitor datasource.
50fcc5
50fcc5
%package graphite
50fcc5
Requires: %{name} = %{version}-%{release}
50fcc5
Summary: Grafana graphite datasource
50fcc5
50fcc5
%description graphite
50fcc5
The Grafana graphite datasource.
50fcc5
50fcc5
%package influxdb
50fcc5
Requires: %{name} = %{version}-%{release}
50fcc5
Summary: Grafana influxdb datasource
50fcc5
50fcc5
%description influxdb
50fcc5
The Grafana influxdb datasource.
50fcc5
50fcc5
%package loki
50fcc5
Requires: %{name} = %{version}-%{release}
50fcc5
Summary: Grafana loki datasource
50fcc5
50fcc5
%description loki
50fcc5
The Grafana loki datasource.
50fcc5
50fcc5
%package mssql
50fcc5
Requires: %{name} = %{version}-%{release}
50fcc5
Summary: Grafana mssql datasource
50fcc5
50fcc5
%description mssql
50fcc5
The Grafana mssql datasource.
50fcc5
50fcc5
%package mysql
50fcc5
Requires: %{name} = %{version}-%{release}
50fcc5
Summary: Grafana mysql datasource
50fcc5
50fcc5
%description mysql
50fcc5
The Grafana mysql datasource.
50fcc5
50fcc5
%package opentsdb
50fcc5
Requires: %{name} = %{version}-%{release}
50fcc5
Summary: Grafana opentsdb datasource
50fcc5
50fcc5
%description opentsdb
50fcc5
The Grafana opentsdb datasource.
50fcc5
50fcc5
%package postgres
50fcc5
Requires: %{name} = %{version}-%{release}
50fcc5
Summary: Grafana postgres datasource
50fcc5
50fcc5
%description postgres
50fcc5
The Grafana postgres datasource.
50fcc5
50fcc5
%package prometheus
50fcc5
Requires: %{name} = %{version}-%{release}
50fcc5
Summary: Grafana prometheus datasource
50fcc5
50fcc5
%description prometheus
50fcc5
The Grafana prometheus datasource.
50fcc5
50fcc5
%package stackdriver
50fcc5
Requires: %{name} = %{version}-%{release}
50fcc5
Summary: Grafana stackdriver datasource
50fcc5
50fcc5
%description stackdriver
50fcc5
The Grafana stackdriver datasource.
50fcc5
50fcc5
50fcc5
%prep
50fcc5
%setup -q -T -D -b 0
50fcc5
%setup -q -T -D -b 1
50fcc5
%patch1 -p1
50fcc5
%patch2 -p1
50fcc5
%patch3 -p1
0d3998
%patch4 -p1
0d3998
%patch5 -p1
50fcc5
50fcc5
# Set up build subdirs and links
50fcc5
mkdir -p %{_builddir}/src/github.com/grafana
50fcc5
ln -sf %{_builddir}/%{name}-%{version} \
50fcc5
    %{_builddir}/src/github.com/grafana/grafana
50fcc5
50fcc5
# remove some (apparent) development files, for rpmlint
50fcc5
rm -f public/sass/.sass-lint.yml public/test/.jshintrc
50fcc5
50fcc5
%if 0%{?unbundle_vendor_sources}
50fcc5
# Unbundle all grafana vendor sources, as per BuildRequires above.
50fcc5
# An exception is grafana-plugin-model, which is part of grafana.
0d3998
cp --parents -a vendor/github.com/grafana \
0d3998
    vendor/golang.org/x/xerrors \
0d3998
    vendor/github.com/robfig vendor/github.com/crewjam/saml \
0d3998
    vendor/github.com/ua-parser/uap-go/uaparser  \
0d3998
    vendor/github.com/beevik/etree \
0d3998
    vendor/github.com/russellhaering/goxmldsig \
0d3998
    %{_builddir}
50fcc5
rm -r vendor # remove all vendor sources
50fcc5
mv %{_builddir}/vendor vendor # put back what we're keeping
50fcc5
%endif
50fcc5
50fcc5
50fcc5
%build
0d3998
# Build the server-side binaries
50fcc5
cd %{_builddir}/src/github.com/grafana/grafana
0d3998
%global archbindir bin/`go env GOOS`-`go env GOARCH`
0d3998
echo _builddir=%{_builddir} archbindir=%{archbindir}
0d3998
[ ! -d %{archbindir} ] && mkdir -p %{archbindir}
50fcc5
export GOPATH=%{_builddir}:%{gopath}
0d3998
# export GO111MODULE=off
0d3998
%if 0%{?fedora} >= 31
0d3998
# native fedora golang build but without modules (no grafana support yet)
0d3998
go build -mod=vendor -o %{archbindir}/grafana-cli ./pkg/cmd/grafana-cli
0d3998
go build -mod=vendor -o %{archbindir}/grafana-server ./pkg/cmd/grafana-server
0d3998
%else
0d3998
# use the grafana build.go script.
50fcc5
go run build.go build
50fcc5
%endif
50fcc5
50fcc5
50fcc5
%install
50fcc5
# Fix up arch bin directories
50fcc5
[ ! -d bin/x86_64 ] && ln -sf linux-amd64 bin/x86_64
50fcc5
[ ! -d bin/i386 ] && ln -sf linux-386 bin/i386
50fcc5
[ ! -d bin/ppc64le ] && ln -sf linux-ppc64le bin/ppc64le
50fcc5
[ ! -d bin/s390x ] && ln -sf linux-s390x bin/s390x
50fcc5
[ ! -d bin/arm ] && ln -sf linux-arm bin/arm
50fcc5
[ ! -d bin/arm64 ] && ln -sf linux-arm64 bin/aarch64
50fcc5
[ ! -d bin/aarch64 ] && ln -sf linux-aarch64 bin/aarch64
50fcc5
0d3998
# dirs, shared files, public html, webpack
50fcc5
install -d %{buildroot}%{_sbindir}
0d3998
install -d %{buildroot}%{_datadir}/%{name}/bin
50fcc5
cp -a conf public %{buildroot}%{_datadir}/%{name}
50fcc5
0d3998
# wrappers
0d3998
install -p -m 755 packaging/wrappers/grafana-cli %{buildroot}%{_sbindir}/%{name}-cli
0d3998
0d3998
# binaries
0d3998
install -p -m 755 %{archbindir}/%{name}-server %{buildroot}%{_sbindir}
0d3998
install -p -m 755 %{archbindir}/%{name}-cli %{buildroot}%{_datadir}/%{name}/bin
0d3998
50fcc5
# man pages
50fcc5
install -d %{buildroot}%{_mandir}/man1
50fcc5
install -p -m 644 docs/man/man1/* %{buildroot}%{_mandir}/man1
50fcc5
50fcc5
# config dirs
50fcc5
install -d %{buildroot}%{_sysconfdir}/%{name}
50fcc5
install -d %{buildroot}%{_sysconfdir}/sysconfig
50fcc5
50fcc5
# config defaults
50fcc5
install -p -m 644 conf/distro-defaults.ini \
50fcc5
    %{buildroot}%{_sysconfdir}/%{name}/grafana.ini
50fcc5
install -p -m 644 conf/distro-defaults.ini \
50fcc5
    %{buildroot}%{_datadir}/%{name}/conf/defaults.ini
50fcc5
install -p -m 644 conf/ldap.toml %{buildroot}%{_sysconfdir}/%{name}/ldap.toml
50fcc5
install -p -m 644 packaging/rpm/sysconfig/grafana-server \
50fcc5
    %{buildroot}%{_sysconfdir}/sysconfig/grafana-server
50fcc5
50fcc5
# config database directory and plugins
50fcc5
install -d %{buildroot}%{_sharedstatedir}/%{name}
50fcc5
install -d -m 755 %{buildroot}%{_sharedstatedir}/%{name}
50fcc5
install -d -m 755 %{buildroot}%{_sharedstatedir}/%{name}/plugins
50fcc5
50fcc5
# log directory
50fcc5
install -d %{buildroot}%{_localstatedir}/log/%{name}
50fcc5
50fcc5
# systemd service files
50fcc5
install -d %{buildroot}%{_unitdir} # only needed for manual rpmbuilds
50fcc5
install -p -m 644 packaging/rpm/systemd/grafana-server.service \
50fcc5
    %{buildroot}%{_unitdir}
50fcc5
50fcc5
# daemon run pid file config for using tmpfs
50fcc5
install -d %{buildroot}%{_tmpfilesdir}
50fcc5
echo "d %{_rundir}/%{name} 0755 %{GRAFANA_USER} %{GRAFANA_GROUP} -" \
50fcc5
    > %{buildroot}%{_tmpfilesdir}/%{name}.conf
50fcc5
50fcc5
%pre
50fcc5
getent group %{GRAFANA_GROUP} >/dev/null || groupadd -r %{GRAFANA_GROUP}
50fcc5
getent passwd %{GRAFANA_USER} >/dev/null || \
50fcc5
    useradd -r -g %{GRAFANA_GROUP} -d %{GRAFANA_HOME} -s /sbin/nologin \
50fcc5
    -c "%{GRAFANA_USER} user account" %{GRAFANA_USER}
50fcc5
exit 0
50fcc5
50fcc5
%preun
50fcc5
%systemd_preun grafana-server.service
50fcc5
50fcc5
%post
50fcc5
%systemd_post grafana-server.service
50fcc5
50fcc5
%postun
50fcc5
%systemd_postun_with_restart grafana-server.service
50fcc5
50fcc5
50fcc5
%check
50fcc5
cd %{_builddir}/src/github.com/grafana/grafana
50fcc5
export GOPATH=%{_builddir}:%{gopath}
50fcc5
# remove tests currently failing
50fcc5
rm -f pkg/services/provisioning/dashboards/file_reader_linux_test.go
50fcc5
rm -f pkg/services/provisioning/dashboards/file_reader_test.go
50fcc5
rm -f pkg/services/sqlstore/alert_test.go
0d3998
rm -f pkg/services/sqlstore/apikey_test.go
0d3998
export GO111MODULE=off
50fcc5
go test ./pkg/...
50fcc5
50fcc5
50fcc5
%files
50fcc5
# binaries
50fcc5
%{_sbindir}/%{name}-server
50fcc5
%{_sbindir}/%{name}-cli
50fcc5
50fcc5
# config files
50fcc5
%dir %{_sysconfdir}/%{name}
50fcc5
%config(noreplace) %attr(644, root, %{GRAFANA_GROUP}) %{_sysconfdir}/%{name}/grafana.ini
50fcc5
%config(noreplace) %attr(644, root, %{GRAFANA_GROUP}) %{_sysconfdir}/%{name}/ldap.toml
50fcc5
%config(noreplace) %{_sysconfdir}/sysconfig/grafana-server
50fcc5
50fcc5
# Grafana configuration to dynamically create /run/grafana/grafana.pid on tmpfs
50fcc5
%{_tmpfilesdir}/%{name}.conf
50fcc5
50fcc5
# config database directory and plugins (actual db files are created by grafana-server)
50fcc5
%attr(-, %{GRAFANA_USER}, %{GRAFANA_GROUP}) %dir %{_sharedstatedir}/%{name}
50fcc5
%attr(-, %{GRAFANA_USER}, %{GRAFANA_GROUP}) %dir %{_sharedstatedir}/%{name}/plugins
50fcc5
50fcc5
# shared directory and all files therein, except some datasources
0d3998
%{_datadir}/%{name}/bin
50fcc5
%{_datadir}/%{name}/public
50fcc5
50fcc5
# built-in datasources that are sub-packaged
50fcc5
%global dsdir %{_datadir}/%{name}/public/app/plugins/datasource
50fcc5
%exclude %{dsdir}/cloudwatch 
50fcc5
%exclude %{dsdir}/elasticsearch 
50fcc5
%exclude %{dsdir}/graphite
50fcc5
%exclude %{dsdir}/grafana-azure-monitor-datasource
50fcc5
%exclude %{dsdir}/influxdb
50fcc5
%exclude %{dsdir}/loki
50fcc5
%exclude %{dsdir}/mssql
50fcc5
%exclude %{dsdir}/mysql
50fcc5
%exclude %{dsdir}/opentsdb
50fcc5
%exclude %{dsdir}/postgres
50fcc5
%exclude %{dsdir}/prometheus
50fcc5
%exclude %{dsdir}/stackdriver
50fcc5
50fcc5
%dir %{_datadir}/%{name}/conf
50fcc5
%attr(-, root, %{GRAFANA_GROUP}) %{_datadir}/%{name}/conf/*
50fcc5
50fcc5
# systemd service file
50fcc5
%{_unitdir}/grafana-server.service
50fcc5
50fcc5
# log directory - grafana.log is created by grafana-server, and it does it's own log rotation
50fcc5
%attr(0755, %{GRAFANA_USER}, %{GRAFANA_GROUP}) %dir %{_localstatedir}/log/%{name}
50fcc5
50fcc5
# man pages for grafana binaries
50fcc5
%{_mandir}/man1/%{name}-server.1*
50fcc5
%{_mandir}/man1/%{name}-cli.1*
50fcc5
50fcc5
# other docs and license
50fcc5
%license LICENSE
50fcc5
%doc CHANGELOG.md CODE_OF_CONDUCT.md CONTRIBUTING.md NOTICE.md
50fcc5
%doc PLUGIN_DEV.md README.md ROADMAP.md UPGRADING_DEPENDENCIES.md
50fcc5
50fcc5
#
50fcc5
# datasources split out into subpackages
50fcc5
#
50fcc5
%files cloudwatch
50fcc5
%{_datadir}/%{name}/public/app/plugins/datasource/cloudwatch
50fcc5
50fcc5
%files elasticsearch
50fcc5
%{_datadir}/%{name}/public/app/plugins/datasource/elasticsearch
50fcc5
50fcc5
%files azure-monitor
50fcc5
%{_datadir}/%{name}/public/app/plugins/datasource/grafana-azure-monitor-datasource
50fcc5
50fcc5
%files graphite
50fcc5
%{_datadir}/%{name}/public/app/plugins/datasource/graphite
50fcc5
50fcc5
%files influxdb
50fcc5
%{_datadir}/%{name}/public/app/plugins/datasource/influxdb
50fcc5
50fcc5
%files loki
50fcc5
%{_datadir}/%{name}/public/app/plugins/datasource/loki
50fcc5
50fcc5
%files mssql
50fcc5
%{_datadir}/%{name}/public/app/plugins/datasource/mssql
50fcc5
50fcc5
%files mysql
50fcc5
%{_datadir}/%{name}/public/app/plugins/datasource/mysql
50fcc5
50fcc5
%files opentsdb
50fcc5
%{_datadir}/%{name}/public/app/plugins/datasource/opentsdb
50fcc5
50fcc5
%files postgres
50fcc5
%{_datadir}/%{name}/public/app/plugins/datasource/postgres
50fcc5
50fcc5
%files prometheus
50fcc5
%{_datadir}/%{name}/public/app/plugins/datasource/prometheus
50fcc5
50fcc5
%files stackdriver
50fcc5
%{_datadir}/%{name}/public/app/plugins/datasource/stackdriver
50fcc5
50fcc5
50fcc5
%changelog
0d3998
* Wed Nov 20 2019 Mark Goodwin <mgoodwin@redhat.com> 6.3.6-1
0d3998
- add weak depenency on grafana-pcp
0d3998
- add patch to mute shellcheck SC1090 for grafana-cli
0d3998
- update to 6.3.6 upstream community sources, see CHANGELOG
0d3998
0d3998
* Thu Sep 05 2019 Mark Goodwin <mgoodwin@redhat.com> 6.3.5-1
0d3998
- drop uaparser patch now it's upstream
0d3998
- add xerrors patch, see https://github.com/golang/go/issues/32246
0d3998
- use vendor sources on rawhide until modules are fully supported
0d3998
- update to latest upstream community sources, see CHANGELOG
0d3998
0d3998
* Fri Aug 30 2019 Mark Goodwin <mgoodwin@redhat.com> 6.3.4-1
0d3998
- include fix for CVE-2019-15043
0d3998
- add patch for uaparser on 32bit systems
0d3998
- update to latest upstream community sources, see CHANGELOG
0d3998
0d3998
* Wed Jul 31 2019 Mark Goodwin <mgoodwin@redhat.com> 6.2.5-1
0d3998
- update to latest upstream community sources, see CHANGELOG
0d3998
0d3998
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 6.2.2-2
0d3998
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
50fcc5
50fcc5
* Fri Jun 07 2019 Mark Goodwin <mgoodwin@redhat.com> 6.2.2-1
50fcc5
- split out some datasource plugins to sub-packages
50fcc5
- update to latest upstream community sources, see CHANGELOG
50fcc5
50fcc5
* Wed Jun 05 2019 Mark Goodwin <mgoodwin@redhat.com> 6.2.1-1
50fcc5
- update to latest upstream community sources, see CHANGELOG
50fcc5
50fcc5
* Fri May 24 2019 Mark Goodwin <mgoodwin@redhat.com> 6.2.0-1
50fcc5
- update to latest upstream community sources
50fcc5
- drop a couple of patches
50fcc5
50fcc5
* Wed May 08 2019 Mark Goodwin <mgoodwin@redhat.com> 6.1.6-2
50fcc5
- add conditional unbundle_vendor_sources macro
50fcc5
50fcc5
* Tue Apr 30 2019 Mark Goodwin <mgoodwin@redhat.com> 6.1.6-1
50fcc5
- update to latest upstream stable release 6.1.6, see CHANGELOG
50fcc5
- includes jQuery 3.4.0 security update
50fcc5
50fcc5
* Wed Apr 24 2019 Mark Goodwin <mgoodwin@redhat.com> 6.1.4-1
50fcc5
- update to latest upstream stable release 6.1.4, see CHANGELOG
50fcc5
- use gobuild and gochecks macros, eliminate arch symlinks
50fcc5
- re-enable grafana-debugsource package
50fcc5
- fix GRAFANA_GROUP typo
50fcc5
- fix more modes for brp-mangle-shebangs
50fcc5
- vendor source unbundling now done in prep after patches
50fcc5
- remove all rhel and fedora conditional guff
50fcc5
50fcc5
* Tue Apr 16 2019 Mark Goodwin <mgoodwin@redhat.com> 6.1.3-1
50fcc5
- update to latest upstream stable release 6.1.3, see CHANGELOG
50fcc5
- unbundle all vendor sources, replace with BuildRequires, see
50fcc5
  the long list of blocker BZs linked to BZ#1670656
50fcc5
- BuildRequires go-plugin >= v1.0.0 for grpc_broker (thanks eclipseo)
50fcc5
- tweak make_webpack to no longer use grunt, switch to prod build
50fcc5
- add ExclusiveArch lua script (thanks quantum.analyst)
50fcc5
- move db directory and plugins to /var/lib/grafana
50fcc5
- split out into 6 patches, ready for upstream PRs
50fcc5
- add check to run go tests for gating checks
50fcc5
50fcc5
* Thu Apr 04 2019 Mark Goodwin <mgoodwin@redhat.com> 6.1.0-1
50fcc5
- update to latest upstream stable release 6.1.0, see CHANGELOG
50fcc5
50fcc5
* Thu Mar 21 2019 Mark Goodwin <mgoodwin@redhat.com> 6.0.2-1
50fcc5
- bump to latest upstream stable release 6.0.2-1
50fcc5
- unbundle almost all remaining vendor code, see linked blockers in BZ#1670656
50fcc5
50fcc5
* Fri Mar 15 2019 Mark Goodwin <mgoodwin@redhat.com> 6.0.1-3
50fcc5
- bump to latest upstream stable release 6.0.1-1
50fcc5
50fcc5
* Thu Mar 14 2019 Mark Goodwin <mgoodwin@redhat.com> 6.0.1-2
50fcc5
- unbundle and add BuildRequires for golang-github-rainycape-unidecode-devel
50fcc5
50fcc5
* Thu Mar 07 2019 Mark Goodwin <mgoodwin@redhat.com> 6.0.1-1
50fcc5
- update to v6.0.1 upstream sources, tweak distro config, re-do patch
50fcc5
- simplify make_webpack.sh script (Elliott Sales de Andrade)
50fcc5
- vendor/github.com/go-ldap is now gone, so don't unbundle it
50fcc5
50fcc5
* Thu Mar 07 2019 Mark Goodwin <mgoodwin@redhat.com> 5.4.3-11
50fcc5
- tweak after latest feedback, bump to 5.4.3-11 (BZ 1670656)
50fcc5
- build debuginfo package again
50fcc5
- unbundle BuildRequires for golang-github-hashicorp-version-devel
50fcc5
- remove some unneeded development files
50fcc5
- remove macros from changelog and other rpmlint tweaks
50fcc5
50fcc5
* Fri Feb 22 2019 Mark Goodwin <mgoodwin@redhat.com> 5.4.3-10
50fcc5
- tweak spec for available and unavailable (bundled) golang packages
50fcc5
50fcc5
* Wed Feb 20 2019 Xavier Bachelot <xavier@bachelot.org> 5.4.3-9
50fcc5
- Remove extraneous slash (cosmetic)
50fcc5
- Create directories just before moving stuff in them
50fcc5
- Truncate long lines
50fcc5
- Group all golang stuff
50fcc5
- Simplify BuildRequires/bundled Provides
50fcc5
- Sort BuildRequires/bundled Provides
50fcc5
- Fix bundled go packages Provides
50fcc5
50fcc5
* Fri Feb 15 2019 Mark Goodwin <mgoodwin@redhat.com> 5.4.3-8
50fcc5
- add BuildRequires (and unbundle) vendor sources available in Fedora
50fcc5
- declare Provides for remaining (bundled) vendor go sources
50fcc5
- do not attempt to unbundle anything on RHEL < 7 or Fedora < 28
50fcc5
50fcc5
* Thu Feb 07 2019 Mark Goodwin <mgoodwin@redhat.com> 5.4.3-7
50fcc5
- further refinement for spec doc section from Xavier Bachelot
50fcc5
- disable debug_package to avoid empty debugsourcefiles.list
50fcc5
50fcc5
* Wed Feb 06 2019 Mark Goodwin <mgoodwin@redhat.com> 5.4.3-6
50fcc5
- further refinement following review by Xavier Bachelot
50fcc5
50fcc5
* Tue Feb 05 2019 Mark Goodwin <mgoodwin@redhat.com> 5.4.3-5
50fcc5
- further refinement following review by Xavier Bachelot
50fcc5
50fcc5
* Fri Feb 01 2019 Mark Goodwin <mgoodwin@redhat.com> 5.4.3-4
50fcc5
- further spec updates after packaging review
50fcc5
- reworked post-install scriplets
50fcc5
50fcc5
* Thu Jan 31 2019 Mark Goodwin <mgoodwin@redhat.com> 5.4.3-3
50fcc5
- tweak FHS patch, update spec after packaging review
50fcc5
50fcc5
* Wed Jan 30 2019 Mark Goodwin <mgoodwin@redhat.com> 5.4.3-2
50fcc5
- add patch to be standard FHS compliant, remove phantomjs
50fcc5
- update to v5.4.3 upstream community sources
50fcc5
50fcc5
* Wed Jan 09 2019 Mark Goodwin <mgoodwin@redhat.com> 5.4.2-1
50fcc5
- update to v5.4.2 upstream community sources
50fcc5
50fcc5
* Thu Oct 18 2018 Mark Goodwin <mgoodwin@redhat.com> 5.3.1-1
50fcc5
- update to v5.3.1 upstream community sources
50fcc5
50fcc5
* Tue Oct 02 2018 Mark Goodwin <mgoodwin@redhat.com> 5.2.5-1
50fcc5
- native RPM spec build with current tagged v5.2.5 sources