Install nodejs for RHEL/Fedora

nodejs is required for Horizon (ships a copy of lessc internally).  I
couldn't find nodejs in the rpm list, despite it being installed in
lib/horizon.  This adds to the rpm list as NOPRIME and retains the old
install point.

RHEL6 has nodejs in EPEL now, so we remove the old hack that installed
an upstream version and add it to the install mentioned previously

Change-Id: Ib3ee2f7d77e22666c9055c8528288c01b46a95d3
This commit is contained in:
Ian Wienand 2013-05-23 09:25:10 +10:00 committed by Gerrit Code Review
parent c29c392d26
commit 2bda6cfabf
2 changed files with 3 additions and 44 deletions

View File

@ -3,6 +3,7 @@ django-registration
gcc gcc
httpd # NOPRIME httpd # NOPRIME
mod_wsgi # NOPRIME mod_wsgi # NOPRIME
nodejs # NOPRIME
pylint pylint
python-anyjson python-anyjson
python-BeautifulSoup python-BeautifulSoup

View File

@ -73,31 +73,6 @@ function _horizon_config_set() {
fi fi
} }
# Basic install of upstream nodejs for platforms that want it
function install_nodejs() {
if [[ $(which node) ]]; then
echo "You already appear to have nodejs, skipping install"
return
fi
# There are several node deployment scripts; one may be more
# appropriate at some future point, but for now direct download is
# the simplest way. The version barely matters for lesscss which
# doesn't use anything fancy.
local ver=0.10.1
local nodejs=node-v${ver}-linux-x64
local tar=$nodejs.tar.gz
local nodejs_url=http://nodejs.org/dist/v${ver}/${tar}
curl -Ss ${nodejs_url} | tar -C ${DEST} -xz
if [ $? -ne 0 ]; then
echo "*** Download of nodejs failed"
return 1
fi
# /usr/bin so it gets found in the PATH available to horizon
sudo ln -s $DEST/$nodejs/bin/node /usr/bin/node
}
# Entry Points # Entry Points
# ------------ # ------------
@ -105,15 +80,7 @@ function install_nodejs() {
# cleanup_horizon() - Remove residual data files, anything left over from previous # cleanup_horizon() - Remove residual data files, anything left over from previous
# runs that a clean run would need to clean up # runs that a clean run would need to clean up
function cleanup_horizon() { function cleanup_horizon() {
:
if [[ is_fedora && $DISTRO =~ (rhel6) ]]; then
# if the /usr/bin/node link looks like it's pointing into $DEST,
# then we installed it via install_nodejs
if [[ $(readlink -f /usr/bin/node) =~ ($DEST) ]]; then
sudo rm /usr/bin/node
fi
fi
} }
# configure_horizon() - Set config files, create data dirs, etc # configure_horizon() - Set config files, create data dirs, etc
@ -199,21 +166,12 @@ function install_horizon() {
exit_distro_not_supported "apache installation" exit_distro_not_supported "apache installation"
fi fi
if [[ is_fedora && $DISTRO =~ (rhel6) ]]; then
# RHEL6 currently has no native way to get nodejs, so we do a
# basic install here (see cleanup_horizon too).
# TODO: does nova have a better way that we can limit
# requirement of site-wide nodejs install?
install_nodejs
fi
# NOTE(sdague) quantal changed the name of the node binary # NOTE(sdague) quantal changed the name of the node binary
if is_ubuntu; then if is_ubuntu; then
if [[ ! -e "/usr/bin/node" ]]; then if [[ ! -e "/usr/bin/node" ]]; then
install_package nodejs-legacy install_package nodejs-legacy
fi fi
elif is_fedora && [[ "$os_RELEASE" -ge "18" ]]; then elif is_fedora && [[ $DISTRO =~ (rhel6) || "$os_RELEASE" -ge "18" ]]; then
# fedora 18 and higher gets nodejs
install_package nodejs install_package nodejs
fi fi