Blame SOURCES/Makefile

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