Files
nginx-unit/pkg/npm/Makefile
Valentin Bartenev 5c9fe8c306 Added trailing zero to version string.
While it looks nicer without zero 3-rd version number, this should
improve interoperability.  Version string can be parsed or used for
sorting.  And it is easier to handle and less confusing when there
is constant number of version parts.

Moreover, NPM also expects version format with 3 parts.
So ".0" has already been used in Node.js module version.
2019-02-27 17:25:28 +03:00

29 lines
601 B
Makefile

#!/usr/bin/make
include ../../version
VERSION ?= $(NXT_VERSION)
VERNUM ?= $(NXT_VERNUM)
NPM ?= npm
default:
@echo "valid targets: all publish clean"
copy:
cp -rp ../../src/nodejs/unit-http .
echo '#define NXT_NODE_VERNUM ${VERNUM}' > unit-http/version.h
mv unit-http/binding_pub.gyp unit-http/binding.gyp
sed -e 's/"version"\s*:.*/"version": "${VERSION}",/' \
unit-http/package.json > unit-http/package.json.tmp
mv unit-http/package.json.tmp unit-http/package.json
publish: copy
cd unit-http && $(NPM) publish
all: copy
clean:
rm -rf unit-http
.PHONY: default all copy publish clean