Skip to content

Commit 69c4e44

Browse files
author
Brennon York
committed
working linux and osx installers for purely local mvn build
1 parent 4a1609c commit 69c4e44

File tree

5 files changed

+54
-34
lines changed

5 files changed

+54
-34
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ out/
1818
.DS_Store
1919
third_party/libmesos.so
2020
third_party/libmesos.dylib
21+
build/apache-maven*
22+
build/zinc*
2123
conf/java-opts
2224
conf/*.sh
2325
conf/*.cmd

build/mvn

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ prep_install_for_bsd() {
3333
# Current checks are as follows:
3434
# - NA
3535
prep_install_for_linux() {
36-
echo
36+
echo -n ""
3737
}
3838

3939
# Called before any binaries are installed for the OS X operating system.
@@ -143,14 +143,13 @@ ZINC_PORT=${ZINC_PORT:-"3030"}
143143
# Check and install all applications necessary to fully build Spark
144144
check_and_install_app "mvn"
145145
check_and_install_app "zinc"
146-
check_and_install_app "scala"
147146

148147
# Reset the current working directory
149148
cd "${_DIR}/.."
150149

151150
# Now that zinc is ensured to be installed, check its status and, if its
152151
# not running, start it
153-
if [ -z "`zinc -status`" ]; then
152+
if [ -z "`${ZINC_BIN} -status`" ]; then
154153
${ZINC_BIN} -start -port ${ZINC_PORT}
155154
fi
156155

build/packages/mvn.sh

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
#!/usr/bin/env bash
22

3-
# Determine the current working directory
4-
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5-
6-
MVN_URL="http://apache.claz.org/maven/maven-3/3.2.3/binaries/apache-maven-3.2.3-bin.tar.gz"
7-
MVN_LOC="${DIR}/../apache-maven-3.2.3-bin.tar.gz"
8-
93
install_mvn_for_linux() {
10-
local mvn_bin="${DIR}/../apache-maven-3.2.3/bin/mvn"
4+
# Determine the current working directory
5+
local dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6+
local mvn_url="http://apache.claz.org/maven/maven-3/3.2.3/binaries/apache-maven-3.2.3-bin.tar.gz"
7+
local mvn_loc="${dir}/../apache-maven-3.2.3-bin.tar.gz"
8+
local mvn_bin="${dir}/../apache-maven-3.2.3/bin/mvn"
119

1210
if [ ! -f "${mvn_bin}" ]; then
13-
# first check if we have curl installed and, if so, download Leiningen
14-
[ -n "`which curl 2>/dev/null`" ] && curl "${MVN_URL}" > "${MVN_LOC}"
15-
# if the `lein` file still doesn't exist, lets try `wget` and cross our fingers
16-
[ ! -f "${MVN_LOC}" ] && [ -n "`which wget 2>/dev/null`" ] && wget -O "${MVN_LOC}" "${MVN_URL}"
11+
# check if we already have the tarball; check if we have curl installed; download `mvn`
12+
[ ! -f "${mvn_loc}" ] && [ -n "`which curl 2>/dev/null`" ] && curl "${mvn_url}" > "${mvn_loc}"
13+
# if the `mvn` file still doesn't exist, lets try `wget` and cross our fingers
14+
[ ! -f "${mvn_loc}" ] && [ -n "`which wget 2>/dev/null`" ] && wget -O "${mvn_loc}" "${mvn_url}"
1715
# if both weren't successful, exit
18-
[ ! -f "${MVN_LOC}" ] && \
16+
[ ! -f "${mvn_loc}" ] && \
1917
echo "ERROR: Cannot find or download a version of Maven, please install manually and try again." && \
2018
exit 2
21-
cd "${DIR}/.." && tar -xzf "${MVN_LOC}"
19+
cd "${dir}/.." && tar -xzf "${mvn_loc}"
20+
rm -rf "${mvn_loc}"
2221
fi
2322
export MVN_BIN="${mvn_bin}"
2423
}
@@ -27,4 +26,3 @@ install_mvn_for_osx() {
2726
brew install maven
2827
export MVN_BIN=`which mvn`
2928
}
30-

build/packages/scala.sh

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
#!/usr/bin/env bash
22

3-
# Determine the current working directory
4-
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5-
6-
SCALA_URL="http://downloads.typesafe.com/scala/2.11.4/scala-2.11.4.tgz"
7-
SCALA_LOC="${DIR}/../scala/scala-2.11.4.tgz"
8-
93
install_scala_for_linux() {
10-
# first check if we have curl installed and, if so, download Leiningen
11-
[ -n "`which curl 2>/dev/null`" ] && curl "${SCALA_URL}" > "${SCALA_LOC}"
12-
# if the `lein` file still doesn't exist, lets try `wget` and cross our fingers
13-
[ ! -f "${SCALA_LOC}" ] && [ -n "`which wget 2>/dev/null`" ] && wget -O "${SCALA_LOC}" "${SCALA_URL}"
14-
# if both weren't successful, exit
15-
[ ! -f "${SCALA_LOC}" ] && \
16-
echo "ERROR: Cannot find or download a version of Scala, please install manually and try again." && \
17-
exit 2
4+
# Determine the current working directory
5+
local dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6+
local scala_url="http://downloads.typesafe.com/scala/2.11.4/scala-2.11.4.tgz"
7+
local scala_loc="${dir}/../scala-2.11.4.tgz"
8+
local scala_bin="${dir}/../scala-2.11.4/bin/scala"
9+
10+
if [ ! -f "${scala_bin}" ]; then
11+
# check if we already have the tarball; check if we have curl installed; download `scala`
12+
[ ! -f "${scala_loc}" ] && [ -n "`which curl 2>/dev/null`" ] && curl "${scala_url}" > "${scala_loc}"
13+
# if the `scala` file still doesn't exist, lets try `wget` and cross our fingers
14+
[ ! -f "${scala_loc}" ] && [ -n "`which wget 2>/dev/null`" ] && wget -O "${scala_loc}" "${scala_url}"
15+
# if both weren't successful, exit
16+
[ ! -f "${scala_loc}" ] && \
17+
echo "ERROR: Cannot find or download a version of Maven, please install manually and try again." && \
18+
exit 2
19+
cd "${dir}/.." && tar -xzf "${scala_loc}"
20+
rm -rf "${scala_loc}"
21+
fi
22+
export SCALA_BIN="${scala_bin}"
1823
}
1924

2025
install_scala_for_osx() {

build/packages/zinc.sh

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
#!/usr/bin/env bash
22

3-
ZINC_URL="http://downloads.typesafe.com/zinc/0.3.5.3/zinc-0.3.5.3.tgz"
4-
53
install_zinc_for_linux() {
6-
echo
4+
# Determine the current working directory
5+
local dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6+
local zinc_url="http://downloads.typesafe.com/zinc/0.3.5.3/zinc-0.3.5.3.tgz"
7+
local zinc_loc="${dir}/../zinc-0.3.5.3.tgz"
8+
local zinc_bin="${dir}/../zinc-0.3.5.3/bin/zinc"
9+
10+
if [ ! -f "${zinc_bin}" ]; then
11+
# check if we already have the tarball; check if we have curl installed; download `zinc`
12+
[ ! -f "${zinc_loc}" ] && [ -n "`which curl 2>/dev/null`" ] && curl "${zinc_url}" > "${zinc_loc}"
13+
# if the `zinc` file still doesn't exist, lets try `wget` and cross our fingers
14+
[ ! -f "${zinc_loc}" ] && [ -n "`which wget 2>/dev/null`" ] && wget -O "${zinc_loc}" "${zinc_url}"
15+
# if both weren't successful, exit
16+
[ ! -f "${zinc_loc}" ] && \
17+
echo "ERROR: Cannot find or download a version of Maven, please install manually and try again." && \
18+
exit 2
19+
cd "${dir}/.." && tar -xzf "${zinc_loc}"
20+
rm -rf "${zinc_loc}"
21+
fi
22+
export ZINC_BIN="${zinc_bin}"
723
}
824

925
install_zinc_for_osx() {

0 commit comments

Comments
 (0)