[FFmpeg-devel] [PATCH 12/16] Script to install npm locally
Clément Bœsch
u at pkh.me
Mon Jul 14 10:31:14 CEST 2014
From: db0company <db0company at gmail.com>
---
.gitignore | 1 +
README | 6 ++++++
local-npm.sh | 38 ++++++++++++++++++++++++++++++++++++++
3 files changed, 45 insertions(+)
create mode 100755 local-npm.sh
diff --git a/.gitignore b/.gitignore
index 9d5c38a..de36d30 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
/htdocs/css/style.min.css
/htdocs/main.rss
/htdocs/components
+/npm
diff --git a/README b/README
index 130f081..7c7c67c 100644
--- a/README
+++ b/README
@@ -2,3 +2,9 @@ This generates the ffmpeg.org website by fitting the navigation links onto
source files and dropping the result in the htdocs/ directory.
'make' generates the website, 'make clean' removes all generated files.
+
+Note: npm, bower and lessc are required.
+$ sudo aptitude install npm && sudo npm install -g bower && sudo npm install -g less && make
+
+If you wish to install those locally (root not required), run this script instead:
+$ ./local-npm.sh
diff --git a/local-npm.sh b/local-npm.sh
new file mode 100755
index 0000000..ea8fd0c
--- /dev/null
+++ b/local-npm.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+folder='npm'
+tarname='node.tar.gz'
+
+if [ $# -ge 1 ] && [ $1 = '-clean' ]
+then
+ rm -rf $folder
+ rm -f ~/.npmrc
+ rm -f $tarname
+ exit 0
+fi
+
+mkdir -p $folder && \
+cd $folder && \
+
+localpath=`pwd`
+
+echo "root = "$localpath"/lib/node_modules
+binroot = "$localpath"/bin
+manroot = "$localpath"/share/man" > ~/.npmrc && \
+
+wget "http://nodejs.org/dist/v0.10.29/node-v0.10.29.tar.gz" -O $tarname && \
+tar xf $tarname && \
+cd node-* && \
+./configure --prefix=$localpath && \
+make && \
+make install && \
+cd .. && \
+
+export PATH=$localpath/bin:$PATH && \
+
+npm install -g less && \
+npm install -g bower && \
+
+cd .. && \
+
+make
--
2.0.1
More information about the ffmpeg-devel
mailing list