Blame SOURCES/Makefile

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