-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnodejs_install.sh
33 lines (25 loc) · 1.03 KB
/
nodejs_install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
# Script d'installation NodeJS
# Note: Ce script fonctionne uniquement en environnement Ubuntu/Debian
# Installation des pr<C3><A9>-requis
command apt-get install python build-essential libssl-dev
# Definition des variables
# SOURCE_URL : Telechargement de la derniere version nodejs
# VERSION : Parse de la version selon le nom du fichier t<C3><A9>l<C3><A9>charg<C3><A9>
VERSION="0.8.12"
SOURCE_URL="http://nodejs.org/dist/v${VERSION}/node-v${VERSION}.tar.gz"
# Telechargement ...
command wget "${SOURCE_URL}" --output-document="/tmp/node.tar.gz"
# Decompression de l'archive telecharg<C3><A9>e
command tar --directory "/tmp" -xzf "/tmp/node.tar.gz"
# Placement dans le bon dossier en prevision de l'installation
command cd "/tmp/node-v${VERSION}"
# Compilation et installation de NodeJS
./configure
command make
command make install
# Sortie du dossier
command cd /usr/local/scripts
# Suppression des fichiers et dossiers temporaires t<C3><A9>l<C3><A9>charg<C3><A9>s
command rm "/tmp/node.tar.gz"
command rm -r "/tmp/node-v${VERSION}"