1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-api-healthcheck synced 2026-06-19 05:10:02 +02:00

compile.sh: move package stuff to package.sh

This commit is contained in:
Henrik Hautakoski 2021-12-02 12:54:42 +01:00
parent f782177bec
commit 9cf1c84ae2
2 changed files with 19 additions and 9 deletions

View file

@ -5,7 +5,7 @@ SYSTEMS=( windows linux freebsd )
ARCHS=( 386 amd64 amd64p32 arm arm64 ppc ppc64 )
function usage() {
echo "Usage: ${0##*/} [ -h|--help ] [ --target <system> ] [ -a|--arch <arch> ] [ -p|--package ]"
echo "Usage: ${0##*/} [ -h|--help ] [ --target <system> ] [ -a|--arch <arch> ]"
echo ""
echo " Valid systems:"
for i in "${SYSTEMS[@]}"; do
@ -20,7 +20,7 @@ function usage() {
exit 1
}
options=$(getopt -n "${0##*/}" -o "ht:a:p" -l "help,target:,arch:,package" -- "$@")
options=$(getopt -n "${0##*/}" -o "ht:a:p" -l "help,target:,arch:" -- "$@")
[ $? -eq 0 ] || usage
@ -31,9 +31,6 @@ MAKE_TARGET="all"
while true; do
case $1 in
-p|--package)
MAKE_TARGET="package_deb"
;;
-t|--target)
shift
REGEX=$(echo "${SYSTEMS[@]}" | sed 's/[[:space:]]/|/g')
@ -62,10 +59,6 @@ done
MESSAGE=""
if [ ! -z "${GOOS}" ]; then
# Hack to select the right package :)
if [ "${MAKE_TARGET}" == "package_deb" ] && [ "${GOOS}" == "freebsd" ]; then
MAKE_TARGET="package_freebsd"
fi
MESSAGE="[\e[34m::\e[0m] Crosscompiling for: ${GOOS}"
fi

17
package.sh Executable file
View file

@ -0,0 +1,17 @@
#!/bin/bash
BINARY=build/eosio-api-healthcheck
if [ ! -f "${BINARY}" ]; then
echo "Could not find '${BINARY}', You need to compile first."
exit 1
fi
# Bit of a hack to figure out if we need to package for FreeBSD or not.
if [ -n "$(file $BINARY | grep 'FreeBSD')" ]; then
MAKE_TARGET="package_freebsd"
else
MAKE_TARGET="package_deb"
fi
make -B ${MAKE_TARGET}