import grafana-pcp-2.0.2-1.el8

This commit is contained in:
CentOS Sources 2020-07-28 09:38:46 -04:00 committed by Stepan Oksanichenko
parent 8d9349c668
commit a12970a0ea
5 changed files with 100 additions and 38 deletions

4
.gitignore vendored
View File

@ -1,2 +1,2 @@
SOURCES/grafana-pcp-1.0.5.tar.gz
SOURCES/grafana-pcp-deps-1.0.5.tar.xz
SOURCES/grafana-pcp-2.0.2.tar.gz
SOURCES/grafana-pcp-deps-2.0.2.tar.xz

View File

@ -1,2 +1,2 @@
cad0edd0cf8126b104a3caa5daca2a286a07ddce SOURCES/grafana-pcp-1.0.5.tar.gz
ab4710bc6471ed6af38bc4180cd05d14333866a3 SOURCES/grafana-pcp-deps-1.0.5.tar.xz
72d5789fd9277bc9816f6a0590bb5f044ad1175c SOURCES/grafana-pcp-2.0.2.tar.gz
226f68fa48b86eb4dfdcca73a79ab292adaa6503 SOURCES/grafana-pcp-deps-2.0.2.tar.xz

View File

@ -1,4 +1,4 @@
#!/bin/sh -eu
#!/bin/bash -eu
SRC=$(readlink -f "${1:?Usage: $0 source destination}")
DEST=$(readlink -f "${2:?Usage: $0 source destination}")
@ -13,10 +13,10 @@ else
PATCHES=""
fi
pushd $(mktemp -d)
pushd "$(mktemp -d)"
echo Extracting sources...
tar xfz $SRC
tar xfz "$SRC"
cd grafana-pcp-*
echo Applying patches...
@ -32,6 +32,6 @@ echo Removing files with licensing issues...
rm -rf node_modules/node-notifier
echo Compressing...
XZ_OPT=-9 tar cJf $DEST node_modules
XZ_OPT=-9 tar cJf "$DEST" node_modules
popd

View File

@ -0,0 +1,51 @@
#!/usr/bin/env python3
import sys
import os.path
import tarfile
from io import TextIOWrapper
import json
import re
from packaging import version
def read_declared_pkgs(f):
package_json = json.load(f)
return list(package_json['devDependencies'].keys()) + list(package_json['dependencies'].keys())
def read_installed_pkgs(f):
lockfile = f.read()
return re.findall(r'^"?' # can start with a "
r'(.+?)@.+(?:,.*)?:\n' # characters up to @
r' version "(.+)"', # and the version
lockfile, re.MULTILINE)
def list_provides(declared_pkgs, installed_pkgs):
for declared_pkg in declared_pkgs:
# there can be multiple versions installed of one package (transitive dependencies)
# but rpm doesn't support Provides: with a single package and multiple versions
# so let's declare the oldest version here
versions = [version.parse(pkg_version)
for pkg_name, pkg_version in installed_pkgs if pkg_name == declared_pkg]
oldest_version = sorted(versions)[0]
yield f"Provides: bundled(nodejs-{declared_pkg}) = {oldest_version}"
if __name__ == "__main__":
if len(sys.argv) != 2:
print(f"usage: {sys.argv[0]} grafana-pcp-X.Y.Z.tar.gz", file=sys.stdout)
sys.exit(1)
source_archive_path = sys.argv[1]
root_dir = os.path.basename(source_archive_path)[:-len('.tar.gz')]
with tarfile.open(source_archive_path) as tar:
package_json = TextIOWrapper(tar.extractfile(f'{root_dir}/package.json'))
declared_pkgs = read_declared_pkgs(package_json)
yarn_lock = TextIOWrapper(tar.extractfile(f'{root_dir}/yarn.lock'))
installed_pkgs = read_installed_pkgs(yarn_lock)
provides = list_provides(declared_pkgs, installed_pkgs)
for provide in sorted(provides):
print(provide)

View File

