diff options
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/Makefile | 8 | ||||
-rw-r--r-- | pkg/npm/Makefile | 27 |
2 files changed, 33 insertions, 2 deletions
diff --git a/pkg/Makefile b/pkg/Makefile index f5cfd3c2..6001a034 100644 --- a/pkg/Makefile +++ b/pkg/Makefile @@ -6,7 +6,7 @@ VERSION ?= $(shell grep 'define NXT_VERSION' ../src/nxt_main.h \ RELEASE ?= 1 default: - @echo "available targets: dist rpm deb docker" + @echo "available targets: dist rpm deb docker npm" dist: rm -f unit-$(VERSION).tar.gz @@ -24,9 +24,13 @@ deb: docker: @cd docker && VERSION=$(VERSION) RELEASE=$(RELEASE) make all +npm: + @cd npm && VERSION=$(VERSION) RELEASE=$(RELEASE) make all + clean: @cd rpm && make clean @cd deb && make clean @cd docker && make clean + @cd npm && make clean -.PHONY: default rpm deb docker clean +.PHONY: default rpm deb docker npm clean diff --git a/pkg/npm/Makefile b/pkg/npm/Makefile new file mode 100644 index 00000000..2696c226 --- /dev/null +++ b/pkg/npm/Makefile @@ -0,0 +1,27 @@ +#!/usr/bin/make + +DEFAULT_VERSION := $(shell grep 'define NXT_VERSION' ../../src/nxt_main.h \ + | sed -e 's/^.*"\(.*\)".*/\1/') + +VERSION ?= $(DEFAULT_VERSION) +NPM ?= npm + +default: + @echo "valid targets: all publish clean" + +copy: + cp -rp ../../src/nodejs/unit-http . + mv unit-http/binding_pub.gyp unit-http/binding.gyp + sed -e 's/"version"\s*:.*/"version": "${VERSION}.0",/' \ + 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 |