mirror of
https://github.com/minio/minio.git
synced 2025-04-07 05:10:30 -04:00
Add osx deps check and development environment
This commit is contained in:
parent
6af37d5ca1
commit
574ee2a271
@ -22,6 +22,8 @@ _init() {
|
|||||||
GIT_VERSION="1.0"
|
GIT_VERSION="1.0"
|
||||||
PIP_VERSION="1.4"
|
PIP_VERSION="1.4"
|
||||||
GO_VERSION="1.4"
|
GO_VERSION="1.4"
|
||||||
|
OSX_VERSION="10.8"
|
||||||
|
UNAME=$(uname -sm)
|
||||||
|
|
||||||
## Check all dependencies are present
|
## Check all dependencies are present
|
||||||
MISSING=""
|
MISSING=""
|
||||||
@ -92,6 +94,38 @@ check_golang_env() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_supported_os() {
|
||||||
|
case ${UNAME%% *} in
|
||||||
|
"Linux")
|
||||||
|
os="linux"
|
||||||
|
;;
|
||||||
|
"Darwin")
|
||||||
|
osx_host_version=$(env sw_vers -productVersion)
|
||||||
|
check_version "${osx_host_version}" "${OSX_VERSION}"
|
||||||
|
[[ $? -ge 2 ]] && die "Minimum OSX version supported is ${OSX_VERSION}"
|
||||||
|
;;
|
||||||
|
"*")
|
||||||
|
echo "Exiting.. unsupported operating system found"
|
||||||
|
exit 1;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
is_supported_arch() {
|
||||||
|
local supported
|
||||||
|
case ${UNAME##* } in
|
||||||
|
"x86_64")
|
||||||
|
supported=1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
supported=0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
if [ $supported -eq 0 ]; then
|
||||||
|
echo "Invalid arch: ${UNAME} not supported, please use x86_64/amd64"
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
check_deps() {
|
check_deps() {
|
||||||
check_version "$(env pip --version 2>/dev/null| awk {'print $2'})" "${PIP_VERSION}"
|
check_version "$(env pip --version 2>/dev/null| awk {'print $2'})" "${PIP_VERSION}"
|
||||||
if [ $? -ge 2 ]; then
|
if [ $? -ge 2 ]; then
|
||||||
@ -125,6 +159,12 @@ check_deps() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
echo -n "Check for supported arch.. "
|
||||||
|
is_supported_arch
|
||||||
|
|
||||||
|
echo -n "Check for supported os.. "
|
||||||
|
is_supported_os
|
||||||
|
|
||||||
echo -n "Checking if proper environment variables are set.. "
|
echo -n "Checking if proper environment variables are set.. "
|
||||||
check_golang_env
|
check_golang_env
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ _init() {
|
|||||||
PIP_VERSION="1.4"
|
PIP_VERSION="1.4"
|
||||||
GCC_VERSION="4.0"
|
GCC_VERSION="4.0"
|
||||||
YASM_VERSION="1.2.0"
|
YASM_VERSION="1.2.0"
|
||||||
|
OSX_VERSION="10.8"
|
||||||
UNAME=$(uname -sm)
|
UNAME=$(uname -sm)
|
||||||
MINIO_DEV=$HOME/minio-dev
|
MINIO_DEV=$HOME/minio-dev
|
||||||
}
|
}
|
||||||
@ -30,7 +31,7 @@ pop_dir() {
|
|||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
###
|
####
|
||||||
#
|
#
|
||||||
# Takes two arguments
|
# Takes two arguments
|
||||||
# arg1: version number in `x.x.x` format
|
# arg1: version number in `x.x.x` format
|
||||||
@ -65,11 +66,9 @@ check_version () {
|
|||||||
ver2[i]=0
|
ver2[i]=0
|
||||||
fi
|
fi
|
||||||
if ((10#${ver1[i]} > 10#${ver2[i]})); then
|
if ((10#${ver1[i]} > 10#${ver2[i]})); then
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
if ((10#${ver1[i]} < 10#${ver2[i]})); then
|
if ((10#${ver1[i]} < 10#${ver2[i]})); then
|
||||||
## Installed version is lesser than required - Bad condition
|
|
||||||
return 2
|
return 2
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -82,9 +81,6 @@ is_supported_arch() {
|
|||||||
"x86_64")
|
"x86_64")
|
||||||
supported=1
|
supported=1
|
||||||
;;
|
;;
|
||||||
"i386")
|
|
||||||
supported=0
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
supported=0
|
supported=0
|
||||||
;;
|
;;
|
||||||
@ -100,15 +96,19 @@ install_go() {
|
|||||||
case ${UNAME%% *} in
|
case ${UNAME%% *} in
|
||||||
"Linux")
|
"Linux")
|
||||||
os="linux"
|
os="linux"
|
||||||
|
GOLANG_TARBALL_FNAME="go${GO_VERSION}.${os}-amd64.tar.gz"
|
||||||
;;
|
;;
|
||||||
esac
|
"Darwin")
|
||||||
case ${UNAME##* } in
|
os="darwin"
|
||||||
"x86_64")
|
osx_host_version=$(env sw_vers -productVersion)
|
||||||
arch="amd64"
|
check_version "${osx_host_version}" "${OSX_VERSION}"
|
||||||
;;
|
[[ $? -ge 2 ]] && die "Minimum OSX version supported is ${OSX_VERSION}"
|
||||||
|
GOLANG_TARBALL_FNAME="go${GO_VERSION}.${os}-amd64-osx${OSX_VERSION}.tar.gz"
|
||||||
|
;;
|
||||||
|
"*")
|
||||||
|
die "Exiting.. unsupported operating system found"
|
||||||
esac
|
esac
|
||||||
|
|
||||||
GOLANG_TARBALL_FNAME="go$GO_VERSION.$os-$arch.tar.gz"
|
|
||||||
GOLANG_TARBALL_URL="https://storage.googleapis.com/golang/$GOLANG_TARBALL_FNAME"
|
GOLANG_TARBALL_URL="https://storage.googleapis.com/golang/$GOLANG_TARBALL_FNAME"
|
||||||
|
|
||||||
status_code=$(curl -w '%{http_code}' --progress-bar -L -C - $GOLANG_TARBALL_URL -o $MINIO_DEV/dls/$GOLANG_TARBALL_FNAME)
|
status_code=$(curl -w '%{http_code}' --progress-bar -L -C - $GOLANG_TARBALL_URL -o $MINIO_DEV/dls/$GOLANG_TARBALL_FNAME)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user