diff options
Diffstat (limited to 'auto/modules')
-rw-r--r-- | auto/modules/nodejs | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/auto/modules/nodejs b/auto/modules/nodejs index 56f84876..3138904a 100644 --- a/auto/modules/nodejs +++ b/auto/modules/nodejs @@ -19,9 +19,9 @@ for nxt_option; do --help) cat << END - --node=NAME set node executable - --npm=NAME set npm executable - --node-gyp=NAME set node-gyp executable + --node=FILE set node executable + --npm=FILE set npm executable + --node-gyp=FILE set node-gyp executable END exit 0 @@ -49,13 +49,14 @@ fi . $NXT_AUTOCONF_DATA -$echo "configuring nodejs module" -$echo "configuring nodejs module..." >> $NXT_AUTOCONF_ERR - NXT_NODE=${NXT_NODE=node} NXT_NPM=${NXT_NPM=npm} NXT_NODE_GYP=${NXT_NODE_GYP=node-gyp} + +$echo "configuring nodejs module" +$echo "configuring nodejs module..." >> $NXT_AUTOCONF_ERR + $echo -n "checking for node ..." $echo "checking for node ..." >> $NXT_AUTOCONF_ERR @@ -73,6 +74,7 @@ else exit 1; fi + $echo -n "checking for npm ..." $echo "checking for npm ..." >> $NXT_AUTOCONF_ERR @@ -90,6 +92,7 @@ else exit 1; fi + $echo -n "checking for node-gyp ..." $echo "checking for node-gyp ..." >> $NXT_AUTOCONF_ERR @@ -114,6 +117,7 @@ if grep ^$NXT_NODE: $NXT_MAKEFILE 2>&1 > /dev/null; then exit 1; fi + NXT_NODE_TMP=${NXT_BUILD_DIR}/src/${NXT_NODE}/unit-http NXT_NODE_TARBALL=${NXT_BUILD_DIR}/${NXT_NODE}-unit-http.tar.gz NXT_NODE_EXPORTS="export UNIT_SRC_PATH=${PWD}/src && \ @@ -125,8 +129,10 @@ cat << END >> $NXT_MAKEFILE .PHONY: ${NXT_NODE}-copy .PHONY: ${NXT_NODE}-install .PHONY: ${NXT_NODE}-uninstall +.PHONY: ${NXT_NODE}-local-install +.PHONY: ${NXT_NODE}-build +.PHONY: ${NXT_NODE}-publish -all: ${NXT_NODE}: ${NXT_NODE}-copy $NXT_BUILD_DIR/$NXT_LIB_UNIT_STATIC ${NXT_NODE_EXPORTS} && \\ @@ -139,10 +145,14 @@ ${NXT_NODE}-copy: ${NXT_NODE_TARBALL}: ${NXT_NODE}-copy tar -zcvf ${NXT_NODE_TARBALL} -C ${NXT_NODE_TMP} . + ${NXT_NODE}-install: ${NXT_NODE_TARBALL} \ $NXT_BUILD_DIR/$NXT_LIB_UNIT_STATIC ${NXT_NODE_EXPORTS} && \\ - ${NXT_NPM} install -g ${PWD}/${NXT_NODE_TARBALL} --unsafe-perm=true + ${NXT_NPM} install -g ${PWD}/${NXT_NODE_TARBALL} + +${NXT_NODE}-uninstall: + ${NXT_NPM} uninstall -g unit-http ${NXT_NODE}-local-install: ${NXT_NODE_TARBALL} \ $NXT_BUILD_DIR/$NXT_LIB_UNIT_STATIC @@ -150,12 +160,10 @@ ${NXT_NODE}-local-install: ${NXT_NODE_TARBALL} \ mkdir -p \$(DESTDIR) && \\ cd \$(DESTDIR) && ${NXT_NPM} install ${PWD}/${NXT_NODE_TARBALL} + ${NXT_NODE}-build: ${NXT_NODE} ${NXT_NODE}-publish: ${NXT_NODE} cd ${NXT_NODE_TMP} && ${NXT_NPM} publish -${NXT_NODE}-uninstall: - ${NXT_NPM} uninstall -g unit-http - END |