2020-11-25 17:55:36 +00:00
|
|
|
all: grafana-$(VER).tar.gz \
|
|
|
|
grafana-vendor-$(VER).tar.xz \
|
|
|
|
grafana-webpack-$(VER).tar.gz
|
2020-07-30 15:52:28 +00:00
|
|
|
|
2021-05-20 14:57:43 +00:00
|
|
|
grafana-$(VER).tar.gz:
|
2020-07-30 15:52:28 +00:00
|
|
|
wget https://github.com/grafana/grafana/archive/v$(VER)/grafana-$(VER).tar.gz
|
2021-05-20 14:57:43 +00:00
|
|
|
|
|
|
|
grafana-vendor-$(VER).tar.xz: grafana-$(VER).tar.gz
|
2020-11-04 16:44:15 +00:00
|
|
|
rm -rf grafana-$(VER)
|
2020-07-30 15:52:28 +00:00
|
|
|
tar xfz grafana-$(VER).tar.gz
|
2021-05-20 14:57:43 +00:00
|
|
|
|
|
|
|
# patches can affect Go or Node.js dependencies
|
2020-11-25 17:55:36 +00:00
|
|
|
cd grafana-$(VER) && shopt -s nullglob && \
|
|
|
|
for patch in ../*.patch; do patch -p1 < $$patch; done
|
2020-07-30 15:52:28 +00:00
|
|
|
|
2020-11-25 17:55:36 +00:00
|
|
|
# Go
|
2020-07-30 15:52:28 +00:00
|
|
|
cd grafana-$(VER) && go mod vendor -v
|
|
|
|
awk '$$2~/^v/ && $$4 != "indirect" {print "Provides: bundled(golang(" $$1 ")) = " substr($$2, 2)}' grafana-$(VER)/go.mod | \
|
2020-11-25 17:55:36 +00:00
|
|
|
sed -E 's/=(.*)-(.*)-(.*)/=\1-\2.\3/g' > $@.manifest
|
2020-11-04 16:44:15 +00:00
|
|
|
|
2020-11-25 17:55:36 +00:00
|
|
|
# Node.js
|
2020-11-04 16:44:15 +00:00
|
|
|
cd grafana-$(VER) && yarn install --pure-lockfile
|
|
|
|
# Remove files with licensing issues
|
|
|
|
find grafana-$(VER) -type d -name 'node-notifier' -prune -exec rm -r {} \;
|
|
|
|
find grafana-$(VER) -name '*.exe' -delete
|
2020-11-25 17:55:36 +00:00
|
|
|
./list_bundled_nodejs_packages.py grafana-$(VER)/ >> $@.manifest
|
2020-07-30 15:52:28 +00:00
|
|
|
|
2020-11-25 17:55:36 +00:00
|
|
|
# Create tarball
|
|
|
|
XZ_OPT=-9 tar cfJ $@ \
|
|
|
|
grafana-$(VER)/vendor \
|
|
|
|
$$(find grafana-$(VER) -type d -name "node_modules" -prune)
|
2020-11-04 16:44:15 +00:00
|
|
|
|
2021-05-20 14:57:43 +00:00
|
|
|
grafana-webpack-$(VER).tar.gz: grafana-vendor-$(VER).tar.xz
|
2020-07-30 15:52:28 +00:00
|
|
|
cd grafana-$(VER) && \
|
2020-11-25 17:55:36 +00:00
|
|
|
../build_frontend.sh
|
2020-07-30 15:52:28 +00:00
|
|
|
|
2020-11-04 16:44:15 +00:00
|
|
|
tar cfz $@ grafana-$(VER)/public/build grafana-$(VER)/public/views grafana-$(VER)/plugins-bundled
|
2020-07-30 15:52:28 +00:00
|
|
|
|
|
|
|
clean:
|
2020-11-25 17:55:36 +00:00
|
|
|
rm -rf *.tar.gz *.tar.xz *.manifest *.rpm grafana-*/
|