Node.js: fixed module version on installation from sources.
@@ -145,6 +145,8 @@ cat << END >> $NXT_MAKEFILE
.PHONY: ${NXT_NODE}-build
.PHONY: ${NXT_NODE}-publish
+NXT_UNIT_VERSION=\$(shell grep 'define NXT_VERSION' \
+ src/nxt_main.h | sed -e 's/^.*"\(.*\)".*/\1/')
${NXT_NODE}: ${NXT_NODE}-copy $NXT_BUILD_DIR/$NXT_LIB_UNIT_STATIC
${NXT_NODE_EXPORTS} && \\
@@ -161,6 +163,9 @@ ${NXT_NODE_VERSION_FILE}: src/nxt_main.h
| sed -e 's/[^0-9]//g' >> $NXT_NODE_VERSION_FILE
${NXT_NODE_TARBALL}: ${NXT_NODE}-copy
+ sed -e 's/"version"\s*:.*/"version": "\$(NXT_UNIT_VERSION).0",/' \
+ ${NXT_NODE_TMP}/package.json > ${NXT_NODE_TMP}/package.json.tmp
+ mv ${NXT_NODE_TMP}/package.json.tmp ${NXT_NODE_TMP}/package.json
tar -zcvf ${NXT_NODE_TARBALL} -C ${NXT_NODE_TMP} .
