aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap.sh')
-rwxr-xr-xbootstrap.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/bootstrap.sh b/bootstrap.sh
new file mode 100755
index 0000000..593e3d8
--- /dev/null
+++ b/bootstrap.sh
@@ -0,0 +1,29 @@
+#! /bin/sh
+
+NODE_VERSION=0.3.5
+
+## Download Helper
+# $1 - url
+# $2 - tarball name
+download() {
+ echo $1
+ mkdir -p usr/src
+
+ if [ ! -f ${2} ]; then
+ curl ${1} > ${2}
+ 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
+
+cd usr/src/node-v${NODE_VERSION}
+./configure --prefix=../..
+make install
+cd ../../..
+
+# fetch and compile npm
+curl http://npmjs.org/install.sh | PATH=`pwd`/usr/bin:${PATH} sh