grafana/Makefile
Marius Kittler eb25b2767e Update to version 11.3.3
* CVE-2024-11741: Fix the Grafana Alerting VictorOps integration
    (bsc#1236734)
  * Chore: Bump dependency golang.org/x/crypto to v0.31.0
  * Drop 0004-Bump-crypto.patch
  * Require Go 1.23.5 or newer for building
- Add provisioning directories

OBS-URL: https://build.opensuse.org/package/show/server:monitoring/grafana?expand=0&rev=150
2025-02-03 15:41:53 +00:00

47 lines
1.4 KiB
Makefile

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:
rm -f $(NAME)-*.tar $(NAME)-*.tar.gz
tar:
osc service manualrun
@version=$$( awk '/^Version:/ {print $$2}' $(SPEC) ) && \
echo "Package version is $$version" && \
basename=$(NAME)-$$version && \
tar=$$basename.tar && \
tmpdir=$$(mktemp -d -p .) && \
cd $$tmpdir && \
gunzip ../$$tar.gz && \
tar -xf ../$$tar && \
# recreate tarball explicitly in a format that handles long filenames \
tar --format=posix -cf ../$$tar $$basename && \
cd $$basename && \
# Patches for the JS frontend go after here \
patch --no-backup-if-mismatch -p1 -i ../../0001-Add-source-code-reference.patch && \
# End patches section \
# Patches for Go modules go after here \
# End of Go modules patches section \
go mod download && \
go mod verify && \
go work vendor && \
tar --format=posix -cf ../../vendor.tar vendor && \
# avoid ".git can't be found" \
git init && \
# avoid "FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory" \
export NODE_OPTIONS=--max_old_space_size=8192 && \
yarn install --immutable && \
yarn run build && \
cd .. && \
echo "Updating $$basename/public in tarball..." && \
tar -rf ../$$tar $$basename/public && \
cd .. && \
gzip $$tar && \
gzip -f vendor.tar && \
rm -rf $$tmpdir