@ -1,5 +1,5 @@
Name: grafana-pcp
Version: 1.0.5
Version: 2.0.2
Release: 1%{?dist}
Summary: Performance Co-Pilot Grafana Plugin
@ -15,62 +15,63 @@ URL: %{github}
Source0: %{github}/archive/v%{version}/%{name}-%{version}.tar.gz
Source1: grafana-pcp-deps-%{version}.tar.xz
Source2: create_dependency_bundle.sh
Source3: list_bundled_nodejs_packages.py
BuildRequires: nodejs
Requires: grafana >= 6.2.2, grafana < 6.4.0
Requires: grafana >= 6.6.0
Suggests: pcp >= 5.0.0
Suggests: redis >= 5.0.0
Suggests: bpftrace >= 0.9.2
# Obsolete old webapps
Obsoletes: pcp-webjs
Obsoletes: pcp-webapp-blinkenlights
Obsoletes: pcp-webapp-grafana
Obsoletes: pcp-webapp-graphite
Obsoletes: pcp-webapp-vector
Obsoletes: pcp-webjs <= 4.3.4
Obsoletes: pcp-webapp-blinkenlights <= 4.3.4
Obsoletes: pcp-webapp-grafana <= 4.3.4
Obsoletes: pcp-webapp-graphite <= 4.3.4
Obsoletes: pcp-webapp-vector <= 4.3.4
# Bundled npm packages
Provides: bundled(nodejs-@babel/cli) = 7.5.5
Provides: bundled(nodejs-@babel/core) = 7.5.5
Provides: bundled(nodejs-@babel/preset-env) = 7.5.5
Provides: bundled(nodejs-@babel/preset-react) = 7.0.0
Provides: bundled(nodejs-@babel/preset-typescript) = 7.3.3
Provides: bundled(nodejs-@grafana/data) = 6.4.0
Provides: bundled(nodejs-@grafana/ui) = 6.4.0
Provides: bundled(nodejs-@babel/cli) = 7.8.4
Provides: bundled(nodejs-@babel/core) = 7.8.4
Provides: bundled(nodejs-@babel/preset-env) = 7.8.4
Provides: bundled(nodejs-@babel/preset-react) = 7.8.3
Provides: bundled(nodejs-@babel/preset-typescript) = 7.8.3
Provides: bundled(nodejs-@grafana/data) = 6.6.0
Provides: bundled(nodejs-@grafana/ui) = 6.6.0
Provides: bundled(nodejs-@types/benchmark) = 1.0.31
Provides: bundled(nodejs-@types/d3) = 5.7.2
Provides: bundled(nodejs-@types/grafana) = 4.6.3
Provides: bundled(nodejs-@types/jest) = 24.0.17
Provides: bundled(nodejs-@types/lodash) = 4.14.136
Provides: bundled(nodejs-babel-jest) = 24.8.0
Provides: bundled(nodejs-@types/jest) = 24.9.1
Provides: bundled(nodejs-@types/lodash) = 4.14.149
Provides: bundled(nodejs-babel-jest) = 24.9.0
Provides: bundled(nodejs-babel-loader) = 8.0.6
Provides: bundled(nodejs-babel-plugin-angularjs-annotate) = 0.10.0
Provides: bundled(nodejs-benchmark) = 2.1.4
Provides: bundled(nodejs-clean-webpack-plugin) = 0.1.19
Provides: bundled(nodejs-copy-webpack-plugin) = 5.1.1
Provides: bundled(nodejs-core-js) = 3.1.4
Provides: bundled(nodejs-core-js) = 1.2.7
Provides: bundled(nodejs-css-loader) = 1.0.1
Provides: bundled(nodejs-d3-flame-graph) = 2.1.8
Provides: bundled(nodejs-d3-flame-graph) = 2.1.9
Provides: bundled(nodejs-d3-selection) = 1.4.0
Provides: bundled(nodejs-expr-eval) = 1.2.3
Provides: bundled(nodejs-jest) = 24.8.0
Provides: bundled(nodejs-jest-date-mock) = 1.0.7
Provides: bundled(nodejs-jest) = 24.9.0
Provides: bundled(nodejs-jest-date-mock) = 1.0.8
Provides: bundled(nodejs-jsdom) = 9.12.0
Provides: bundled(nodejs-lodash) = 4.17.15
Provides: bundled(nodejs-memoize-one) = 5.1.1
Provides: bundled(nodejs-mocha) = 6.2.0
Provides: bundled(nodejs-memoize-one) = 4.1.0
Provides: bundled(nodejs-mocha) = 6.2.2
Provides: bundled(nodejs-prunk) = 1.3.1
Provides: bundled(nodejs-q) = 1.5.1
Provides: bundled(nodejs-regenerator-runtime) = 0.12.1
Provides: bundled(nodejs-regenerator-runtime) = 0.11.1
Provides: bundled(nodejs-request) = 2.88.0
Provides: bundled(nodejs-style-loader) = 0.22.1
Provides: bundled(nodejs-ts-jest) = 24.0.2
Provides: bundled(nodejs-ts-jest) = 24.3.0
Provides: bundled(nodejs-ts-loader) = 4.5.0
Provides: bundled(nodejs-tslint) = 5.18.0
Provides: bundled(nodejs-tslint-config-airbnb) = 5.11.1
Provides: bundled(nodejs-typescript) = 3.5.3
Provides: bundled(nodejs-webpack) = 4.39.1
Provides: bundled(nodejs-webpack-cli) = 3.3.6
Provides: bundled(nodejs-tslint) = 5.20.1
Provides: bundled(nodejs-tslint-config-airbnb) = 5.11.2
Provides: bundled(nodejs-typescript) = 3.7.5
Provides: bundled(nodejs-webpack) = 4.41.5
Provides: bundled(nodejs-webpack-cli) = 3.3.10
%description
@ -103,6 +104,16 @@ cp -a dist/* %{buildroot}/%{install_dir}
%doc README.md
%changelog
* Mon May 11 2020 Andreas Gerstmayr <agerstmayr@redhat.com> 2.0.2-1
- update to upstream version 2.0.2, see CHANGELOG
* Tue Jan 28 2020 Andreas Gerstmayr <agerstmayr@redhat.com> 1.0.5-3
- redis: pass correct timespec to pmproxy (fixes empty graphs for large time ranges)
* Tue Jan 07 2020 Andreas Gerstmayr <agerstmayr@redhat.com> 1.0.5-2
- redis: support wildcards in metric names
- redis: fix legend and label support
* Mon Dec 16 2019 Andreas Gerstmayr <agerstmayr@redhat.com> 1.0.5-1
- upgrade to upstream 1.0.5
- flame graphs: clean flame graph stacks every 5s (reduces CPU load)