Update to latest upstream sources v6.6.2

This commit is contained in:
Mark Goodwin 2020-02-26 08:38:50 +11:00
parent 62208e25fb
commit 2e8a4f2b32
15 changed files with 718 additions and 408 deletions

2
.gitignore vendored
View File

@ -8,3 +8,5 @@
/grafana_webpack-6.3.5.tar.gz /grafana_webpack-6.3.5.tar.gz
/grafana-6.3.6.tar.gz /grafana-6.3.6.tar.gz
/grafana_webpack-6.3.6.tar.gz /grafana_webpack-6.3.6.tar.gz
/grafana-6.6.2.tar.gz
/grafana_webpack-6.6.2.tar.gz

View File

@ -0,0 +1,15 @@
diff --git a/pkg/cmd/grafana-server/main.go b/pkg/cmd/grafana-server/main.go
index 14d6036e82..d2e61564f2 100644
--- a/pkg/cmd/grafana-server/main.go
+++ b/pkg/cmd/grafana-server/main.go
@@ -32,8 +32,8 @@ import (
_ "github.com/grafana/grafana/pkg/tsdb/testdatasource"
)
-var version = "5.0.0"
-var commit = "NA"
+var version = "6.6.2"
+var commit = "3fa63cfc34668781c7f9b3caafe6d9d400b06b7f"
var buildBranch = "master"
var buildstamp string

View File

@ -1,8 +1,8 @@
diff --git a/pkg/api/login_oauth.go b/pkg/api/login_oauth.go diff --git a/pkg/api/login_oauth.go b/pkg/api/login_oauth.go
index a46c97238..76fc8480c 100644 index c8c9f05b33..1b5a67aec2 100644
--- a/pkg/api/login_oauth.go --- a/pkg/api/login_oauth.go
+++ b/pkg/api/login_oauth.go +++ b/pkg/api/login_oauth.go
@@ -125,7 +125,7 @@ func (hs *HTTPServer) OAuthLogin(ctx *m.ReqContext) { @@ -134,7 +134,7 @@ func (hs *HTTPServer) OAuthLogin(ctx *m.ReqContext) {
oauthCtx := context.WithValue(context.Background(), oauth2.HTTPClient, oauthClient) oauthCtx := context.WithValue(context.Background(), oauth2.HTTPClient, oauthClient)
// get token from provider // get token from provider

View File

@ -1,5 +1,5 @@
diff --git a/pkg/cmd/grafana-server/server.go b/pkg/cmd/grafana-server/server.go diff --git a/pkg/cmd/grafana-server/server.go b/pkg/cmd/grafana-server/server.go
index 85d6db43e..6de99b58b 100644 index 0dace4ebab..f1a4bfde53 100644
--- a/pkg/cmd/grafana-server/server.go --- a/pkg/cmd/grafana-server/server.go
+++ b/pkg/cmd/grafana-server/server.go +++ b/pkg/cmd/grafana-server/server.go
@@ -23,7 +23,6 @@ import ( @@ -23,7 +23,6 @@ import (
@ -12,10 +12,10 @@ index 85d6db43e..6de99b58b 100644
"github.com/grafana/grafana/pkg/login/social" "github.com/grafana/grafana/pkg/login/social"
diff --git a/pkg/infra/tracing/tracing.go b/pkg/infra/tracing/tracing.go diff --git a/pkg/infra/tracing/tracing.go b/pkg/infra/tracing/tracing.go
deleted file mode 100644 deleted file mode 100644
index d1511a533..000000000 index 923459786b..0000000000
--- a/pkg/infra/tracing/tracing.go --- a/pkg/infra/tracing/tracing.go
+++ /dev/null +++ /dev/null
@@ -1,148 +0,0 @@ @@ -1,161 +0,0 @@
-package tracing -package tracing
- -
-import ( -import (
@ -56,7 +56,7 @@ index d1511a533..000000000
- ts.parseSettings() - ts.parseSettings()
- -
- if ts.enabled { - if ts.enabled {
- ts.initGlobalTracer() - return ts.initGlobalTracer()
- } - }
- -
- return nil - return nil
@ -80,7 +80,7 @@ index d1511a533..000000000
- ts.disableSharedZipkinSpans = section.Key("disable_shared_zipkin_spans").MustBool(false) - ts.disableSharedZipkinSpans = section.Key("disable_shared_zipkin_spans").MustBool(false)
-} -}
- -
-func (ts *TracingService) initGlobalTracer() error { -func (ts *TracingService) initJaegerCfg() (jaegercfg.Configuration, error) {
- cfg := jaegercfg.Configuration{ - cfg := jaegercfg.Configuration{
- ServiceName: "grafana", - ServiceName: "grafana",
- Disabled: !ts.enabled, - Disabled: !ts.enabled,
@ -94,6 +94,19 @@ index d1511a533..000000000
- }, - },
- } - }
- -
- _, err := cfg.FromEnv()
- if err != nil {
- return cfg, err
- }
- return cfg, nil
-}
-
-func (ts *TracingService) initGlobalTracer() error {
- cfg, err := ts.initJaegerCfg()
- if err != nil {
- return err
- }
-
- jLogger := &jaegerLogWrapper{logger: log.New("jaeger")} - jLogger := &jaegerLogWrapper{logger: log.New("jaeger")}
- -
- options := []jaegercfg.Option{} - options := []jaegercfg.Option{}
@ -120,7 +133,7 @@ index d1511a533..000000000
- return err - return err
- } - }
- -
- opentracing.InitGlobalTracer(tracer) - opentracing.SetGlobalTracer(tracer)
- -
- ts.closer = closer - ts.closer = closer
- -
@ -166,13 +179,18 @@ index d1511a533..000000000
-} -}
diff --git a/pkg/infra/tracing/tracing_test.go b/pkg/infra/tracing/tracing_test.go diff --git a/pkg/infra/tracing/tracing_test.go b/pkg/infra/tracing/tracing_test.go
deleted file mode 100644 deleted file mode 100644
index 27e4de777..000000000 index a6d71cf165..0000000000
--- a/pkg/infra/tracing/tracing_test.go --- a/pkg/infra/tracing/tracing_test.go
+++ /dev/null +++ /dev/null
@@ -1,36 +0,0 @@ @@ -1,94 +0,0 @@
-package tracing -package tracing
- -
-import "testing" -import (
- "github.com/stretchr/testify/assert"
- "github.com/stretchr/testify/require"
- "os"
- "testing"
-)
- -
-func TestGroupSplit(t *testing.T) { -func TestGroupSplit(t *testing.T) {
- tests := []struct { - tests := []struct {
@ -200,9 +218,62 @@ index 27e4de777..000000000
- tags := splitTagSettings(test.input) - tags := splitTagSettings(test.input)
- for k, v := range test.expected { - for k, v := range test.expected {
- value, exists := tags[k] - value, exists := tags[k]
- if !exists || value != v { - assert.Truef(t, exists, "Tag %q not found for input %q", k, test.input)
- t.Errorf("tags does not match %v ", test) - assert.Equalf(t, v, value, "Tag %q has wrong value for input %q", k, test.input)
- }
- } - }
- } - }
-} -}
-
-func TestInitJaegerCfg_Default(t *testing.T) {
- ts := &TracingService{}
- cfg, err := ts.initJaegerCfg()
- require.NoError(t, err)
-
- assert.True(t, cfg.Disabled)
-}
-
-func TestInitJaegerCfg_Enabled(t *testing.T) {
- ts := &TracingService{enabled: true}
- cfg, err := ts.initJaegerCfg()
- require.NoError(t, err)
-
- assert.False(t, cfg.Disabled)
- assert.Equal(t, "localhost:6831", cfg.Reporter.LocalAgentHostPort)
-}
-
-func TestInitJaegerCfg_DisabledViaEnv(t *testing.T) {
- os.Setenv("JAEGER_DISABLED", "true")
- defer func() {
- os.Unsetenv("JAEGER_DISABLED")
- }()
-
- ts := &TracingService{enabled: true}
- cfg, err := ts.initJaegerCfg()
- require.NoError(t, err)
-
- assert.True(t, cfg.Disabled)
-}
-
-func TestInitJaegerCfg_EnabledViaEnv(t *testing.T) {
- os.Setenv("JAEGER_DISABLED", "false")
- defer func() {
- os.Unsetenv("JAEGER_DISABLED")
- }()
-
- ts := &TracingService{enabled: false}
- cfg, err := ts.initJaegerCfg()
- require.NoError(t, err)
-
- assert.False(t, cfg.Disabled)
-}
-
-func TestInitJaegerCfg_InvalidEnvVar(t *testing.T) {
- os.Setenv("JAEGER_DISABLED", "totallybogus")
- defer func() {
- os.Unsetenv("JAEGER_DISABLED")
- }()
-
- ts := &TracingService{}
- _, err := ts.initJaegerCfg()
- require.EqualError(t, err, "cannot parse env var JAEGER_DISABLED=totallybogus: strconv.ParseBool: parsing \"totallybogus\": invalid syntax")
-}

View File

