|
|
@ -21,6 +21,7 @@ msg() { |
|
|
|
|
|
|
|
|
|
|
|
call() { |
|
|
|
call() { |
|
|
|
$@ 2>&1 | sed 's/^\(.*\)$/ | \1/g' |
|
|
|
$@ 2>&1 | sed 's/^\(.*\)$/ | \1/g' |
|
|
|
|
|
|
|
return ${PIPESTATUS[0]} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
push_dir() { |
|
|
|
push_dir() { |
|
|
@ -139,6 +140,8 @@ setup_env() { |
|
|
|
cat <<EOF > env.sh |
|
|
|
cat <<EOF > env.sh |
|
|
|
#!/bin/sh |
|
|
|
#!/bin/sh |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MINIO_DEV=\$(dirname \$(readlink -f \${BASH_SOURCE[0]})) |
|
|
|
|
|
|
|
|
|
|
|
[[ -z \$GOROOT ]] && export GOROOT=\$MINIO_DEV/deps/go |
|
|
|
[[ -z \$GOROOT ]] && export GOROOT=\$MINIO_DEV/deps/go |
|
|
|
export GOPATH=\$MINIO_DEV/mygo |
|
|
|
export GOPATH=\$MINIO_DEV/mygo |
|
|
|
export PATH=\$MINIO_DEV/deps/go/bin:\$MINIO_DEV/mygo/bin:\$MINIO_DEV/deps/yasm-\$YASM_VERSION:\$MINIO_DEV/deps/mkdocs/bin:\$GOPATH/bin:\$PATH |
|
|
|
export PATH=\$MINIO_DEV/deps/go/bin:\$MINIO_DEV/mygo/bin:\$MINIO_DEV/deps/yasm-\$YASM_VERSION:\$MINIO_DEV/deps/mkdocs/bin:\$GOPATH/bin:\$PATH |
|
|
@ -150,18 +153,24 @@ install_mkdocs() { |
|
|
|
msg "Downloading mkdocs.." |
|
|
|
msg "Downloading mkdocs.." |
|
|
|
mkdir -p $MINIO_DEV/deps/mkdocs |
|
|
|
mkdir -p $MINIO_DEV/deps/mkdocs |
|
|
|
call pip install --install-option="--prefix=$MINIO_DEV/deps/mkdocs" mkdocs |
|
|
|
call pip install --install-option="--prefix=$MINIO_DEV/deps/mkdocs" mkdocs |
|
|
|
|
|
|
|
[[ $? -ne 0 ]] && die "Cannot install mkdocs. Abort installation." |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
install_minio_deps() { |
|
|
|
install_minio_deps() { |
|
|
|
msg "Installing minio deps.." |
|
|
|
msg "Installing minio deps.." |
|
|
|
env go get github.com/tools/godep && echo "Installed godep" |
|
|
|
env go get github.com/tools/godep && echo "Installed godep" || \ |
|
|
|
env go get golang.org/x/tools/cmd/cover && echo "Installed cover" |
|
|
|
die "Cannot install godep. Abort installation." |
|
|
|
|
|
|
|
env go get golang.org/x/tools/cmd/cover && echo "Installed cover" || \ |
|
|
|
|
|
|
|
die "Cannot install cover. Abort installation." |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
install_minio() { |
|
|
|
install_minio() { |
|
|
|
msg "Installing minio.." |
|
|
|
msg "Installing minio.." |
|
|
|
push_dir ${MINIO_DEV}/src |
|
|
|
push_dir ${MINIO_DEV}/src |
|
|
|
call git clone "https://github.com/minio-io/minio" |
|
|
|
if [ ! -d minio ] ; then |
|
|
|
|
|
|
|
call git clone "https://github.com/minio-io/minio" || \ |
|
|
|
|
|
|
|
die "Cannot download minio. Abort installation." |
|
|
|
|
|
|
|
fi |
|
|
|
(cd minio; call make) |
|
|
|
(cd minio; call make) |
|
|
|
pop_dir |
|
|
|
pop_dir |
|
|
|
} |
|
|
|
} |
|
|
@ -194,10 +203,10 @@ main() { |
|
|
|
|| install_go |
|
|
|
|| install_go |
|
|
|
|
|
|
|
|
|
|
|
check_version "$(env yasm --version 2>/dev/null | sed 's/^.* \([0-9.]*\).*$/\1/' | head -1)" ${YASM_VERSION} |
|
|
|
check_version "$(env yasm --version 2>/dev/null | sed 's/^.* \([0-9.]*\).*$/\1/' | head -1)" ${YASM_VERSION} |
|
|
|
[[ $? -ge 2 ]] || install_yasm |
|
|
|
[[ $? -ge 2 ]] && install_yasm |
|
|
|
|
|
|
|
|
|
|
|
env mkdocs help >/dev/null 2>&1 |
|
|
|
env mkdocs help >/dev/null 2>&1 |
|
|
|
[[ $? -ne 0 ]] || install_mkdocs |
|
|
|
[[ $? -ne 0 ]] && install_mkdocs |
|
|
|
|
|
|
|
|
|
|
|
setup_env |
|
|
|
setup_env |
|
|
|
source env.sh |
|
|
|
source env.sh |
|
|
|