User Tools

Site Tools


Sidebar

Launch of Linino.org

wiki:nodejshost

How to build the Node.Js source tarball on your Debian-based Linux host system

This one is a simple bash script to donwload and install the Node.Js tarball on your Linux build machine :

#!/bin/bash
 
cd ~/Downloads
 
echo " "
echo "Cleaning..... "
echo " "
 
sudo dpkg -P nodejs 2> /dev/null
sudo rm -rf node-v"$1" 2> /dev/null
 
if [ -e node-v"$1".tar.gz ] || [ -d node-v"$1"/ ]
then
	rm node-v"$1".tar.gz
	rm -rf node-v"$1"/
fi
 
sleep 5
 
####################################################################################
 
echo " "
echo "Installing prerequisites..... "
echo " "
 
sleep 5
 
sudo apt-get -y install systemtap-sdt-dev bash-completion binutils cdbs curl \
	debhelper devscripts dh-buildinfo libc-ares-dev libssl-dev \
	openssl pkg-config procps python zlib1g-dev checkinstall
 
sudo apt-get remove gyp libv8-3.14.5 libv8-3.14-dev
 
####################################################################################
 
echo " "
echo "Downloading nodejs v."$1"..... "
echo " "
 
sleep 5
 
wget http://nodejs.org/dist/v"$1"/node-v"$1".tar.gz
 
####################################################################################
 
echo " "
echo "Extracting files..... "
echo " "
 
sleep 5
 
tar xvf node-v"$1".tar.gz
 
cd node-v"$1"/
 
####################################################################################
 
echo " "
echo "Configuring..... "
echo " "
 
sleep 5
 
./configure --dest-os=linux
 
####################################################################################
 
echo " "
echo "Building..... "
echo " "
 
sleep 5
 
make -j3 && \
 
mkdir -vp doc-pak && \
 
cp -v AUTHORS LICENSE doc-pak && \
 
####################################################################################
 
echo " "
echo "Installing..... "
echo " "
 
sleep 5
 
sudo checkinstall -y --pakdir="~/Downloads" --backup=no --deldoc=yes --pkgname="nodejs" \
                  --pkgversion=""$1"" --pkgrelease="$(lsb_release -cs)" --fstrans=no \
                  --deldesc=yes --delspec=yes --default --install="yes" --provides="nodejs" \
                  --requires="systemtap-sdt-dev" && \
 
sudo ldconfig
 
echo " "
echo "Finished ! ! "
echo " "

after saving it as :

nodejs_complete.sh

and then perform these steps for instance :

$ chmod +x nodejs_complete.sh
$ ./nodejs_complete.sh 0.10.38

i.e. give as only argument of the script, the version of node you want to build.

/var/www/wiki.linino.org/data/pages/wiki/nodejshost.txt · Last modified: 2015/05/20 11:50 by arturo

2014 © dog hunter llc and the Linino Community. Linino.org is a dog hunter sponsored community project. Credits