@ -1,9 +1,9 @@
diff --git a/conf/distro-defaults.ini b/conf/distro-defaults.ini diff --git a/conf/distro-defaults.ini b/conf/distro-defaults.ini
new file mode 100644 new file mode 100644
index 0000000000..e337ba0b57 index 0000000000..e9d3cb9593
--- /dev/null --- /dev/null
+++ b/conf/distro-defaults.ini +++ b/conf/distro-defaults.ini
@@ -0,0 +1,685 @@ @@ -0,0 +1,706 @@
+##################### Grafana Configuration Defaults for distros ##################### +##################### Grafana Configuration Defaults for distros #####################
+# +#
+# Do not modify this file in grafana installs +# Do not modify this file in grafana installs
@ -34,7 +34,7 @@ index 0000000000..e337ba0b57
+ +
+#################################### Server ############################## +#################################### Server ##############################
+[server] +[server]
+# Protocol (http, https, socket) +# Protocol (http, https, h2, socket)
+protocol = http +protocol = http
+ +
+# The ip address to bind to, empty will bind to all interfaces +# The ip address to bind to, empty will bind to all interfaces
@ -122,7 +122,7 @@ index 0000000000..e337ba0b57
+ +
+# cache connectionstring options +# cache connectionstring options
+# database: will use Grafana primary database. +# database: will use Grafana primary database.
+# redis: config like redis server e.g. `addr=127.0.0.1:6379,pool_size=100,db=0`. Only addr is required. +# redis: config like redis server e.g. `addr=127.0.0.1:6379,pool_size=100,db=0,ssl=false`. Only addr is required. ssl may be 'true', 'false', or 'insecure'.
+# memcache: 127.0.0.1:11211 +# memcache: 127.0.0.1:11211
+connstr = +connstr =
+ +
@ -161,6 +161,9 @@ index 0000000000..e337ba0b57
+ +
+#################################### Security ############################ +#################################### Security ############################
+[security] +[security]
+# disable creation of admin user on first start of grafana
+disable_initial_admin_creation = false
+
+# default admin user, created on startup +# default admin user, created on startup
+admin_user = admin +admin_user = admin
+ +
@ -182,7 +185,7 @@ index 0000000000..e337ba0b57
+# set to true if you host Grafana behind HTTPS. default is false. +# set to true if you host Grafana behind HTTPS. default is false.
+cookie_secure = false +cookie_secure = false
+ +
+# set cookie SameSite attribute. defaults to `lax`. can be set to "lax", "strict" and "none" +# set cookie SameSite attribute. defaults to `lax`. can be set to "lax", "strict", "none" and "disabled"
+cookie_samesite = lax +cookie_samesite = lax
+ +
+# set to true if you want to allow browsers to render Grafana in a <frame>, <iframe>, <embed> or <object>. default is false. +# set to true if you want to allow browsers to render Grafana in a <frame>, <iframe>, <embed> or <object>. default is false.
@ -321,6 +324,7 @@ index 0000000000..e337ba0b57
+auth_url = https://github.com/login/oauth/authorize +auth_url = https://github.com/login/oauth/authorize
+token_url = https://github.com/login/oauth/access_token +token_url = https://github.com/login/oauth/access_token
+api_url = https://api.github.com/user +api_url = https://api.github.com/user
+allowed_domains =
+team_ids = +team_ids =
+allowed_organizations = +allowed_organizations =
+ +
@ -334,6 +338,7 @@ index 0000000000..e337ba0b57
+auth_url = https://gitlab.com/oauth/authorize +auth_url = https://gitlab.com/oauth/authorize
+token_url = https://gitlab.com/oauth/token +token_url = https://gitlab.com/oauth/token
+api_url = https://gitlab.com/api/v4 +api_url = https://gitlab.com/api/v4
+allowed_domains =
+allowed_groups = +allowed_groups =
+ +
+#################################### Google Auth ######################### +#################################### Google Auth #########################
@ -376,16 +381,18 @@ index 0000000000..e337ba0b57
+client_secret = some_secret +client_secret = some_secret
+scopes = user:email +scopes = user:email
+email_attribute_name = email:primary +email_attribute_name = email:primary
+email_attribute_path =
+role_attribute_path =
+auth_url = +auth_url =
+token_url = +token_url =
+api_url = +api_url =
+allowed_domains =
+team_ids = +team_ids =
+allowed_organizations = +allowed_organizations =
+tls_skip_verify_insecure = false +tls_skip_verify_insecure = false
+tls_client_cert = +tls_client_cert =
+tls_client_key = +tls_client_key =
+tls_client_ca = +tls_client_ca =
+send_client_credentials_via_post = false
+ +
+#################################### SAML Auth ########################### +#################################### SAML Auth ###########################
+[auth.saml] # Enterprise only +[auth.saml] # Enterprise only
@ -438,9 +445,12 @@ index 0000000000..e337ba0b57
+header_name = X-WEBAUTH-USER +header_name = X-WEBAUTH-USER
+header_property = username +header_property = username
+auto_sign_up = true +auto_sign_up = true
+# Deprecated, use sync_ttl instead
+ldap_sync_ttl = 60 +ldap_sync_ttl = 60
+sync_ttl = 60
+whitelist = +whitelist =
+headers = +headers =
+enable_login_token = false
+ +
+#################################### Auth LDAP ########################### +#################################### Auth LDAP ###########################
+[auth.ldap] +[auth.ldap]
@ -589,6 +599,8 @@ index 0000000000..e337ba0b57
+# Default setting for max attempts to sending alert notifications. Default value is 3 +# Default setting for max attempts to sending alert notifications. Default value is 3
+max_attempts = 3 +max_attempts = 3
+ +
+# Makes it possible to enforce a minimal interval between evaluations, to reduce load on the backend
+min_interval_seconds = 1
+ +
+#################################### Explore ############################# +#################################### Explore #############################
+[explore] +[explore]
@ -643,10 +655,13 @@ index 0000000000..e337ba0b57
+ +
+#################################### External Image Storage ############## +#################################### External Image Storage ##############
+[external_image_storage] +[external_image_storage]
+# Used for uploading images to public servers so they can be included in slack/email messages.
+# You can choose between (s3, webdav, gcs, azure_blob, local) +# You can choose between (s3, webdav, gcs, azure_blob, local)
+provider = +provider =
+ +
+[external_image_storage.s3] +[external_image_storage.s3]
+endpoint =
+path_style_access =
+bucket_url = +bucket_url =
+bucket = +bucket =
+region = +region =
@ -674,8 +689,10 @@ index 0000000000..e337ba0b57
+# does not require any configuration +# does not require any configuration
+ +
+[rendering] +[rendering]
+# Options to configure external image rendering server like https://github.com/grafana/grafana-image-renderer +# Options to configure a remote HTTP image rendering service, e.g. using https://github.com/grafana/grafana-image-renderer.
+# URL to a remote HTTP image renderer service, e.g. http://localhost:8081/render, will enable Grafana to render panels and dashboards to PNG-images using HTTP requests to an external service.
+server_url = +server_url =
+# If the remote HTTP image renderer service runs on a different server than the Grafana server you may have to configure this to a URL where Grafana is reachable, e.g. http://grafana.domain/.
+callback_url = +callback_url =
+ +
+[panels] +[panels]
@ -689,6 +706,10 @@ index 0000000000..e337ba0b57
+ +
+[enterprise] +[enterprise]
+license_path = +license_path =
+
+[feature_toggles]
+# enable features, separated by spaces
+enable =
diff --git a/docs/man/man1/grafana-cli.1 b/docs/man/man1/grafana-cli.1 diff --git a/docs/man/man1/grafana-cli.1 b/docs/man/man1/grafana-cli.1
new file mode 100644 new file mode 100644
index 0000000000..171748fcda index 0000000000..171748fcda
@ -923,10 +944,10 @@ index 0000000000..f97c2a26be
+ +
diff --git a/packaging/rpm/spec/grafana.spec b/packaging/rpm/spec/grafana.spec diff --git a/packaging/rpm/spec/grafana.spec b/packaging/rpm/spec/grafana.spec
new file mode 100644 new file mode 100644
index 0000000000..fb9200cb62 index 0000000000..cef4ef0350
--- /dev/null --- /dev/null
+++ b/packaging/rpm/spec/grafana.spec +++ b/packaging/rpm/spec/grafana.spec
@@ -0,0 +1,766 @@ @@ -0,0 +1,758 @@
+%global grafana_arches %{lua: go_arches = {} +%global grafana_arches %{lua: go_arches = {}
+ for arch in rpm.expand("%{go_arches}"):gmatch("%S+") do + for arch in rpm.expand("%{go_arches}"):gmatch("%S+") do
+ go_arches[arch] = 1 + go_arches[arch] = 1
@ -938,19 +959,13 @@ index 0000000000..fb9200cb62
+end} +end}
+ +
+# Unbundle Grafana vendor sources and instead use BuildRequires +# Unbundle Grafana vendor sources and instead use BuildRequires
+# only on platforms that have enough golang devel support. +# on platforms that have enough golang devel support.
+%if 0%{?rhel} == 0 +%if 0%{?rhel} == 0
+%global unbundle_vendor_sources 1 +%global unbundle_vendor_sources 1
+%endif +%endif
+ +
+%if 0%{?fedora} >= 30
+# Use vendor sources until both Fedora and Grafana properly support golang modules
+%global unbundle_vendor_sources 0
+%endif
+
+
+Name: grafana +Name: grafana
+Version: 6.3.6 +Version: 6.6.2
+Release: 1%{?dist} +Release: 1%{?dist}
+Summary: Metrics dashboard and graph editor +Summary: Metrics dashboard and graph editor
+License: ASL 2.0 +License: ASL 2.0
@ -965,12 +980,17 @@ index 0000000000..fb9200cb62
+# Source2 is the script to create the above webpack from grafana sources +# Source2 is the script to create the above webpack from grafana sources
+Source2: make_grafana_webpack.sh +Source2: make_grafana_webpack.sh
+ +
+# Patches for upstream +# Patches
+Patch0: 000-set-version-string.patch
+Patch1: 001-login-oauth-use-oauth2-exchange.patch +Patch1: 001-login-oauth-use-oauth2-exchange.patch
+Patch2: 002-remove-jaeger-tracing.patch +Patch2: 002-remove-jaeger-tracing.patch
+Patch3: 003-new-files.patch +Patch3: 003-new-files.patch
+Patch4: 004-xerrors.patch +Patch4: 004-mute-shellcheck-grafana-cli.patch
+Patch5: 005-mute-shellcheck-grafana-cli.patch +Patch5: 005-pkg-main-fix-import-paths.patch
+Patch6: 006-pkg-setting-ini-default-section.patch
+Patch7: 007-pkg-prometheus-client-query-range.patch
+Patch8: 008-pkg-services-notifications-codes-Unknwon.patch
+Patch9: 009-pkg-fix-xorm-import.patch
+ +
+# Intersection of go_arches and nodejs_arches +# Intersection of go_arches and nodejs_arches
+ExclusiveArch: %{grafana_arches} +ExclusiveArch: %{grafana_arches}
@ -987,7 +1007,7 @@ index 0000000000..fb9200cb62
+%{?systemd_requires} +%{?systemd_requires}
+Requires(pre): shadow-utils +Requires(pre): shadow-utils
+ +
+BuildRequires: git, systemd, golang, go-srpm-macros +BuildRequires: git, systemd, golang, go-srpm-macros, go-rpm-macros
+ +
+Recommends: grafana-cloudwatch = %{version}-%{release} +Recommends: grafana-cloudwatch = %{version}-%{release}
+Recommends: grafana-elasticsearch = %{version}-%{release} +Recommends: grafana-elasticsearch = %{version}-%{release}
@ -1001,145 +1021,138 @@ index 0000000000..fb9200cb62
+Recommends: grafana-postgres = %{version}-%{release} +Recommends: grafana-postgres = %{version}-%{release}
+Recommends: grafana-prometheus = %{version}-%{release} +Recommends: grafana-prometheus = %{version}-%{release}
+Recommends: grafana-stackdriver = %{version}-%{release} +Recommends: grafana-stackdriver = %{version}-%{release}
+Recommends: grafana-pcp +Recommends: grafana-pcp >= 2
+ +
+%if 0%{?unbundle_vendor_sources} +%if 0%{?unbundle_vendor_sources}
+# golang build deps. These allow us to unbundle vendor golang source. +# golang build deps. These allow us to unbundle vendor golang source.
+# Note: commented lines are still vendored. See the build section below
+BuildRequires: golang(cloud.google.com/go)
+BuildRequires: golang(github.com/BurntSushi/toml)
+BuildRequires: golang(github.com/VividCortex/mysqlerr)
+BuildRequires: golang(github.com/apache/arrow/go/arrow)
+BuildRequires: golang(github.com/aws/aws-sdk-go) +BuildRequires: golang(github.com/aws/aws-sdk-go)
+BuildRequires: golang(github.com/beevik/etree)
+BuildRequires: golang(github.com/benbjohnson/clock) +BuildRequires: golang(github.com/benbjohnson/clock)
+BuildRequires: golang(github.com/beorn7/perks/quantile) +BuildRequires: golang(github.com/beorn7/perks/quantile)
+BuildRequires: golang(github.com/bmizerany/assert)
+BuildRequires: golang(github.com/bradfitz/gomemcache/memcache) +BuildRequires: golang(github.com/bradfitz/gomemcache/memcache)
+BuildRequires: golang(github.com/BurntSushi/toml) +BuildRequires: golang(github.com/cespare/xxhash)
+BuildRequires: golang(github.com/codahale/hdrhistogram) +BuildRequires: golang(github.com/cheekybits/genny/generic)
+BuildRequires: golang(github.com/codegangsta/cli) +BuildRequires: golang(github.com/codegangsta/cli)
+BuildRequires: golang(github.com/crewjam/saml)
+BuildRequires: golang(github.com/crewjam/saml/xmlenc)
+BuildRequires: golang(github.com/crewjam/saml/logger)
+BuildRequires: golang(github.com/crewjam/httperr)
+BuildRequires: golang(github.com/davecgh/go-spew/spew) +BuildRequires: golang(github.com/davecgh/go-spew/spew)
+BuildRequires: golang(github.com/denisenkom/go-mssqldb) +BuildRequires: golang(github.com/denisenkom/go-mssqldb)
+BuildRequires: golang(github.com/facebookgo/inject) +BuildRequires: golang(github.com/facebookgo/inject)
+BuildRequires: golang(github.com/facebookgo/structtag) +BuildRequires: golang(github.com/facebookgo/structtag)
+BuildRequires: golang(github.com/fatih/color) +BuildRequires: golang(github.com/fatih/color)
+BuildRequires: golang(github.com/go-ini/ini)
+BuildRequires: golang(google.golang.org/appengine)
+BuildRequires: golang(golang.org/x/sys/unix)
+BuildRequires: golang(github.com/go-macaron/binding) +BuildRequires: golang(github.com/go-macaron/binding)
+BuildRequires: golang(github.com/go-macaron/gzip) +BuildRequires: golang(github.com/go-macaron/gzip)
+BuildRequires: golang(github.com/go-macaron/inject) +BuildRequires: golang(github.com/go-macaron/inject)
+BuildRequires: golang(github.com/go-macaron/session) +BuildRequires: golang(github.com/go-macaron/session)
+BuildRequires: golang(google.golang.org/genproto/googleapis/rpc/status) +BuildRequires: golang(github.com/go-sql-driver/mysql)
+BuildRequires: golang(github.com/go-stack/stack)
+
+BuildRequires: golang(xorm.io/xorm)
+BuildRequires: golang(xorm.io/core)
+BuildRequires: golang(xorm.io/builder) >= 0.3.6
+
+BuildRequires: golang(github.com/gobwas/glob) +BuildRequires: golang(github.com/gobwas/glob)
+BuildRequires: golang(github.com/gobwas/glob/compiler) +BuildRequires: golang(github.com/golang/snappy)
+BuildRequires: golang(github.com/gobwas/glob/match) +BuildRequires: golang(github.com/google/flatbuffers/go)
+BuildRequires: golang(github.com/gobwas/glob/syntax)
+BuildRequires: golang(github.com/gobwas/glob/syntax/ast)
+BuildRequires: golang(github.com/gobwas/glob/syntax/lexer)
+BuildRequires: golang(github.com/gobwas/glob/util/runes)
+BuildRequires: golang(github.com/gobwas/glob/util/strings)
+BuildRequires: golang(github.com/gopherjs/gopherjs/js) +BuildRequires: golang(github.com/gopherjs/gopherjs/js)
+BuildRequires: golang(github.com/gorilla/websocket) +BuildRequires: golang(github.com/gorilla/websocket)
+BuildRequires: golang(github.com/gosimple/slug) +BuildRequires: golang(github.com/gosimple/slug)
+BuildRequires: golang(github.com/go-sql-driver/mysql) +
+BuildRequires: golang(github.com/go-stack/stack) +# These two are considered part of grafana, use vendored code
+BuildRequires: golang(github.com/go-xorm/builder) +# BuildRequires: golang(github.com/grafana/grafana-plugin-model)
+BuildRequires: golang(github.com/go-xorm/core) +# BuildRequires: golang(github.com/grafana/grafana-plugin-sdk-go)
+BuildRequires: golang(github.com/go-xorm/xorm) +
+BuildRequires: golang(google.golang.org/grpc) +BuildRequires: golang(github.com/grpc-ecosystem/go-grpc-prometheus)
+BuildRequires: golang(github.com/golang/protobuf/proto)
+BuildRequires: golang(github.com/golang/protobuf/ptypes/any)
+BuildRequires: golang(github.com/golang/protobuf/ptypes/duration)
+BuildRequires: golang(github.com/golang/protobuf/ptypes/empty)
+BuildRequires: golang(github.com/golang/protobuf/ptypes/timestamp)
+BuildRequires: golang(github.com/hashicorp/go-hclog) +BuildRequires: golang(github.com/hashicorp/go-hclog)
+# need grpc_broker in go-plugin >= 1.0.0-1
+BuildRequires: golang(github.com/hashicorp/go-plugin) +BuildRequires: golang(github.com/hashicorp/go-plugin)
+BuildRequires: golang(github.com/hashicorp/go-version) +BuildRequires: golang(github.com/hashicorp/go-version)
+BuildRequires: golang(github.com/hashicorp/yamux) +BuildRequires: golang(github.com/hashicorp/yamux)
+BuildRequires: golang(github.com/inconshreveable/log15) +BuildRequires: golang(github.com/inconshreveable/log15)
+BuildRequires: golang(github.com/jmespath/go-jmespath) +BuildRequires: golang(github.com/jmespath/go-jmespath)
+BuildRequires: golang(github.com/jonboulle/clockwork)
+BuildRequires: golang(github.com/json-iterator/go)
+BuildRequires: golang(github.com/jtolds/gls) +BuildRequires: golang(github.com/jtolds/gls)
+BuildRequires: golang(github.com/klauspost/compress/flate) +BuildRequires: golang(github.com/jung-kurt/gofpdf)
+BuildRequires: golang(github.com/klauspost/compress/gzip) +BuildRequires: golang(github.com/klauspost/compress)
+BuildRequires: golang(github.com/klauspost/compress/snappy)
+BuildRequires: golang(github.com/klauspost/cpuid) +BuildRequires: golang(github.com/klauspost/cpuid)
+BuildRequires: golang(github.com/klauspost/crc32)
+BuildRequires: golang(github.com/kr/pretty)
+BuildRequires: golang(github.com/kr/text)
+BuildRequires: golang(github.com/lib/pq) +BuildRequires: golang(github.com/lib/pq)
+BuildRequires: golang(github.com/linkedin/goavro)
+BuildRequires: golang(github.com/mattetti/filebuffer)
+BuildRequires: golang(github.com/mattn/go-colorable) +BuildRequires: golang(github.com/mattn/go-colorable)
+BuildRequires: golang(github.com/mattn/go-isatty) +BuildRequires: golang(github.com/mattn/go-isatty)
+BuildRequires: golang(github.com/mattn/go-sqlite3) +BuildRequires: golang(github.com/mattn/go-sqlite3)
+BuildRequires: golang(github.com/matttproud/golang_protobuf_extensions/pbutil) +BuildRequires: golang(github.com/matttproud/golang_protobuf_extensions/pbutil)
+BuildRequires: golang(github.com/mitchellh/go-testing-interface) +BuildRequires: golang(github.com/mitchellh/go-testing-interface)
+BuildRequires: golang(github.com/modern-go/concurrent)
+BuildRequires: golang(github.com/modern-go/reflect2)
+BuildRequires: golang(github.com/oklog/run) +BuildRequires: golang(github.com/oklog/run)
+BuildRequires: golang(github.com/opentracing/opentracing-go) +BuildRequires: golang(github.com/opentracing/opentracing-go)
+BuildRequires: golang(github.com/patrickmn/go-cache) +BuildRequires: golang(github.com/patrickmn/go-cache)
+BuildRequires: golang(github.com/pkg/errors) +BuildRequires: golang(github.com/pkg/errors)
+BuildRequires: golang(github.com/pmezard/go-difflib/difflib)
+BuildRequires: golang(github.com/prometheus/client_golang/api) +BuildRequires: golang(github.com/prometheus/client_golang/api)
+BuildRequires: golang(github.com/prometheus/client_golang/api/prometheus/v1)
+BuildRequires: golang(github.com/prometheus/client_model/go) +BuildRequires: golang(github.com/prometheus/client_model/go)
+BuildRequires: golang-github-prometheus-common-devel
+BuildRequires: golang(github.com/prometheus/common/expfmt)
+BuildRequires: golang(github.com/prometheus/common/model) +BuildRequires: golang(github.com/prometheus/common/model)
+BuildRequires: golang(github.com/prometheus/common/expfmt)
+BuildRequires: golang(github.com/prometheus/procfs) +BuildRequires: golang(github.com/prometheus/procfs)
+BuildRequires: golang(github.com/prometheus/procfs/internal/util)
+BuildRequires: golang(github.com/prometheus/procfs)
+BuildRequires: golang(github.com/prometheus/procfs/internal/util)
+BuildRequires: golang(github.com/prometheus/procfs/nfs)
+BuildRequires: golang(github.com/prometheus/procfs/xfs)
+BuildRequires: golang(github.com/rainycape/unidecode) +BuildRequires: golang(github.com/rainycape/unidecode)
+BuildRequires: golang(github.com/robfig/cron)
+BuildRequires: golang(gopkg.in/robfig/cron.v3)
+BuildRequires: golang(github.com/russellhaering/goxmldsig)
+BuildRequires: golang(github.com/sergi/go-diff/diffmatchpatch) +BuildRequires: golang(github.com/sergi/go-diff/diffmatchpatch)
+BuildRequires: golang(github.com/smartystreets/assertions) +BuildRequires: golang(github.com/smartystreets/assertions)
+BuildRequires: golang(github.com/smartystreets/goconvey/convey) +BuildRequires: golang(github.com/smartystreets/goconvey/convey)
+BuildRequires: golang(github.com/smartystreets/goconvey/convey/gotest) +BuildRequires: golang(github.com/smartystreets/goconvey/convey/gotest)
+BuildRequires: golang(github.com/smartystreets/goconvey/convey/reporting) +BuildRequires: golang(github.com/smartystreets/goconvey/convey/reporting)
+BuildRequires: golang(github.com/stretchr/testify)
+BuildRequires: golang(github.com/teris-io/shortid) +BuildRequires: golang(github.com/teris-io/shortid)
+BuildRequires: golang(github.com/ua-parser/uap-go/uaparser)
+BuildRequires: golang(github.com/Unknwon/com) +BuildRequires: golang(github.com/Unknwon/com)
+BuildRequires: golang(github.com/VividCortex/mysqlerr)
+BuildRequires: golang(github.com/yudai/gojsondiff) +BuildRequires: golang(github.com/yudai/gojsondiff)
+BuildRequires: golang(github.com/yudai/golcs) +BuildRequires: golang(github.com/yudai/golcs)
+BuildRequires: golang(golang.org/x/crypto/pbkdf2) +BuildRequires: golang(go.uber.org/atomic)
+BuildRequires: golang(golang.org/x/crypto/ed25519) +BuildRequires: golang(golang.org/x/crypto/ed25519)
+BuildRequires: golang(golang.org/x/crypto/md4) +BuildRequires: golang(golang.org/x/crypto/md4)
+BuildRequires: golang(golang.org/x/crypto/pbkdf2)
+BuildRequires: golang(golang.org/x/crypto/ripemd160)
+BuildRequires: golang(golang.org/x/lint)
+BuildRequires: golang(golang.org/x/net/context) +BuildRequires: golang(golang.org/x/net/context)
+BuildRequires: golang(golang.org/x/net/context/ctxhttp)
+BuildRequires: golang(golang.org/x/net/http2)
+BuildRequires: golang(golang.org/x/net/http2/hpack)
+BuildRequires: golang(golang.org/x/net/http/httpguts) +BuildRequires: golang(golang.org/x/net/http/httpguts)
+BuildRequires: golang(golang.org/x/net/http2)
+BuildRequires: golang(golang.org/x/net/idna) +BuildRequires: golang(golang.org/x/net/idna)
+BuildRequires: golang(golang.org/x/net/internal/timeseries) +BuildRequires: golang(golang.org/x/net/internal/timeseries)
+BuildRequires: golang(golang.org/x/net/trace) +BuildRequires: golang(golang.org/x/net/trace)
+BuildRequires: golang(golang.org/x/text/collate)
+BuildRequires: golang(golang.org/x/text/collate/build)
+BuildRequires: golang(golang.org/x/text/internal/colltab)
+BuildRequires: golang(golang.org/x/text/internal/gen)
+BuildRequires: golang(golang.org/x/text/internal/tag)
+BuildRequires: golang(golang.org/x/text/internal/triegen)
+BuildRequires: golang(golang.org/x/text/internal/ucd)
+BuildRequires: golang(golang.org/x/oauth2) +BuildRequires: golang(golang.org/x/oauth2)
+BuildRequires: golang(golang.org/x/oauth2/google) +BuildRequires: golang(golang.org/x/sync/errgroup)
+BuildRequires: golang(golang.org/x/oauth2/internal) +BuildRequires: golang(golang.org/x/sys/unix)
+BuildRequires: golang(golang.org/x/oauth2/jws) +BuildRequires: golang(golang.org/x/text)
+BuildRequires: golang(golang.org/x/oauth2/jwt) +BuildRequires: golang(golang.org/x/tools/go/ast/astutil)
+BuildRequires: golang(github.com/golang/protobuf/proto) +BuildRequires: golang(golang.org/x/tools/go/gcexportdata)
+BuildRequires: golang(github.com/golang/protobuf/ptypes) +BuildRequires: golang(golang.org/x/tools/go/internal/gcimporter)
+BuildRequires: golang(github.com/golang/protobuf/ptypes) +BuildRequires: golang(golang.org/x/xerrors)
+BuildRequires: golang(github.com/golang/protobuf/ptypes/duration) +BuildRequires: golang(google.golang.org/appengine)
+BuildRequires: golang(github.com/golang/protobuf/ptypes/any) +BuildRequires: golang(google.golang.org/genproto/googleapis/rpc/status)
+BuildRequires: golang(github.com/golang/protobuf/ptypes/timestamp) +BuildRequires: golang(google.golang.org/grpc)
+BuildRequires: golang(cloud.google.com/go/compute/metadata)
+BuildRequires: golang(gopkg.in/alexcesaro/quotedprintable.v3) +BuildRequires: golang(gopkg.in/alexcesaro/quotedprintable.v3)
+BuildRequires: golang(gopkg.in/asn1-ber.v1) +BuildRequires: golang(gopkg.in/asn1-ber.v1)
+BuildRequires: golang(github.com/go-bufio/bufio) +BuildRequires: golang(gopkg.in/ini.v1)
+BuildRequires: golang(github.com/go-ini/ini)
+BuildRequires: golang(github.com/go-macaron/macaron)
+BuildRequires: golang(github.com/go-redis/redis)
+BuildRequires: golang(gopkg.in/square/go-jose.v2)
+BuildRequires: golang(gopkg.in/square/go-jose.v2/cipher)
+BuildRequires: golang(gopkg.in/square/go-jose.v2/json)
+%if 0%{fedora} >= 31
+BuildRequires: golang(gopkg.in/yaml.v2)
+%else
+BuildRequires: golang(github.com/go-yaml/yaml)
+%endif
+BuildRequires: golang(golang.org/x/sync/errgroup)
+BuildRequires: golang(gopkg.in/ldap.v3) +BuildRequires: golang(gopkg.in/ldap.v3)
+BuildRequires: golang(gopkg.in/macaron.v1)
+BuildRequires: golang(gopkg.in/mail.v2) +BuildRequires: golang(gopkg.in/mail.v2)
+BuildRequires: golang(github.com/jonboulle/clockwork) +BuildRequires: golang(gopkg.in/redis.v5)
+BuildRequires: golang(gopkg.in/square/go-jose.v2)
+BuildRequires: golang(gopkg.in/yaml.v2)
+%endif +%endif
+ +
+# Declare all nodejs modules bundled in the webpack - this is for security +# Declare all nodejs modules bundled in the webpack - this is for security
@ -1333,11 +1346,16 @@ index 0000000000..fb9200cb62
+%prep +%prep
+%setup -q -T -D -b 0 +%setup -q -T -D -b 0
+%setup -q -T -D -b 1 +%setup -q -T -D -b 1
+%patch0 -p1
+%patch1 -p1 +%patch1 -p1
+%patch2 -p1 +%patch2 -p1
+%patch3 -p1 +%patch3 -p1
+%patch4 -p1 +%patch4 -p1
+%patch5 -p1 +%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+ +
+# Set up build subdirs and links +# Set up build subdirs and links
+mkdir -p %{_builddir}/src/github.com/grafana +mkdir -p %{_builddir}/src/github.com/grafana
@ -1349,36 +1367,26 @@ index 0000000000..fb9200cb62
+ +
+%if 0%{?unbundle_vendor_sources} +%if 0%{?unbundle_vendor_sources}
+# Unbundle all grafana vendor sources, as per BuildRequires above. +# Unbundle all grafana vendor sources, as per BuildRequires above.
+# An exception is grafana-plugin-model, which is part of grafana. +# Note there are some exceptions.
+cp --parents -a vendor/github.com/grafana \ +cp --parents -a \
+ vendor/golang.org/x/xerrors \ + vendor/github.com/grafana/grafana-plugin-model \
+ vendor/github.com/robfig vendor/github.com/crewjam/saml \ + vendor/github.com/grafana/grafana-plugin-sdk-go \
+ vendor/github.com/ua-parser/uap-go/uaparser \
+ vendor/github.com/beevik/etree \
+ vendor/github.com/russellhaering/goxmldsig \
+ %{_builddir} + %{_builddir}
+rm -r vendor # remove all vendor sources +rm -r vendor # remove all vendor sources
+mv %{_builddir}/vendor vendor # put back what we're keeping +mv %{_builddir}/vendor vendor # put back what we're keeping
+%endif +%endif
+ +
+
+%build +%build
+# Build the server-side binaries +# Build the server-side binaries
+cd %{_builddir}/src/github.com/grafana/grafana +cd %{_builddir}/src/github.com/grafana/grafana
+%global archbindir bin/`go env GOOS`-`go env GOARCH` +%global archbindir bin/`go env GOOS`-`go env GOARCH`
+echo _builddir=%{_builddir} archbindir=%{archbindir} +echo _builddir=%{_builddir} archbindir=%{archbindir} gopath=%{gopath}
+[ ! -d %{archbindir} ] && mkdir -p %{archbindir} +[ ! -d %{archbindir} ] && mkdir -p %{archbindir}
+# non-modular build
+export GOPATH=%{_builddir}:%{gopath} +export GOPATH=%{_builddir}:%{gopath}
+# export GO111MODULE=off +export GO111MODULE=off; rm -f go.mod
+%if 0%{?fedora} >= 31 +%gobuild -o %{archbindir}/grafana-cli ./pkg/cmd/grafana-cli
+# native fedora golang build but without modules (no grafana support yet) +%gobuild -o %{archbindir}/grafana-server ./pkg/cmd/grafana-server
+go build -mod=vendor -o %{archbindir}/grafana-cli ./pkg/cmd/grafana-cli
+go build -mod=vendor -o %{archbindir}/grafana-server ./pkg/cmd/grafana-server
+%else
+# use the grafana build.go script.
+go run build.go build
+%endif
+
+ +
+%install +%install
+# Fix up arch bin directories +# Fix up arch bin directories
@ -1457,13 +1465,12 @@ index 0000000000..fb9200cb62
+%check +%check
+cd %{_builddir}/src/github.com/grafana/grafana +cd %{_builddir}/src/github.com/grafana/grafana
+export GOPATH=%{_builddir}:%{gopath} +export GOPATH=%{_builddir}:%{gopath}
+# remove tests currently failing +# remove tests currently failing - these two are due to a symlink
+# BUILD/src/github.com/grafana/grafana -> BUILD/grafana-6.6.1
+rm -f pkg/services/provisioning/dashboards/file_reader_linux_test.go +rm -f pkg/services/provisioning/dashboards/file_reader_linux_test.go
+rm -f pkg/services/provisioning/dashboards/file_reader_test.go +rm -f pkg/services/provisioning/dashboards/file_reader_test.go
+rm -f pkg/services/sqlstore/alert_test.go
+rm -f pkg/services/sqlstore/apikey_test.go
+export GO111MODULE=off +export GO111MODULE=off
+go test ./pkg/... +%gotest ./pkg/...
+ +
+ +
+%files +%files
@ -1562,6 +1569,12 @@ index 0000000000..fb9200cb62
+ +
+ +
+%changelog +%changelog
+* Fri Feb 21 2020 Mark Goodwin <mgoodwin@redhat.com> 6.6.2-1
+- added patch0 to set the version string correctly
+- removed patch 004-xerrors.patch, it's now upstream
+- added several patches for golang vendored vrs build dep differences
+- update to 6.6.2 tagged upstream community sources, see CHANGELOG
+
+* Wed Nov 20 2019 Mark Goodwin <mgoodwin@redhat.com> 6.3.6-1 +* Wed Nov 20 2019 Mark Goodwin <mgoodwin@redhat.com> 6.3.6-1
+- add weak depenency on grafana-pcp +- add weak depenency on grafana-pcp
+- add patch to mute shellcheck SC1090 for grafana-cli +- add patch to mute shellcheck SC1090 for grafana-cli

