Blame grafana.spec

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