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
404e11
grafana-pcp-$(VER).tar.gz grafana-pcp-$(VER)/:
404e11
	wget https://github.com/performancecopilot/grafana-pcp/archive/v$(VER)/grafana-pcp-$(VER).tar.gz
404e11
	rm -rf grafana-pcp-$(VER)
404e11
	tar xfz grafana-pcp-$(VER).tar.gz
404e11
	cd grafana-pcp-$(VER) && shopt -s nullglob && \
404e11
		for patch in ../*.patch; do patch -p1 < $$patch; done
404e11
404e11
grafana-pcp-vendor-$(VER).tar.xz: grafana-pcp-$(VER)/
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 {} \;
404e11
	find grafana-pcp-$(VER) -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 \
404e11
		$$(find grafana-pcp-$(VER) -type d -name "node_modules" -prune) \
404e11
		grafana-pcp-$(VER)/vendor_jsonnet
404e11
404e11
grafana-pcp-webpack-$(VER).tar.gz: grafana-pcp-$(VER)/
404e11
	cd grafana-pcp-$(VER) && \
404e11
		yarn install --pure-lockfile && \
404e11
		make dist-dashboards dist-frontend && \
404e11
		chmod -R g-w,o-w dist
404e11
404e11
	tar cfz $@ grafana-pcp-$(VER)/dist
404e11
404e11
clean:
404e11
	rm -rf *.tar.gz *.tar.xz *.manifest *.rpm grafana-pcp-*/