2019-12-05 16:43:17 +01:00
|
|
|
NAME = grafana
|
|
|
|
SPEC = $(NAME).spec
|
|
|
|
|
|
|
|
default: verify-deps clean tar
|
|
|
|
|
|
|
|
verify-deps:
|
|
|
|
@which yarn >/dev/null 2>&1 || ( echo "yarn not found; run \`sudo npm install -g yarn\`" && false )
|
|
|
|
|
|
|
|
clean:
|
2020-03-19 09:58:44 +01:00
|
|
|
rm -f $(NAME)-*.tar $(NAME)-*.tar.gz
|
2019-12-05 16:43:17 +01:00
|
|
|
|
|
|
|
tar:
|
|
|
|
osc service disabledrun
|
|
|
|
@version=$$( awk '/^Version:/ {print $$2}' $(SPEC) ) && \
|
|
|
|
echo "Package version is $$version" && \
|
|
|
|
basename=$(NAME)-$$version && \
|
|
|
|
tar=$$basename.tar && \
|
|
|
|
tmpdir=$$(mktemp -d -p .) && \
|
|
|
|
cd $$tmpdir && \
|
2020-03-19 09:58:44 +01:00
|
|
|
gunzip ../$$tar.gz && \
|
2019-12-05 16:43:17 +01:00
|
|
|
tar -xf ../$$tar && \
|
2021-02-26 15:07:38 +01:00
|
|
|
# recreate tarball explicitly in a format that handles long filenames \
|
|
|
|
tar --format=posix -cf ../$$tar $$basename && \
|
2019-12-05 16:43:17 +01:00
|
|
|
cd $$basename && \
|
2020-06-04 01:19:01 +02:00
|
|
|
# Patches for the JS frontend go after here \
|
2021-10-22 16:27:20 +02:00
|
|
|
patch -p1 -i ../../0001-Add-source-code-reference.patch && \
|
2020-06-04 01:19:01 +02:00
|
|
|
# End patches section \
|
2022-02-07 12:39:23 +01:00
|
|
|
yarn install --immutable && \
|
2021-02-26 15:07:38 +01:00
|
|
|
yarn run build && \
|
2019-12-05 16:43:17 +01:00
|
|
|
cd .. && \
|
2021-02-26 15:07:38 +01:00
|
|
|
echo "Updating $$basename/public in tarball..." && \
|
|
|
|
tar -rf ../$$tar $$basename/public && \
|
2019-12-05 16:43:17 +01:00
|
|
|
cd .. && \
|
2020-03-19 09:58:44 +01:00
|
|
|
gzip $$tar && \
|
2019-12-05 16:43:17 +01:00
|
|
|
rm -rf $$tmpdir
|