2020-12-23 14:08:59 +00:00
|
|
|
all: grafana-pcp-$(VER).tar.gz \
|
|
|
|
grafana-pcp-vendor-$(VER).tar.xz \
|
|
|
|
grafana-pcp-webpack-$(VER).tar.gz
|
|
|
|
|
2021-06-25 16:04:09 +00:00
|
|
|
grafana-pcp-$(VER).tar.gz:
|
2020-12-23 14:08:59 +00:00
|
|
|
wget https://github.com/performancecopilot/grafana-pcp/archive/v$(VER)/grafana-pcp-$(VER).tar.gz
|
2021-06-25 16:04:09 +00:00
|
|
|
|
|
|
|
ALL_PATCHES := $(wildcard *.patch)
|
|
|
|
PATCHES_TO_APPLY := $(ALL_PATCHES)
|
|
|
|
|
|
|
|
grafana-pcp-vendor-$(VER).tar.xz: grafana-pcp-$(VER).tar.gz
|
2020-12-23 14:08:59 +00:00
|
|
|
rm -rf grafana-pcp-$(VER)
|
|
|
|
tar xfz grafana-pcp-$(VER).tar.gz
|
|
|
|
|
2021-06-25 16:04:09 +00:00
|
|
|
# patches can affect Go or Node.js dependencies, or the webpack
|
|
|
|
for patch in $(PATCHES_TO_APPLY); do patch -d grafana-pcp-$(VER) -p1 --fuzz=0 < $$patch; done
|
|
|
|
|
2020-12-23 14:08:59 +00:00
|
|
|
# Go
|
|
|
|
cd grafana-pcp-$(VER) && go mod vendor -v
|
|
|
|
awk '$$2~/^v/ && $$4 != "indirect" {print "Provides: bundled(golang(" $$1 ")) = " substr($$2, 2)}' grafana-pcp-$(VER)/go.mod | \
|
|
|
|
sed -E 's/=(.*)-(.*)-(.*)/=\1-\2.\3/g' > $@.manifest
|
|
|
|
|
|
|
|
# Node.js
|
|
|
|
cd grafana-pcp-$(VER) && yarn install --pure-lockfile
|
|
|
|
# Remove files with licensing issues
|
|
|
|
find grafana-pcp-$(VER) -type d -name 'node-notifier' -prune -exec rm -r {} \;
|
2021-06-25 16:04:09 +00:00
|
|
|
find grafana-pcp-$(VER) -type f -name '*.exe' -delete
|
2020-12-23 14:08:59 +00:00
|
|
|
# Remove not required packages
|
|
|
|
rm -r grafana-pcp-$(VER)/node_modules/puppeteer
|
|
|
|
./list_bundled_nodejs_packages.py grafana-pcp-$(VER)/ >> $@.manifest
|
|
|
|
|
|
|
|
# Jsonnet
|
|
|
|
cd grafana-pcp-$(VER) && jb --jsonnetpkg-home=vendor_jsonnet install
|
|
|
|
|
|
|
|
# Create tarball
|
|
|
|
XZ_OPT=-9 tar cfJ $@ \
|
|
|
|
grafana-pcp-$(VER)/vendor \
|
2021-06-25 16:04:09 +00:00
|
|
|
grafana-pcp-$(VER)/node_modules \
|
2020-12-23 14:08:59 +00:00
|
|
|
grafana-pcp-$(VER)/vendor_jsonnet
|
|
|
|
|
2021-06-25 16:04:09 +00:00
|
|
|
grafana-pcp-webpack-$(VER).tar.gz: grafana-pcp-$(VER).tar.gz
|
2020-12-23 14:08:59 +00:00
|
|
|
cd grafana-pcp-$(VER) && \
|
2021-06-25 16:04:09 +00:00
|
|
|
../build_frontend.sh
|
2020-12-23 14:08:59 +00:00
|
|
|
|
|
|
|
tar cfz $@ grafana-pcp-$(VER)/dist
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf *.tar.gz *.tar.xz *.manifest *.rpm grafana-pcp-*/
|