View File

@ -0,0 +1,26 @@
diff --git a/packaging/wrappers/grafana-cli b/packaging/wrappers/grafana-cli
index 9cad151c0d..6b7ec1ab42 100755
--- a/packaging/wrappers/grafana-cli
+++ b/packaging/wrappers/grafana-cli
@@ -12,11 +12,12 @@ CONF_DIR=/etc/grafana
DATA_DIR=/var/lib/grafana
PLUGINS_DIR=/var/lib/grafana/plugins
LOG_DIR=/var/log/grafana
+LIBEXEC_DIR=/usr/libexec/grafana
CONF_FILE=$CONF_DIR/grafana.ini
PROVISIONING_CFG_DIR=$CONF_DIR/provisioning
-EXECUTABLE=$GRAFANA_HOME/bin/grafana-cli
+EXECUTABLE=$LIBEXEC_DIR/grafana-cli
if [ ! -x $EXECUTABLE ]; then
echo "Program not installed or not executable"
@@ -24,6 +25,7 @@ if [ ! -x $EXECUTABLE ]; then
fi
# overwrite settings from default file
+#shellcheck disable=SC1090
if [ -f "$DEFAULT" ]; then
. "$DEFAULT"
fi

View File

@ -1,146 +0,0 @@
diff --git a/go.mod b/go.mod
index 13f7c66bb..e0615affa 100644
--- a/go.mod
+++ b/go.mod
@@ -77,7 +77,6 @@ require (
golang.org/x/oauth2 v0.0.0-20190319182350-c85d3e98c914
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6
golang.org/x/sys v0.0.0-20190415081028-16da32be82c5 // indirect
- golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
gopkg.in/bufio.v1 v1.0.0-20140618132640-567b2bfa514e // indirect
diff --git a/vendor/golang.org/x/xerrors/adaptor_go1_12.go b/vendor/golang.org/x/xerrors/adaptor.go
similarity index 99%
rename from vendor/golang.org/x/xerrors/adaptor_go1_12.go
rename to vendor/golang.org/x/xerrors/adaptor.go
index 6b9f2f0c7..4317f2483 100644
--- a/vendor/golang.org/x/xerrors/adaptor_go1_12.go
+++ b/vendor/golang.org/x/xerrors/adaptor.go
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build !go1.13
-
package xerrors
import (
diff --git a/vendor/golang.org/x/xerrors/adaptor_go1_13.go b/vendor/golang.org/x/xerrors/adaptor_go1_13.go
deleted file mode 100644
index 57f519dc5..000000000
--- a/vendor/golang.org/x/xerrors/adaptor_go1_13.go
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build go1.13
-
-package xerrors
-
-import (
- "errors"
- "fmt"
- "strconv"
-)
-
-// A Frame contains part of a call stack.
-type Frame = errors.Frame
-
-// Caller returns a Frame that describes a frame on the caller's stack.
-// The argument skip is the number of frames to skip over.
-// Caller(0) returns the frame for the caller of Caller.
-var Caller func(skip int) Frame = errors.Caller
-
-// FormatError calls the FormatError method of f with an errors.Printer
-// configured according to s and verb, and writes the result to s.
-func FormatError(f Formatter, s fmt.State, verb rune) {
- // Assuming this function is only called from the Format method, and given
- // that FormatError takes precedence over Format, it cannot be called from
- // any package that supports errors.Formatter. It is therefore safe to
- // disregard that State may be a specific printer implementation and use one
- // of our choice instead.
-
- width, okW := s.Width()
- prec, okP := s.Precision()
-
- // Construct format string from State s.
- format := []byte{'%'}
- if s.Flag('-') {
- format = append(format, '-')
- }
- if s.Flag('+') {
- format = append(format, '+')
- }
- if s.Flag(' ') {
- format = append(format, ' ')
- }
- if okW {
- format = strconv.AppendInt(format, int64(width), 10)
- }
- if okP {
- format = append(format, '.')
- format = strconv.AppendInt(format, int64(prec), 10)
- }
- format = append(format, string(verb)...)
- fmt.Fprintf(s, string(format), f)
-}
diff --git a/vendor/golang.org/x/xerrors/format_go1_12.go b/vendor/golang.org/x/xerrors/format.go
similarity index 98%
rename from vendor/golang.org/x/xerrors/format_go1_12.go
rename to vendor/golang.org/x/xerrors/format.go
index ba856feab..1bc9c26b9 100644
--- a/vendor/golang.org/x/xerrors/format_go1_12.go
+++ b/vendor/golang.org/x/xerrors/format.go
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build !go1.13
-
package xerrors
// A Formatter formats error messages.
diff --git a/vendor/golang.org/x/xerrors/format_go1_13.go b/vendor/golang.org/x/xerrors/format_go1_13.go
deleted file mode 100644
index 95c65968b..000000000
--- a/vendor/golang.org/x/xerrors/format_go1_13.go
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build go1.13
-
-package xerrors
-
-import "errors"
-
-// A Formatter formats error messages.
-type Formatter = errors.Formatter
-
-// A Printer formats error messages.
-//
-// The most common implementation of Printer is the one provided by package fmt
-// during Printf (as of Go 1.13). Localization packages such as golang.org/x/text/message
-// typically provide their own implementations.
-type Printer = errors.Printer
diff --git a/vendor/golang.org/x/xerrors/frame_go1_12.go b/vendor/golang.org/x/xerrors/frame.go
similarity index 98%
rename from vendor/golang.org/x/xerrors/frame_go1_12.go
rename to vendor/golang.org/x/xerrors/frame.go
index 6740f7fa6..0de628ec5 100644
--- a/vendor/golang.org/x/xerrors/frame_go1_12.go
+++ b/vendor/golang.org/x/xerrors/frame.go
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build !go1.13
-
package xerrors
import (

View File

@ -1,12 +0,0 @@
diff --git a/packaging/wrappers/grafana-cli b/packaging/wrappers/grafana-cli
index 9cad151c0d..4c963d90ac 100755
--- a/packaging/wrappers/grafana-cli
+++ b/packaging/wrappers/grafana-cli
@@ -24,6 +24,7 @@ if [ ! -x $EXECUTABLE ]; then
fi
# overwrite settings from default file
+#shellcheck disable=SC1090
if [ -f "$DEFAULT" ]; then
. "$DEFAULT"
fi

View File

@ -0,0 +1,17 @@
diff --git a/pkg/extensions/main.go b/pkg/extensions/main.go
index a88f67ff9e..7844aa1227 100644
--- a/pkg/extensions/main.go
+++ b/pkg/extensions/main.go
@@ -9,10 +9,10 @@ import (
"github.com/grafana/grafana/pkg/registry"
"github.com/grafana/grafana/pkg/services/licensing"
_ "github.com/jung-kurt/gofpdf"
- _ "github.com/linkedin/goavro/v2"
+ _ "github.com/linkedin/goavro"
_ "github.com/pkg/errors"
_ "github.com/robfig/cron"
- _ "github.com/robfig/cron/v3"
+ _ "gopkg.in/robfig/cron.v3"
_ "github.com/stretchr/testify/require"
_ "gopkg.in/square/go-jose.v2"
)

View File

@ -0,0 +1,13 @@
diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go
index 19181be84e..9a745f67e4 100644
--- a/pkg/setting/setting.go
+++ b/pkg/setting/setting.go
@@ -387,7 +387,7 @@ func applyCommandLineDefaultProperties(props map[string]string, file *ini.File)
func applyCommandLineProperties(props map[string]string, file *ini.File) {
for _, section := range file.Sections() {
sectionName := section.Name() + "."
- if section.Name() == ini.DefaultSection {
+ if section.Name() == ini.DEFAULT_SECTION {
sectionName = ""
}
for _, key := range section.Keys() {

View File

@ -0,0 +1,18 @@
diff --git a/pkg/tsdb/prometheus/prometheus.go b/pkg/tsdb/prometheus/prometheus.go
index 1244031bb4..c1d85b7e53 100644
--- a/pkg/tsdb/prometheus/prometheus.go
+++ b/pkg/tsdb/prometheus/prometheus.go
@@ -112,10 +112,10 @@ func (e *PrometheusExecutor) Query(ctx context.Context, dsInfo *models.DataSourc
span.SetTag("stop_unixnano", query.End.UnixNano())
defer span.Finish()
- value, _, err := client.QueryRange(ctx, query.Expr, timeRange)
+ value, queryErr := client.QueryRange(ctx, query.Expr, timeRange)
- if err != nil {
- return nil, err
+ if queryErr != nil {
+ return nil, queryErr
}
queryResult, err := parseResponse(value, query)

View File

@ -0,0 +1,13 @@
diff --git a/pkg/services/notifications/codes.go b/pkg/services/notifications/codes.go
index ae66aa1d1b..bfb95560fe 100644
--- a/pkg/services/notifications/codes.go
+++ b/pkg/services/notifications/codes.go
@@ -6,7 +6,7 @@ import (
"fmt"
"time"
- "github.com/unknwon/com"
+ "github.com/Unknwon/com"
m "github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/setting"

View File

@ -0,0 +1,288 @@
diff --git a/pkg/services/sqlstore/datasource.go b/pkg/services/sqlstore/datasource.go
index c84f6bb948..414e343a63 100644
--- a/pkg/services/sqlstore/datasource.go
+++ b/pkg/services/sqlstore/datasource.go
@@ -5,7 +5,7 @@ import (
"github.com/grafana/grafana/pkg/components/simplejson"
- "github.com/go-xorm/xorm"
+ "xorm.io/xorm"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/components/securejsondata"
diff --git a/pkg/services/sqlstore/logger.go b/pkg/services/sqlstore/logger.go
index 498c2b58c1..850e10cd21 100644
--- a/pkg/services/sqlstore/logger.go
+++ b/pkg/services/sqlstore/logger.go
@@ -5,7 +5,7 @@ import (
glog "github.com/grafana/grafana/pkg/infra/log"
- "github.com/go-xorm/core"
+ "xorm.io/core"
)
type XormLogger struct {
diff --git a/pkg/services/sqlstore/migrations/annotation_mig.go b/pkg/services/sqlstore/migrations/annotation_mig.go
index 3ec5df841e..505ab5cf6e 100644
--- a/pkg/services/sqlstore/migrations/annotation_mig.go
+++ b/pkg/services/sqlstore/migrations/annotation_mig.go
@@ -1,7 +1,7 @@
package migrations
import (
- "github.com/go-xorm/xorm"
+ "xorm.io/xorm"
. "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
)
diff --git a/pkg/services/sqlstore/migrations/migrations_test.go b/pkg/services/sqlstore/migrations/migrations_test.go
index 62ecbaad11..a9a3b38e62 100644
--- a/pkg/services/sqlstore/migrations/migrations_test.go
+++ b/pkg/services/sqlstore/migrations/migrations_test.go
@@ -3,7 +3,7 @@ package migrations
import (
"testing"
- "github.com/go-xorm/xorm"
+ "xorm.io/xorm"
. "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
"github.com/grafana/grafana/pkg/services/sqlstore/sqlutil"
diff --git a/pkg/services/sqlstore/migrations/user_mig.go b/pkg/services/sqlstore/migrations/user_mig.go
index 53110fe49b..e1a54a57bf 100644
--- a/pkg/services/sqlstore/migrations/user_mig.go
+++ b/pkg/services/sqlstore/migrations/user_mig.go
@@ -3,7 +3,7 @@ package migrations
import (
"fmt"
- "github.com/go-xorm/xorm"
+ "xorm.io/xorm"
. "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
"github.com/grafana/grafana/pkg/util"
)
diff --git a/pkg/services/sqlstore/migrator/column.go b/pkg/services/sqlstore/migrator/column.go
index 28cef60a94..af093a8e59 100644
--- a/pkg/services/sqlstore/migrator/column.go
+++ b/pkg/services/sqlstore/migrator/column.go
@@ -1,7 +1,7 @@
package migrator
// Notice
-// code based on parts from from https://github.com/go-xorm/core/blob/3e0fa232ab5c90996406c0cd7ae86ad0e5ecf85f/column.go
+// code based on parts from from https://xorm.io/core/blob/3e0fa232ab5c90996406c0cd7ae86ad0e5ecf85f/column.go
type Column struct {
Name string
diff --git a/pkg/services/sqlstore/migrator/dialect.go b/pkg/services/sqlstore/migrator/dialect.go
index 0aa2be7301..5246f17971 100644
--- a/pkg/services/sqlstore/migrator/dialect.go
+++ b/pkg/services/sqlstore/migrator/dialect.go
@@ -4,7 +4,7 @@ import (
"fmt"
"strings"
- "github.com/go-xorm/xorm"
+ "xorm.io/xorm"
)
type Dialect interface {
diff --git a/pkg/services/sqlstore/migrator/migrator.go b/pkg/services/sqlstore/migrator/migrator.go
index 612a333a72..f314b6ea84 100644
--- a/pkg/services/sqlstore/migrator/migrator.go
+++ b/pkg/services/sqlstore/migrator/migrator.go
@@ -4,7 +4,7 @@ import (
"time"
_ "github.com/go-sql-driver/mysql"
- "github.com/go-xorm/xorm"
+ "xorm.io/xorm"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/util/errutil"
_ "github.com/lib/pq"
diff --git a/pkg/services/sqlstore/migrator/mysql_dialect.go b/pkg/services/sqlstore/migrator/mysql_dialect.go
index 147df03357..a658819ea2 100644
--- a/pkg/services/sqlstore/migrator/mysql_dialect.go
+++ b/pkg/services/sqlstore/migrator/mysql_dialect.go
@@ -7,7 +7,7 @@ import (
"github.com/VividCortex/mysqlerr"
"github.com/go-sql-driver/mysql"
- "github.com/go-xorm/xorm"
+ "xorm.io/xorm"
)
type Mysql struct {
diff --git a/pkg/services/sqlstore/migrator/postgres_dialect.go b/pkg/services/sqlstore/migrator/postgres_dialect.go
index 70803f3a9e..5ae7c57ea5 100644
--- a/pkg/services/sqlstore/migrator/postgres_dialect.go
+++ b/pkg/services/sqlstore/migrator/postgres_dialect.go
@@ -5,7 +5,7 @@ import (
"strconv"
"strings"
- "github.com/go-xorm/xorm"
+ "xorm.io/xorm"
"github.com/grafana/grafana/pkg/util/errutil"
"github.com/lib/pq"
)
diff --git a/pkg/services/sqlstore/migrator/sqlite_dialect.go b/pkg/services/sqlstore/migrator/sqlite_dialect.go
index 8372898c35..a306badd82 100644
--- a/pkg/services/sqlstore/migrator/sqlite_dialect.go
+++ b/pkg/services/sqlstore/migrator/sqlite_dialect.go
@@ -3,7 +3,7 @@ package migrator
import (
"fmt"
- "github.com/go-xorm/xorm"
+ "xorm.io/xorm"
sqlite3 "github.com/mattn/go-sqlite3"
)
diff --git a/pkg/services/sqlstore/migrator/types.go b/pkg/services/sqlstore/migrator/types.go
index 48354998d8..957bef392d 100644
--- a/pkg/services/sqlstore/migrator/types.go
+++ b/pkg/services/sqlstore/migrator/types.go
@@ -4,7 +4,7 @@ import (
"fmt"
"strings"
- "github.com/go-xorm/xorm"
+ "xorm.io/xorm"
)
const (
diff --git a/pkg/services/sqlstore/session.go b/pkg/services/sqlstore/session.go
index 07f1d4524c..e44105c79c 100644
--- a/pkg/services/sqlstore/session.go
+++ b/pkg/services/sqlstore/session.go
@@ -4,7 +4,7 @@ import (
"context"
"reflect"
- "github.com/go-xorm/xorm"
+ "xorm.io/xorm"
)
type DBSession struct {
diff --git a/pkg/services/sqlstore/sqlstore.go b/pkg/services/sqlstore/sqlstore.go
index bede60f1ff..7076b76dd6 100644
--- a/pkg/services/sqlstore/sqlstore.go
+++ b/pkg/services/sqlstore/sqlstore.go
@@ -11,7 +11,7 @@ import (
"time"
"github.com/go-sql-driver/mysql"
- "github.com/go-xorm/xorm"
+ "xorm.io/xorm"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/infra/localcache"
"github.com/grafana/grafana/pkg/infra/log"
diff --git a/pkg/services/sqlstore/transactions.go b/pkg/services/sqlstore/transactions.go
index 27928f52a4..6d9888af39 100644
--- a/pkg/services/sqlstore/transactions.go
+++ b/pkg/services/sqlstore/transactions.go
@@ -4,7 +4,7 @@ import (
"context"
"time"
- "github.com/go-xorm/xorm"
+ "xorm.io/xorm"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/util/errutil"
diff --git a/pkg/tsdb/mssql/mssql.go b/pkg/tsdb/mssql/mssql.go
index 1ca3778b9d..debe106fa7 100644
--- a/pkg/tsdb/mssql/mssql.go
+++ b/pkg/tsdb/mssql/mssql.go
@@ -8,7 +8,7 @@ import (
"github.com/grafana/grafana/pkg/setting"
_ "github.com/denisenkom/go-mssqldb"
- "github.com/go-xorm/core"
+ "xorm.io/core"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/tsdb"
diff --git a/pkg/tsdb/mssql/mssql_test.go b/pkg/tsdb/mssql/mssql_test.go
index 760c6dcf07..84e5e0e219 100644
--- a/pkg/tsdb/mssql/mssql_test.go
+++ b/pkg/tsdb/mssql/mssql_test.go
@@ -8,7 +8,7 @@ import (
"testing"
"time"
- "github.com/go-xorm/xorm"
+ "xorm.io/xorm"
"github.com/grafana/grafana/pkg/components/securejsondata"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/models"
diff --git a/pkg/tsdb/mysql/mysql.go b/pkg/tsdb/mysql/mysql.go
index 682c3bc456..5ae7a9a87d 100644
--- a/pkg/tsdb/mysql/mysql.go
+++ b/pkg/tsdb/mysql/mysql.go
@@ -13,7 +13,7 @@ import (
"github.com/grafana/grafana/pkg/setting"
"github.com/go-sql-driver/mysql"
- "github.com/go-xorm/core"
+ "xorm.io/core"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/tsdb"
diff --git a/pkg/tsdb/mysql/mysql_test.go b/pkg/tsdb/mysql/mysql_test.go
index b2ff2bc969..609f923d2c 100644
--- a/pkg/tsdb/mysql/mysql_test.go
+++ b/pkg/tsdb/mysql/mysql_test.go
@@ -8,7 +8,7 @@ import (
"testing"
"time"
- "github.com/go-xorm/xorm"
+ "xorm.io/xorm"
"github.com/grafana/grafana/pkg/components/securejsondata"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/models"
diff --git a/pkg/tsdb/postgres/postgres.go b/pkg/tsdb/postgres/postgres.go
index a417699c1d..f38b94913b 100644
--- a/pkg/tsdb/postgres/postgres.go
+++ b/pkg/tsdb/postgres/postgres.go
@@ -7,7 +7,7 @@ import (
"github.com/grafana/grafana/pkg/setting"
- "github.com/go-xorm/core"
+ "xorm.io/core"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/tsdb"
diff --git a/pkg/tsdb/postgres/postgres_test.go b/pkg/tsdb/postgres/postgres_test.go
index 23d0830d3d..d839d42ddb 100644
--- a/pkg/tsdb/postgres/postgres_test.go
+++ b/pkg/tsdb/postgres/postgres_test.go
@@ -8,7 +8,7 @@ import (
"testing"
"time"
- "github.com/go-xorm/xorm"
+ "xorm.io/xorm"
"github.com/grafana/grafana/pkg/components/securejsondata"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/models"
diff --git a/pkg/tsdb/sqleng/sql_engine.go b/pkg/tsdb/sqleng/sql_engine.go
index 0cfb1560e4..13bc84bd06 100644
--- a/pkg/tsdb/sqleng/sql_engine.go
+++ b/pkg/tsdb/sqleng/sql_engine.go
@@ -19,8 +19,8 @@ import (
"github.com/grafana/grafana/pkg/components/null"
- "github.com/go-xorm/core"
- "github.com/go-xorm/xorm"
+ "xorm.io/core"
+ "xorm.io/xorm"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/models"
)

View File

@ -9,20 +9,14 @@
end} end}
# Unbundle Grafana vendor sources and instead use BuildRequires # Unbundle Grafana vendor sources and instead use BuildRequires
# only on platforms that have enough golang devel support. # on platforms that have enough golang devel support.
%if 0%{?rhel} == 0 %if 0%{?rhel} == 0
%global unbundle_vendor_sources 1 %global unbundle_vendor_sources 1
%endif %endif
%if 0%{?fedora} >= 30
# Use vendor sources until both Fedora and Grafana properly support golang modules
%global unbundle_vendor_sources 0
%endif
Name: grafana Name: grafana
Version: 6.3.6 Version: 6.6.2
Release: 2%{?dist} Release: 1%{?dist}
Summary: Metrics dashboard and graph editor Summary: Metrics dashboard and graph editor
License: ASL 2.0 License: ASL 2.0
URL: https://grafana.org URL: https://grafana.org
@ -36,12 +30,17 @@ Source1: grafana_webpack-%{version}.tar.gz
# Source2 is the script to create the above webpack from grafana sources # Source2 is the script to create the above webpack from grafana sources
Source2: make_grafana_webpack.sh Source2: make_grafana_webpack.sh
# Patches for upstream # Patches
Patch0: 000-set-version-string.patch
Patch1: 001-login-oauth-use-oauth2-exchange.patch Patch1: 001-login-oauth-use-oauth2-exchange.patch
Patch2: 002-remove-jaeger-tracing.patch Patch2: 002-remove-jaeger-tracing.patch
Patch3: 003-new-files.patch Patch3: 003-new-files.patch
Patch4: 004-xerrors.patch Patch4: 004-wrappers-grafana-cli.patch
Patch5: 005-mute-shellcheck-grafana-cli.patch Patch5: 005-pkg-main-fix-import-paths.patch
Patch6: 006-pkg-setting-ini-default-section.patch
Patch7: 007-pkg-prometheus-client-query-range.patch
Patch8: 008-pkg-services-notifications-codes-Unknwon.patch
Patch9: 009-pkg-fix-xorm-import.patch
# Intersection of go_arches and nodejs_arches # Intersection of go_arches and nodejs_arches
ExclusiveArch: %{grafana_arches} ExclusiveArch: %{grafana_arches}
@ -58,7 +57,7 @@ ExclusiveArch: %{grafana_arches}
%{?systemd_requires} %{?systemd_requires}
Requires(pre): shadow-utils Requires(pre): shadow-utils
BuildRequires: git, systemd, golang, go-srpm-macros BuildRequires: git, systemd, golang, go-srpm-macros go-rpm-macros
Recommends: grafana-cloudwatch = %{version}-%{release} Recommends: grafana-cloudwatch = %{version}-%{release}
Recommends: grafana-elasticsearch = %{version}-%{release} Recommends: grafana-elasticsearch = %{version}-%{release}
@ -72,145 +71,138 @@ Recommends: grafana-opentsdb = %{version}-%{release}
Recommends: grafana-postgres = %{version}-%{release} Recommends: grafana-postgres = %{version}-%{release}
Recommends: grafana-prometheus = %{version}-%{release} Recommends: grafana-prometheus = %{version}-%{release}
Recommends: grafana-stackdriver = %{version}-%{release} Recommends: grafana-stackdriver = %{version}-%{release}
Recommends: grafana-pcp Recommends: grafana-pcp >= 2
%if 0%{?unbundle_vendor_sources} %if 0%{?unbundle_vendor_sources}
# golang build deps. These allow us to unbundle vendor golang source. # golang build deps. These allow us to unbundle vendor golang source.
# Note: commented lines are still vendored. See the build section below
BuildRequires: golang(cloud.google.com/go)
BuildRequires: golang(github.com/BurntSushi/toml)
BuildRequires: golang(github.com/VividCortex/mysqlerr)
BuildRequires: golang(github.com/apache/arrow/go/arrow)
BuildRequires: golang(github.com/aws/aws-sdk-go) BuildRequires: golang(github.com/aws/aws-sdk-go)
BuildRequires: golang(github.com/beevik/etree)
BuildRequires: golang(github.com/benbjohnson/clock) BuildRequires: golang(github.com/benbjohnson/clock)
BuildRequires: golang(github.com/beorn7/perks/quantile) BuildRequires: golang(github.com/beorn7/perks/quantile)
BuildRequires: golang(github.com/bmizerany/assert)
BuildRequires: golang(github.com/bradfitz/gomemcache/memcache) BuildRequires: golang(github.com/bradfitz/gomemcache/memcache)
BuildRequires: golang(github.com/BurntSushi/toml) BuildRequires: golang(github.com/cespare/xxhash)
BuildRequires: golang(github.com/codahale/hdrhistogram) BuildRequires: golang(github.com/cheekybits/genny/generic)
BuildRequires: golang(github.com/codegangsta/cli) BuildRequires: golang(github.com/codegangsta/cli)
BuildRequires: golang(github.com/crewjam/saml)
BuildRequires: golang(github.com/crewjam/saml/xmlenc)
BuildRequires: golang(github.com/crewjam/saml/logger)
BuildRequires: golang(github.com/crewjam/httperr)
BuildRequires: golang(github.com/davecgh/go-spew/spew) BuildRequires: golang(github.com/davecgh/go-spew/spew)
BuildRequires: golang(github.com/denisenkom/go-mssqldb) BuildRequires: golang(github.com/denisenkom/go-mssqldb)
BuildRequires: golang(github.com/facebookgo/inject) BuildRequires: golang(github.com/facebookgo/inject)
BuildRequires: golang(github.com/facebookgo/structtag) BuildRequires: golang(github.com/facebookgo/structtag)
BuildRequires: golang(github.com/fatih/color) BuildRequires: golang(github.com/fatih/color)
BuildRequires: golang(github.com/go-ini/ini)
BuildRequires: golang(google.golang.org/appengine)
BuildRequires: golang(golang.org/x/sys/unix)
BuildRequires: golang(github.com/go-macaron/binding) BuildRequires: golang(github.com/go-macaron/binding)
BuildRequires: golang(github.com/go-macaron/gzip) BuildRequires: golang(github.com/go-macaron/gzip)
BuildRequires: golang(github.com/go-macaron/inject) BuildRequires: golang(github.com/go-macaron/inject)
BuildRequires: golang(github.com/go-macaron/session) BuildRequires: golang(github.com/go-macaron/session)
BuildRequires: golang(google.golang.org/genproto/googleapis/rpc/status) BuildRequires: golang(github.com/go-sql-driver/mysql)
BuildRequires: golang(github.com/go-stack/stack)
BuildRequires: golang(xorm.io/xorm)
BuildRequires: golang(xorm.io/core)
BuildRequires: golang(xorm.io/builder) >= 0.3.6
BuildRequires: golang(github.com/gobwas/glob) BuildRequires: golang(github.com/gobwas/glob)
BuildRequires: golang(github.com/gobwas/glob/compiler) BuildRequires: golang(github.com/golang/snappy)
BuildRequires: golang(github.com/gobwas/glob/match) BuildRequires: golang(github.com/google/flatbuffers/go)
BuildRequires: golang(github.com/gobwas/glob/syntax)
BuildRequires: golang(github.com/gobwas/glob/syntax/ast)
BuildRequires: golang(github.com/gobwas/glob/syntax/lexer)
BuildRequires: golang(github.com/gobwas/glob/util/runes)
BuildRequires: golang(github.com/gobwas/glob/util/strings)
BuildRequires: golang(github.com/gopherjs/gopherjs/js) BuildRequires: golang(github.com/gopherjs/gopherjs/js)
BuildRequires: golang(github.com/gorilla/websocket) BuildRequires: golang(github.com/gorilla/websocket)
BuildRequires: golang(github.com/gosimple/slug) BuildRequires: golang(github.com/gosimple/slug)
BuildRequires: golang(github.com/go-sql-driver/mysql)
BuildRequires: golang(github.com/go-stack/stack) # These two are considered part of grafana, use vendored code
BuildRequires: golang(github.com/go-xorm/builder) # BuildRequires: golang(github.com/grafana/grafana-plugin-model)
BuildRequires: golang(github.com/go-xorm/core) # BuildRequires: golang(github.com/grafana/grafana-plugin-sdk-go)
BuildRequires: golang(github.com/go-xorm/xorm)
BuildRequires: golang(google.golang.org/grpc) BuildRequires: golang(github.com/grpc-ecosystem/go-grpc-prometheus)
BuildRequires: golang(github.com/golang/protobuf/proto)
BuildRequires: golang(github.com/golang/protobuf/ptypes/any)
BuildRequires: golang(github.com/golang/protobuf/ptypes/duration)
BuildRequires: golang(github.com/golang/protobuf/ptypes/empty)
BuildRequires: golang(github.com/golang/protobuf/ptypes/timestamp)
BuildRequires: golang(github.com/hashicorp/go-hclog) BuildRequires: golang(github.com/hashicorp/go-hclog)
# need grpc_broker in go-plugin >= 1.0.0-1
BuildRequires: golang(github.com/hashicorp/go-plugin) BuildRequires: golang(github.com/hashicorp/go-plugin)
BuildRequires: golang(github.com/hashicorp/go-version) BuildRequires: golang(github.com/hashicorp/go-version)
BuildRequires: golang(github.com/hashicorp/yamux) BuildRequires: golang(github.com/hashicorp/yamux)
BuildRequires: golang(github.com/inconshreveable/log15) BuildRequires: golang(github.com/inconshreveable/log15)
BuildRequires: golang(github.com/jmespath/go-jmespath) BuildRequires: golang(github.com/jmespath/go-jmespath)
BuildRequires: golang(github.com/jonboulle/clockwork)
BuildRequires: golang(github.com/json-iterator/go)
BuildRequires: golang(github.com/jtolds/gls) BuildRequires: golang(github.com/jtolds/gls)
BuildRequires: golang(github.com/klauspost/compress/flate) BuildRequires: golang(github.com/jung-kurt/gofpdf)
BuildRequires: golang(github.com/klauspost/compress/gzip) BuildRequires: golang(github.com/klauspost/compress)
BuildRequires: golang(github.com/klauspost/compress/snappy)
BuildRequires: golang(github.com/klauspost/cpuid) BuildRequires: golang(github.com/klauspost/cpuid)
BuildRequires: golang(github.com/klauspost/crc32)
BuildRequires: golang(github.com/kr/pretty)
BuildRequires: golang(github.com/kr/text)
BuildRequires: golang(github.com/lib/pq) BuildRequires: golang(github.com/lib/pq)
BuildRequires: golang(github.com/linkedin/goavro)
BuildRequires: golang(github.com/mattetti/filebuffer)
BuildRequires: golang(github.com/mattn/go-colorable) BuildRequires: golang(github.com/mattn/go-colorable)
BuildRequires: golang(github.com/mattn/go-isatty) BuildRequires: golang(github.com/mattn/go-isatty)
BuildRequires: golang(github.com/mattn/go-sqlite3) BuildRequires: golang(github.com/mattn/go-sqlite3)
BuildRequires: golang(github.com/matttproud/golang_protobuf_extensions/pbutil) BuildRequires: golang(github.com/matttproud/golang_protobuf_extensions/pbutil)
BuildRequires: golang(github.com/mitchellh/go-testing-interface) BuildRequires: golang(github.com/mitchellh/go-testing-interface)
BuildRequires: golang(github.com/modern-go/concurrent)
BuildRequires: golang(github.com/modern-go/reflect2)
BuildRequires: golang(github.com/oklog/run) BuildRequires: golang(github.com/oklog/run)
BuildRequires: golang(github.com/opentracing/opentracing-go) BuildRequires: golang(github.com/opentracing/opentracing-go)
BuildRequires: golang(github.com/patrickmn/go-cache) BuildRequires: golang(github.com/patrickmn/go-cache)
BuildRequires: golang(github.com/pkg/errors) BuildRequires: golang(github.com/pkg/errors)
BuildRequires: golang(github.com/pmezard/go-difflib/difflib)
BuildRequires: golang(github.com/prometheus/client_golang/api) BuildRequires: golang(github.com/prometheus/client_golang/api)
BuildRequires: golang(github.com/prometheus/client_golang/api/prometheus/v1)
BuildRequires: golang(github.com/prometheus/client_model/go) BuildRequires: golang(github.com/prometheus/client_model/go)
BuildRequires: golang-github-prometheus-common-devel
BuildRequires: golang(github.com/prometheus/common/expfmt)
BuildRequires: golang(github.com/prometheus/common/model) BuildRequires: golang(github.com/prometheus/common/model)
BuildRequires: golang(github.com/prometheus/common/expfmt)
BuildRequires: golang(github.com/prometheus/procfs) BuildRequires: golang(github.com/prometheus/procfs)
BuildRequires: golang(github.com/prometheus/procfs/internal/util)
BuildRequires: golang(github.com/prometheus/procfs)
BuildRequires: golang(github.com/prometheus/procfs/internal/util)
BuildRequires: golang(github.com/prometheus/procfs/nfs)
BuildRequires: golang(github.com/prometheus/procfs/xfs)
BuildRequires: golang(github.com/rainycape/unidecode) BuildRequires: golang(github.com/rainycape/unidecode)
BuildRequires: golang(github.com/robfig/cron)
BuildRequires: golang(gopkg.in/robfig/cron.v3)
BuildRequires: golang(github.com/russellhaering/goxmldsig)
BuildRequires: golang(github.com/sergi/go-diff/diffmatchpatch) BuildRequires: golang(github.com/sergi/go-diff/diffmatchpatch)
BuildRequires: golang(github.com/smartystreets/assertions) BuildRequires: golang(github.com/smartystreets/assertions)
BuildRequires: golang(github.com/smartystreets/goconvey/convey) BuildRequires: golang(github.com/smartystreets/goconvey/convey)
BuildRequires: golang(github.com/smartystreets/goconvey/convey/gotest) BuildRequires: golang(github.com/smartystreets/goconvey/convey/gotest)
BuildRequires: golang(github.com/smartystreets/goconvey/convey/reporting) BuildRequires: golang(github.com/smartystreets/goconvey/convey/reporting)
BuildRequires: golang(github.com/stretchr/testify)
BuildRequires: golang(github.com/teris-io/shortid) BuildRequires: golang(github.com/teris-io/shortid)
BuildRequires: golang(github.com/ua-parser/uap-go/uaparser)
BuildRequires: golang(github.com/Unknwon/com) BuildRequires: golang(github.com/Unknwon/com)
BuildRequires: golang(github.com/VividCortex/mysqlerr)
BuildRequires: golang(github.com/yudai/gojsondiff) BuildRequires: golang(github.com/yudai/gojsondiff)
BuildRequires: golang(github.com/yudai/golcs) BuildRequires: golang(github.com/yudai/golcs)
BuildRequires: golang(golang.org/x/crypto/pbkdf2) BuildRequires: golang(go.uber.org/atomic)
BuildRequires: golang(golang.org/x/crypto/ed25519) BuildRequires: golang(golang.org/x/crypto/ed25519)
BuildRequires: golang(golang.org/x/crypto/md4) BuildRequires: golang(golang.org/x/crypto/md4)
BuildRequires: golang(golang.org/x/crypto/pbkdf2)
BuildRequires: golang(golang.org/x/crypto/ripemd160)
BuildRequires: golang(golang.org/x/lint)
BuildRequires: golang(golang.org/x/net/context) BuildRequires: golang(golang.org/x/net/context)
BuildRequires: golang(golang.org/x/net/context/ctxhttp)
BuildRequires: golang(golang.org/x/net/http2)
BuildRequires: golang(golang.org/x/net/http2/hpack)
BuildRequires: golang(golang.org/x/net/http/httpguts) BuildRequires: golang(golang.org/x/net/http/httpguts)
BuildRequires: golang(golang.org/x/net/http2)
BuildRequires: golang(golang.org/x/net/idna) BuildRequires: golang(golang.org/x/net/idna)
BuildRequires: golang(golang.org/x/net/internal/timeseries) BuildRequires: golang(golang.org/x/net/internal/timeseries)
BuildRequires: golang(golang.org/x/net/trace) BuildRequires: golang(golang.org/x/net/trace)
BuildRequires: golang(golang.org/x/text/collate)
BuildRequires: golang(golang.org/x/text/collate/build)
BuildRequires: golang(golang.org/x/text/internal/colltab)
BuildRequires: golang(golang.org/x/text/internal/gen)
BuildRequires: golang(golang.org/x/text/internal/tag)
BuildRequires: golang(golang.org/x/text/internal/triegen)
BuildRequires: golang(golang.org/x/text/internal/ucd)
BuildRequires: golang(golang.org/x/oauth2) BuildRequires: golang(golang.org/x/oauth2)
BuildRequires: golang(golang.org/x/oauth2/google) BuildRequires: golang(golang.org/x/sync/errgroup)
BuildRequires: golang(golang.org/x/oauth2/internal) BuildRequires: golang(golang.org/x/sys/unix)
BuildRequires: golang(golang.org/x/oauth2/jws) BuildRequires: golang(golang.org/x/text)
BuildRequires: golang(golang.org/x/oauth2/jwt) BuildRequires: golang(golang.org/x/tools/go/ast/astutil)
BuildRequires: golang(github.com/golang/protobuf/proto) BuildRequires: golang(golang.org/x/tools/go/gcexportdata)
BuildRequires: golang(github.com/golang/protobuf/ptypes) BuildRequires: golang(golang.org/x/tools/go/internal/gcimporter)
BuildRequires: golang(github.com/golang/protobuf/ptypes) BuildRequires: golang(golang.org/x/xerrors)
BuildRequires: golang(github.com/golang/protobuf/ptypes/duration) BuildRequires: golang(google.golang.org/appengine)
BuildRequires: golang(github.com/golang/protobuf/ptypes/any) BuildRequires: golang(google.golang.org/genproto/googleapis/rpc/status)
BuildRequires: golang(github.com/golang/protobuf/ptypes/timestamp) BuildRequires: golang(google.golang.org/grpc)
BuildRequires: golang(cloud.google.com/go/compute/metadata)
BuildRequires: golang(gopkg.in/alexcesaro/quotedprintable.v3) BuildRequires: golang(gopkg.in/alexcesaro/quotedprintable.v3)
BuildRequires: golang(gopkg.in/asn1-ber.v1) BuildRequires: golang(gopkg.in/asn1-ber.v1)
BuildRequires: golang(github.com/go-bufio/bufio) BuildRequires: golang(gopkg.in/ini.v1)
BuildRequires: golang(github.com/go-ini/ini)
BuildRequires: golang(github.com/go-macaron/macaron)
BuildRequires: golang(github.com/go-redis/redis)
BuildRequires: golang(gopkg.in/square/go-jose.v2)
BuildRequires: golang(gopkg.in/square/go-jose.v2/cipher)
BuildRequires: golang(gopkg.in/square/go-jose.v2/json)
%if 0%{fedora} >= 31
BuildRequires: golang(gopkg.in/yaml.v2)
%else
BuildRequires: golang(github.com/go-yaml/yaml)
%endif
BuildRequires: golang(golang.org/x/sync/errgroup)
BuildRequires: golang(gopkg.in/ldap.v3) BuildRequires: golang(gopkg.in/ldap.v3)
BuildRequires: golang(gopkg.in/macaron.v1)
BuildRequires: golang(gopkg.in/mail.v2) BuildRequires: golang(gopkg.in/mail.v2)
BuildRequires: golang(github.com/jonboulle/clockwork) BuildRequires: golang(gopkg.in/redis.v5)
BuildRequires: golang(gopkg.in/square/go-jose.v2)
BuildRequires: golang(gopkg.in/yaml.v2)
%endif %endif
# Declare all nodejs modules bundled in the webpack - this is for security # Declare all nodejs modules bundled in the webpack - this is for security
@ -404,11 +396,16 @@ The Grafana stackdriver datasource.
%prep %prep
%setup -q -T -D -b 0 %setup -q -T -D -b 0
%setup -q -T -D -b 1 %setup -q -T -D -b 1
%patch0 -p1
%patch1 -p1 %patch1 -p1
%patch2 -p1 %patch2 -p1
%patch3 -p1 %patch3 -p1
%patch4 -p1 %patch4 -p1
%patch5 -p1 %patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
# Set up build subdirs and links # Set up build subdirs and links
mkdir -p %{_builddir}/src/github.com/grafana mkdir -p %{_builddir}/src/github.com/grafana
@ -420,36 +417,26 @@ rm -f public/sass/.sass-lint.yml public/test/.jshintrc
%if 0%{?unbundle_vendor_sources} %if 0%{?unbundle_vendor_sources}
# Unbundle all grafana vendor sources, as per BuildRequires above. # Unbundle all grafana vendor sources, as per BuildRequires above.
# An exception is grafana-plugin-model, which is part of grafana. # Note there are some exceptions.
cp --parents -a vendor/github.com/grafana \ cp --parents -a \
vendor/golang.org/x/xerrors \ vendor/github.com/grafana/grafana-plugin-model \
vendor/github.com/robfig vendor/github.com/crewjam/saml \ vendor/github.com/grafana/grafana-plugin-sdk-go \
vendor/github.com/ua-parser/uap-go/uaparser \
vendor/github.com/beevik/etree \
vendor/github.com/russellhaering/goxmldsig \
%{_builddir} %{_builddir}
rm -r vendor # remove all vendor sources rm -r vendor # remove all vendor sources
mv %{_builddir}/vendor vendor # put back what we're keeping mv %{_builddir}/vendor vendor # put back what we're keeping
%endif %endif
%build %build
# Build the server-side binaries # Build the server-side binaries
cd %{_builddir}/src/github.com/grafana/grafana cd %{_builddir}/src/github.com/grafana/grafana
%global archbindir bin/`go env GOOS`-`go env GOARCH` %global archbindir bin/`go env GOOS`-`go env GOARCH`
echo _builddir=%{_builddir} archbindir=%{archbindir} echo _builddir=%{_builddir} archbindir=%{archbindir} gopath=%{gopath}
[ ! -d %{archbindir} ] && mkdir -p %{archbindir} [ ! -d %{archbindir} ] && mkdir -p %{archbindir}
# non-modular build
export GOPATH=%{_builddir}:%{gopath} export GOPATH=%{_builddir}:%{gopath}
# export GO111MODULE=off export GO111MODULE=off; rm -f go.mod
%if 0%{?fedora} >= 31 %gobuild -o %{archbindir}/grafana-cli ./pkg/cmd/grafana-cli
# native fedora golang build but without modules (no grafana support yet) %gobuild -o %{archbindir}/grafana-server ./pkg/cmd/grafana-server
go build -mod=vendor -o %{archbindir}/grafana-cli ./pkg/cmd/grafana-cli
go build -mod=vendor -o %{archbindir}/grafana-server ./pkg/cmd/grafana-server
%else
# use the grafana build.go script.
go run build.go build
%endif
%install %install
# Fix up arch bin directories # Fix up arch bin directories
@ -463,7 +450,8 @@ go run build.go build
# dirs, shared files, public html, webpack # dirs, shared files, public html, webpack
install -d %{buildroot}%{_sbindir} install -d %{buildroot}%{_sbindir}
install -d %{buildroot}%{_datadir}/%{name}/bin install -d %{buildroot}%{_datadir}/%{name}
install -d %{buildroot}%{_libexecdir}/%{name}
cp -a conf public %{buildroot}%{_datadir}/%{name} cp -a conf public %{buildroot}%{_datadir}/%{name}
# wrappers # wrappers
@ -471,7 +459,7 @@ install -p -m 755 packaging/wrappers/grafana-cli %{buildroot}%{_sbindir}/%{name}
# binaries # binaries
install -p -m 755 %{archbindir}/%{name}-server %{buildroot}%{_sbindir} install -p -m 755 %{archbindir}/%{name}-server %{buildroot}%{_sbindir}
install -p -m 755 %{archbindir}/%{name}-cli %{buildroot}%{_datadir}/%{name}/bin install -p -m 755 %{archbindir}/%{name}-cli %{buildroot}%{_libexecdir}/%{name}
# man pages # man pages
install -d %{buildroot}%{_mandir}/man1 install -d %{buildroot}%{_mandir}/man1
@ -528,19 +516,19 @@ exit 0
%check %check
cd %{_builddir}/src/github.com/grafana/grafana cd %{_builddir}/src/github.com/grafana/grafana
export GOPATH=%{_builddir}:%{gopath} export GOPATH=%{_builddir}:%{gopath}
# remove tests currently failing # remove tests currently failing - these two are due to a symlink
# BUILD/src/github.com/grafana/grafana -> BUILD/grafana-6.6.1
rm -f pkg/services/provisioning/dashboards/file_reader_linux_test.go rm -f pkg/services/provisioning/dashboards/file_reader_linux_test.go
rm -f pkg/services/provisioning/dashboards/file_reader_test.go rm -f pkg/services/provisioning/dashboards/file_reader_test.go
rm -f pkg/services/sqlstore/alert_test.go
rm -f pkg/services/sqlstore/apikey_test.go
export GO111MODULE=off export GO111MODULE=off
go test ./pkg/... %gotest ./pkg/...
%files %files
# binaries # binaries and wrappers
%{_sbindir}/%{name}-server %{_sbindir}/%{name}-server
%{_sbindir}/%{name}-cli %{_sbindir}/%{name}-cli
%{_libexecdir}/%{name}
# config files # config files
%dir %{_sysconfdir}/%{name} %dir %{_sysconfdir}/%{name}
@ -556,7 +544,7 @@ go test ./pkg/...
%attr(-, %{GRAFANA_USER}, %{GRAFANA_GROUP}) %dir %{_sharedstatedir}/%{name}/plugins %attr(-, %{GRAFANA_USER}, %{GRAFANA_GROUP}) %dir %{_sharedstatedir}/%{name}/plugins
# shared directory and all files therein, except some datasources # shared directory and all files therein, except some datasources
%{_datadir}/%{name}/bin %{_datadir}/%{name}
%{_datadir}/%{name}/public %{_datadir}/%{name}/public
# built-in datasources that are sub-packaged # built-in datasources that are sub-packaged
@ -633,8 +621,12 @@ go test ./pkg/...
%changelog %changelog
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 6.3.6-2 * Wed Feb 26 2020 Mark Goodwin <mgoodwin@redhat.com> 6.6.2-1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - added patch0 to set the version string correctly
- removed patch 004-xerrors.patch, it's now upstream
- added several patches for golang vendored vrs build dep differences
- added patch to move grafana-cli binary to libexec dir
- update to 6.6.2 tagged upstream community sources, see CHANGELOG
* Wed Nov 20 2019 Mark Goodwin <mgoodwin@redhat.com> 6.3.6-1 * Wed Nov 20 2019 Mark Goodwin <mgoodwin@redhat.com> 6.3.6-1
- add weak depenency on grafana-pcp - add weak depenency on grafana-pcp

View File

@ -1,2 +1,2 @@
SHA512 (grafana-6.3.6.tar.gz) = 141ba6db2dfa376471dc43cb9be432bad73de39a5e5f587d394484c6f49a5d3a67dacc0fec45ab658c6a5729ee073f2572baddee14fc6b0e2ed0d5582414be6c SHA512 (grafana-6.6.2.tar.gz) = 43019302a2ade713a8f8429ce9dd3a1016c5aa3afe1af463ef905718aa018d429e8872b262c0c9bc72ea7cb6a08c7b47769af6c5cec098dfd4ce70ff36715a86
SHA512 (grafana_webpack-6.3.6.tar.gz) = 076c921fdd7cb59869b521ef0eb88d74b80005da49df6b7cde450b34ce1236e3595b26ab6e45ade50e8b219914ef476413e40790a0842daf7e726e671a9327bd SHA512 (grafana_webpack-6.6.2.tar.gz) = d2d1a50f6b51738f68ff33844479c361ba61f023af02b7c48e4a67eefd85ca3a485a626c4ac10b3d7c13ddf40fffe2ca7f6faac29173cd8dc66586f38587ec89