grafana/Makefile
Witek Bedyk 19ad1a3209 Accepting request 786027 from home:ojkastl_buildservice:Branch_grafana
update to 6.6.2; use go_modules service to provide dependencies in vendor.tar.gz; BuildRequires go1.14 to build successfully; adjust Makefile and README to current requirements for 6.6.2 (npm12, not npm10);adjust Makefile to fully work with new file names

OBS-URL: https://build.opensuse.org/request/show/786027
OBS-URL: https://build.opensuse.org/package/show/server:monitoring/grafana?expand=0&rev=30
2020-03-19 08:58:44 +00:00

39 lines
1.2 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 )
@which grunt >/dev/null 2>&1 || ( echo "grunt not found; run \`sudo npm install -g grunt-cli\`" && false )
clean:
rm -f $(NAME)-*.tar $(NAME)-*.tar.gz
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 && \
gunzip ../$$tar.gz && \
tar -xf ../$$tar && \
cd $$basename && \
# exclude the phantomjs-prebuilt binary module from the webpack \
sed -i '/phantomjs-prebuilt/d' package.json && \
# nuke grunt task for copying phantomjs \
rm -f scripts/grunt/options/phantomjs.js && \
sed -i '/phantomjs/d' scripts/grunt/*.js && \
yarn install --pure-lockfile && \
grunt release && \
cp -pr tmp/public . && \
cp -pr tmp/tools . && \
cd .. && \
echo "Updating $$basename/tools $$basename/public in tarball..." && \
tar -rf ../$$tar $$basename/tools $$basename/public && \
cd .. && \
gzip $$tar && \
rm -rf $$tmpdir