build: allow to build on FreeBSD (#22285)

* fix(build): checksum failed on FreeBSD

* fix(build): avoid BSD make evaluate Makefile

This Makefile use GNU make functions which is not compatible with the BSD
make. In order to avoid BSD make to try evaluation the Makefile and because
the Makefile use GNU make functions renaming the from Makefile to GNUmakefile
does not change anything for GNU make users and expose a clear error
when someone try to evaluate with BSD make.

* fix(build): invalid shebang on FreeBSD
pull/22928/head
Bryan FRIMIN 2021-11-24 14:42:36 +01:00 committed by GitHub
parent edb21abe91
commit 5a1e3752c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 3 deletions

View File

@ -27,8 +27,17 @@ curl -Ls https://github.com/influxdata/ui/releases/download/OSS-Master/sha256.tx
curl -L https://github.com/influxdata/ui/releases/download/OSS-Master/build.tar.gz --output build.tar.gz
# Verify the checksums match; exit if they don't.
echo "$(cat sha256.txt)" | sha256sum --check -- \
|| { echo "Checksums did not match for downloaded UI assets!"; exit 1; }
case "$(uname -s)" in
FreeBSD | Darwin)
echo "$(cat sha256.txt)" | shasum --algorithm 256 --check \
|| { echo "Checksums did not match for downloaded UI assets!"; exit 1; } ;;
Linux)
echo "$(cat sha256.txt)" | sha256sum --check -- \
|| { echo "Checksums did not match for downloaded UI assets!"; exit 1; } ;;
*)
echo "The '$(uname -s)' operating system is not supported" >&2
exit 1
esac
# Extract the assets and clean up.
mkdir -p "$STATIC_DIR/data"

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
tmpdir=$(mktemp -d)
trap "{ rm -rf ${tmpdir}; }" EXIT