Update to latest upstream sources v6.3.6

This commit is contained in:
Mark Goodwin 2019-11-27 10:35:10 +11:00
parent 25db04d286
commit 47a36c9081
5 changed files with 82 additions and 29 deletions

2
.gitignore vendored
View File

@ -6,3 +6,5 @@
/grafana_webpack-6.2.2.tar.gz
/grafana-6.3.5.tar.gz
/grafana_webpack-6.3.5.tar.gz
/grafana-6.3.6.tar.gz
/grafana_webpack-6.3.6.tar.gz

View File

@ -1,9 +1,9 @@
diff --git a/conf/distro-defaults.ini b/conf/distro-defaults.ini
new file mode 100644
index 000000000..e7a0c5062
index 0000000000..e337ba0b57
--- /dev/null
+++ b/conf/distro-defaults.ini
@@ -0,0 +1,683 @@
@@ -0,0 +1,685 @@
+##################### Grafana Configuration Defaults for distros #####################
+#
+# Do not modify this file in grafana installs
@ -598,8 +598,10 @@ index 000000000..e7a0c5062
+#################################### Internal Grafana Metrics ############
+# Metrics available at HTTP API Url /metrics
+[metrics]
+enabled = true
+interval_seconds = 10
+enabled = true
+interval_seconds = 10
+# Disable total stats (stat_totals_*) metrics to be generated
+disable_total_stats = false
+
+#If both are set, basic auth will be required for the metrics endpoint.
+basic_auth_username =
@ -689,7 +691,7 @@ index 000000000..e7a0c5062
+license_path =
diff --git a/docs/man/man1/grafana-cli.1 b/docs/man/man1/grafana-cli.1
new file mode 100644
index 000000000..171748fcd
index 0000000000..171748fcda
--- /dev/null
+++ b/docs/man/man1/grafana-cli.1
@@ -0,0 +1,51 @@
@ -746,7 +748,7 @@ index 000000000..171748fcd
+.BR http://docs.grafana.org/ .
diff --git a/docs/man/man1/grafana-server.1 b/docs/man/man1/grafana-server.1
new file mode 100644
index 000000000..30b7c1306
index 0000000000..30b7c1306f
--- /dev/null
+++ b/docs/man/man1/grafana-server.1
@@ -0,0 +1,156 @@
@ -908,7 +910,7 @@ index 000000000..30b7c1306
+.BR http://docs.grafana.org/ .
diff --git a/packaging/rpm/spec/README b/packaging/rpm/spec/README
new file mode 100644
index 000000000..f97c2a26b
index 0000000000..f97c2a26be
--- /dev/null
+++ b/packaging/rpm/spec/README
@@ -0,0 +1,7 @@
@ -921,10 +923,10 @@ index 000000000..f97c2a26b
+
diff --git a/packaging/rpm/spec/grafana.spec b/packaging/rpm/spec/grafana.spec
new file mode 100644
index 000000000..81d21aaf4
index 0000000000..fb9200cb62
--- /dev/null
+++ b/packaging/rpm/spec/grafana.spec
@@ -0,0 +1,737 @@
@@ -0,0 +1,766 @@
+%global grafana_arches %{lua: go_arches = {}
+ for arch in rpm.expand("%{go_arches}"):gmatch("%S+") do
+ go_arches[arch] = 1
@ -935,15 +937,20 @@ index 000000000..81d21aaf4
+ 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.
+%if 0%{?rhel} == 0
+%global unbundle_vendor_sources 1
+%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
+Version: 6.3.4
+Version: 6.3.6
+Release: 1%{?dist}
+Summary: Metrics dashboard and graph editor
+License: ASL 2.0
@ -962,12 +969,14 @@ index 000000000..81d21aaf4
+Patch1: 001-login-oauth-use-oauth2-exchange.patch
+Patch2: 002-remove-jaeger-tracing.patch
+Patch3: 003-new-files.patch
+Patch4: 004-fix-uaparser-32bit.patch
+Patch4: 004-xerrors.patch
+Patch5: 005-mute-shellcheck-grafana-cli.patch
+
+# Intersection of go_arches and nodejs_arches
+ExclusiveArch: %{grafana_arches}
+
+# omit golang debugsource, see BZ995136 and related
+%global dwz_low_mem_die_limit 0
+%global _debugsource_template %{nil}
+
+%global GRAFANA_USER %{name}
@ -992,6 +1001,7 @@ index 000000000..81d21aaf4
+Recommends: grafana-postgres = %{version}-%{release}
+Recommends: grafana-prometheus = %{version}-%{release}
+Recommends: grafana-stackdriver = %{version}-%{release}
+Recommends: grafana-pcp
+
+%if 0%{?unbundle_vendor_sources}
+# golang build deps. These allow us to unbundle vendor golang source.
@ -1121,7 +1131,11 @@ index 000000000..81d21aaf4
+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/mail.v2)
@ -1323,6 +1337,7 @@ index 000000000..81d21aaf4
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+
+# Set up build subdirs and links
+mkdir -p %{_builddir}/src/github.com/grafana
@ -1335,9 +1350,8 @@ index 000000000..81d21aaf4
+%if 0%{?unbundle_vendor_sources}
+# Unbundle all grafana vendor sources, as per BuildRequires above.
+# An exception is grafana-plugin-model, which is part of grafana.
+# Another exception is xerrors, which is a transition package
+# for the new Go 1.13 error values, see https://github.com/golang/xerrors
+cp --parents -a vendor/github.com/grafana vendor/golang.org/x/xerrors \
+cp --parents -a vendor/github.com/grafana \
+ vendor/golang.org/x/xerrors \
+ vendor/github.com/robfig vendor/github.com/crewjam/saml \
+ vendor/github.com/ua-parser/uap-go/uaparser \
+ vendor/github.com/beevik/etree \
@ -1349,15 +1363,19 @@ index 000000000..81d21aaf4
+
+
+%build
+# Build the server-side binaries: grafana-server and grafana-cli
+%if 0%{?gobuild}
+# use modern go macros such as in recent Fedora
+export GOPATH=%{_builddir}:%{gopath}
+%gobuild -o grafana-cli ./pkg/cmd/grafana-cli
+%gobuild -o grafana-server ./pkg/cmd/grafana-server
+%else
+# Build the server-side binaries
+cd %{_builddir}/src/github.com/grafana/grafana
+%global archbindir bin/`go env GOOS`-`go env GOARCH`
+echo _builddir=%{_builddir} archbindir=%{archbindir}
+[ ! -d %{archbindir} ] && mkdir -p %{archbindir}
+export GOPATH=%{_builddir}:%{gopath}
+# export GO111MODULE=off
+%if 0%{?fedora} >= 31
+# native fedora golang build but without modules (no grafana support yet)
+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
+
@ -1381,8 +1399,8 @@ index 000000000..81d21aaf4
+install -p -m 755 packaging/wrappers/grafana-cli %{buildroot}%{_sbindir}/%{name}-cli
+
+# binaries
+install -p -m 755 bin/%{_arch}/%{name}-server %{buildroot}%{_sbindir}
+install -p -m 755 bin/%{_arch}/%{name}-cli %{buildroot}%{_datadir}/%{name}/bin
+install -p -m 755 %{archbindir}/%{name}-server %{buildroot}%{_sbindir}
+install -p -m 755 %{archbindir}/%{name}-cli %{buildroot}%{_datadir}/%{name}/bin
+
+# man pages
+install -d %{buildroot}%{_mandir}/man1
@ -1444,6 +1462,7 @@ index 000000000..81d21aaf4
+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
+go test ./pkg/...
+
+
@ -1543,7 +1562,19 @@ index 000000000..81d21aaf4
+
+
+%changelog
+* Wed Nov 20 2019 Mark Goodwin <mgoodwin@redhat.com> 6.3.6-1
+- add weak depenency on grafana-pcp
+- add patch to mute shellcheck SC1090 for grafana-cli
+- update to 6.3.6 upstream community sources, see CHANGELOG
+
+* Thu Sep 05 2019 Mark Goodwin <mgoodwin@redhat.com> 6.3.5-1
+- drop uaparser patch now it's upstream
+- add xerrors patch, see https://github.com/golang/go/issues/32246
+- use vendor sources on rawhide until modules are fully supported
+- update to latest upstream community sources, see CHANGELOG
+
+* Fri Aug 30 2019 Mark Goodwin <mgoodwin@redhat.com> 6.3.4-1
+- include fix for CVE-2019-15043
+- add patch for uaparser on 32bit systems
+- update to latest upstream community sources, see CHANGELOG
+
@ -1664,7 +1695,7 @@ index 000000000..81d21aaf4
+- native RPM spec build with current tagged v5.2.5 sources
diff --git a/packaging/rpm/spec/make_grafana_webpack.sh b/packaging/rpm/spec/make_grafana_webpack.sh
new file mode 100755
index 000000000..47a8025ff
index 0000000000..47a8025ff4
--- /dev/null
+++ b/packaging/rpm/spec/make_grafana_webpack.sh
@@ -0,0 +1,61 @@

