Blame SOURCES/Makefile

bae306
all: grafana-$(VER).tar.gz \
bae306
	 grafana-vendor-$(VER).tar.xz \
bae306
	 grafana-webpack-$(VER).tar.gz
bae306
bae306
grafana-$(VER).tar.gz grafana-$(VER)/:
bae306
	wget https://github.com/grafana/grafana/archive/v$(VER)/grafana-$(VER).tar.gz
bae306
	rm -rf grafana-$(VER)
bae306
	tar xfz grafana-$(VER).tar.gz
bae306
	cd grafana-$(VER) && shopt -s nullglob && \
bae306
		for patch in ../*.patch; do patch -p1 < $$patch; done
bae306
bae306
grafana-vendor-$(VER).tar.xz: grafana-$(VER)/
bae306
	# Go
bae306
	cd grafana-$(VER) && go mod vendor -v
bae306
	awk '$$2~/^v/ && $$4 != "indirect" {print "Provides: bundled(golang(" $$1 ")) = " substr($$2, 2)}' grafana-$(VER)/go.mod | \
bae306
		sed -E 's/=(.*)-(.*)-(.*)/=\1-\2.\3/g' > $@.manifest
bae306
bae306
	# Node.js
bae306
	cd grafana-$(VER) && yarn install --pure-lockfile
bae306
	# Remove files with licensing issues
bae306
	find grafana-$(VER) -type d -name 'node-notifier' -prune -exec rm -r {} \;
bae306
	find grafana-$(VER) -name '*.exe' -delete
bae306
	./list_bundled_nodejs_packages.py grafana-$(VER)/ >> $@.manifest
bae306
bae306
	# Create tarball
bae306
	XZ_OPT=-9 tar cfJ $@ \
bae306
		grafana-$(VER)/vendor \
bae306
		$$(find grafana-$(VER) -type d -name "node_modules" -prune)
bae306
bae306
grafana-webpack-$(VER).tar.gz: grafana-$(VER)/
bae306
	cd grafana-$(VER) && \
bae306
		yarn install --pure-lockfile && \
bae306
		../build_frontend.sh
bae306
bae306
	tar cfz $@ grafana-$(VER)/public/build grafana-$(VER)/public/views grafana-$(VER)/plugins-bundled
bae306
bae306
clean:
bae306
	rm -rf *.tar.gz *.tar.xz *.manifest *.rpm grafana-*/