aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap.sh
diff options
context:
space:
mode:
authoryves <steve.harrison@gmx.net>2011-01-19 16:07:42 +0100
committeryves <steve.harrison@gmx.net>2011-01-19 16:07:42 +0100
commitde138849df98ebc6260c6bab665707cc817248e9 (patch)
tree1b2b7f72cf8cea351b7fc7a6e11422662029b08f /bootstrap.sh
parent7da9576c8b801e7a1b0d854d576069181f76e34f (diff)
downloadosm-xapi-de138849df98ebc6260c6bab665707cc817248e9.tar.gz
osm-xapi-de138849df98ebc6260c6bab665707cc817248e9.tar.xz
osm-xapi-de138849df98ebc6260c6bab665707cc817248e9.zip
updated bootstrap.sh
Diffstat (limited to 'bootstrap.sh')
-rwxr-xr-xbootstrap.sh48
1 files changed, 31 insertions, 17 deletions
diff --git a/bootstrap.sh b/bootstrap.sh
index 02d71df..73fcf3b 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -1,32 +1,46 @@
#! /bin/sh
+###########################
+# start config
+
+PREFIX=`pwd`/usr/
NODE_VERSION=0.3.5
+# end config
+###########################
+
+export PATH=${PREFIX}/bin:${PATH}
+
## Download Helper
-# $1 - url
-# $2 - tarball name
+# $1 - url
+# $2 - destdir
download() {
- echo $1
- mkdir -p usr/src
+ mkdir -p ${PREFIX}/src
if [ ! -f ${2} ]; then
- curl ${1} > ${2}
+ echo "!! saving source to $1"
+ curl ${1} | tar -x -z -C ${PREFIX}/src
fi
-
- tar -xf ${2} -C usr/src
}
-# fetch and compile nodejs
-download http://nodejs.org/dist/node-v${NODE_VERSION}.tar.gz node-${NODE_VERSION}.tar.gz
-rm -f node-${NODE_VERSION}.tar.gz
+if [ ! -f ${PREFIX}/bin/node ]; then
+ # fetch and compile nodejs
+ download http://nodejs.org/dist/node-v${NODE_VERSION}.tar.gz ${PREFIX}/src/node-v${NODE_VERSION}
+
+ cd ${PREFIX}/src/node-v${NODE_VERSION}
+ ./configure --prefix=${PREFIX}
+ make install
+else
+ echo "!! node already installed"
+fi
-cd usr/src/node-v${NODE_VERSION}
-./configure --prefix=../..
-make install
-cd ../../..
+if [ ! -f ${PREFIX}/bin/npm ];then
+ # fetch and compile npm
+ curl http://npmjs.org/install.sh | sh
+else
+ echo "!! npm already installed"
-# fetch and compile npm
-curl http://npmjs.org/install.sh | PATH=`pwd`/usr/bin:${PATH} sh
+fi
# load development code and compile dependencies
-usr/bin/npm link src/nodejs/
+npm link src/nodejs/