View File

@ -0,0 +1,12 @@
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

@ -14,14 +14,14 @@ end}
%global unbundle_vendor_sources 1
%endif
%if 0%{?fedora} >= 31
%if 0%{?fedora} >= 30
# Use vendor sources until both Fedora and Grafana properly support golang modules
%global unbundle_vendor_sources 0
%endif
Name: grafana
Version: 6.3.5
Version: 6.3.6
Release: 1%{?dist}
Summary: Metrics dashboard and graph editor
License: ASL 2.0
@ -41,6 +41,7 @@ Patch1: 001-login-oauth-use-oauth2-exchange.patch
Patch2: 002-remove-jaeger-tracing.patch
Patch3: 003-new-files.patch
Patch4: 004-xerrors.patch
Patch5: 005-mute-shellcheck-grafana-cli.patch
# Intersection of go_arches and nodejs_arches
ExclusiveArch: %{grafana_arches}
@ -71,6 +72,7 @@ Recommends: grafana-opentsdb = %{version}-%{release}
Recommends: grafana-postgres = %{version}-%{release}
Recommends: grafana-prometheus = %{version}-%{release}
Recommends: grafana-stackdriver = %{version}-%{release}
Recommends: grafana-pcp
%if 0%{?unbundle_vendor_sources}
# golang build deps. These allow us to unbundle vendor golang source.
@ -406,6 +408,7 @@ The Grafana stackdriver datasource.
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
# Set up build subdirs and links
mkdir -p %{_builddir}/src/github.com/grafana
@ -630,6 +633,11 @@ go test ./pkg/...
%changelog
* Wed Nov 20 2019 Mark Goodwin <mgoodwin@redhat.com> 6.3.6-1
- add weak depenency on grafana-pcp
- add patch to mute shellcheck SC1090 for grafana-cli
- update to 6.3.6 upstream community sources, see CHANGELOG
* Thu Sep 05 2019 Mark Goodwin <mgoodwin@redhat.com> 6.3.5-1
- drop uaparser patch now it's upstream
- add xerrors patch, see https://github.com/golang/go/issues/32246

View File

@ -1,2 +1,2 @@
SHA512 (grafana-6.3.5.tar.gz) = c0151583bbed121290b091d40aae655ca22901d80ab02eafb5fea96f80bdcb88d070c4d778284d7c4605a420fe8918c82a67a51325cc71d605e4212a6a1c9162
SHA512 (grafana_webpack-6.3.5.tar.gz) = 3967ee64501886994d26c6d6c1f949db9732d1dafbe7dd105ff5de4dc26c4d87831fcc6195f086262e86aa9c10e4be7f012bee8d6c95eb52f835837d3ac6d126
SHA512 (grafana-6.3.6.tar.gz) = 141ba6db2dfa376471dc43cb9be432bad73de39a5e5f587d394484c6f49a5d3a67dacc0fec45ab658c6a5729ee073f2572baddee14fc6b0e2ed0d5582414be6c
SHA512 (grafana_webpack-6.3.6.tar.gz) = 076c921fdd7cb59869b521ef0eb88d74b80005da49df6b7cde450b34ce1236e3595b26ab6e45ade50e8b219914ef476413e40790a0842daf7e726e671a9327bd