summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Rajlich <nathan@tootallnate.net>2012-08-06 12:25:45 -0700
committerNathan Rajlich <nathan@tootallnate.net>2012-08-06 12:25:45 -0700
commita23df7710ab89a926d105e52a903bd044c7cea2d (patch)
tree00cf4297201ffb10524f54f3bf3c276766d073da
parentbc7479d2321f7cbfe7567195a5bcf59d92acbb90 (diff)
parentcc6034ac862e058ee9faa5306f240d11150f960e (diff)
downloadnode-new-a23df7710ab89a926d105e52a903bd044c7cea2d.tar.gz
Merge branch 'binary-tarballs' into v0.8
-rw-r--r--Makefile76
-rw-r--r--tools/email-footer.md8
-rwxr-xr-xtools/install.py22
3 files changed, 77 insertions, 29 deletions
diff --git a/Makefile b/Makefile
index 869eafac9a..31a2dde735 100644
--- a/Makefile
+++ b/Makefile
@@ -192,8 +192,20 @@ docclean:
-rm -rf out/doc
VERSION=v$(shell $(PYTHON) tools/getnodeversion.py)
+PLATFORM=$(shell uname | tr '[:upper:]' '[:lower:]')
+ifeq ($(DESTCPU),x64)
+ARCH=x86_64
+else
+ifeq ($(DESTCPU),ia32)
+ARCH=i386
+else
+ARCH=$(shell uname -m)
+endif
+endif
TARNAME=node-$(VERSION)
TARBALL=$(TARNAME).tar.gz
+BINARYNAME=$(TARNAME)-$(PLATFORM)-$(ARCH)
+BINARYTAR=$(BINARYNAME).tar.gz
PKG=out/$(TARNAME).pkg
packagemaker=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
@@ -201,9 +213,31 @@ dist: doc $(TARBALL) $(PKG)
PKGDIR=out/dist-osx
+release-only:
+ @if [ "$(shell git status --porcelain | egrep -v '^\?\? ')" = "" ]; then \
+ exit 0 ; \
+ else \
+ echo "" >&2 ; \
+ echo "The git repository is not clean." >&2 ; \
+ echo "Please commit changes before building release tarball." >&2 ; \
+ echo "" >&2 ; \
+ git status --porcelain | egrep -v '^\?\?' >&2 ; \
+ echo "" >&2 ; \
+ exit 1 ; \
+ fi
+ @if [ $(shell ./node --version) = "$(VERSION)" ]; then \
+ exit 0; \
+ else \
+ echo "" >&2 ; \
+ echo "$(shell ./node --version) doesn't match $(VERSION)." >&2 ; \
+ echo "Did you remember to update src/node_version.cc?" >&2 ; \
+ echo "" >&2 ; \
+ exit 1 ; \
+ fi
+
pkg: $(PKG)
-$(PKG):
+$(PKG): release-only
rm -rf $(PKGDIR)
rm -rf out/deps out/Release
./configure --prefix=$(PKGDIR)/32/usr/local --without-snapshot --dest-cpu=ia32
@@ -224,27 +258,7 @@ $(PKG):
--out $(PKG)
SIGN="$(SIGN)" PKG="$(PKG)" bash tools/osx-productsign.sh
-$(TARBALL): node doc
- @if [ "$(shell git status --porcelain | egrep -v '^\?\? ')" = "" ]; then \
- exit 0 ; \
- else \
- echo "" >&2 ; \
- echo "The git repository is not clean." >&2 ; \
- echo "Please commit changes before building release tarball." >&2 ; \
- echo "" >&2 ; \
- git status --porcelain | egrep -v '^\?\?' >&2 ; \
- echo "" >&2 ; \
- exit 1 ; \
- fi
- @if [ $(shell ./node --version) = "$(VERSION)" ]; then \
- exit 0; \
- else \
- echo "" >&2 ; \
- echo "$(shell ./node --version) doesn't match $(VERSION)." >&2 ; \
- echo "Did you remember to update src/node_version.cc?" >&2 ; \
- echo "" >&2 ; \
- exit 1 ; \
- fi
+$(TARBALL): release-only node doc
git archive --format=tar --prefix=$(TARNAME)/ HEAD | tar xf -
mkdir -p $(TARNAME)/doc/api
cp doc/node.1 $(TARNAME)/doc/node.1
@@ -256,6 +270,22 @@ $(TARBALL): node doc
rm -rf $(TARNAME)
gzip -f -9 $(TARNAME).tar
+tar: $(TARBALL)
+
+$(BINARYTAR): release-only
+ rm -rf $(BINARYNAME)
+ rm -rf out/deps out/Release
+ ./configure --prefix=/ --without-snapshot --dest-cpu=$(DESTCPU)
+ $(MAKE) install DESTDIR=$(BINARYNAME) V=$(V) PORTABLE=1
+ cp README.md $(BINARYNAME)
+ cp LICENSE $(BINARYNAME)
+ cp ChangeLog $(BINARYNAME)
+ tar -cf $(BINARYNAME).tar $(BINARYNAME)
+ rm -rf $(BINARYNAME)
+ gzip -f -9 $(BINARYNAME).tar
+
+binary: $(BINARYTAR)
+
dist-upload: $(TARBALL) $(PKG)
ssh node@nodejs.org mkdir -p web/nodejs.org/dist/$(VERSION)
scp $(TARBALL) node@nodejs.org:~/web/nodejs.org/dist/$(VERSION)/$(TARBALL)
@@ -280,4 +310,4 @@ cpplint:
lint: jslint cpplint
-.PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean check uninstall install install-includes install-bin all staticlib dynamiclib test test-all website-upload pkg blog blogclean
+.PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean check uninstall install install-includes install-bin all staticlib dynamiclib test test-all website-upload pkg blog blogclean tar binary release-only
diff --git a/tools/email-footer.md b/tools/email-footer.md
index e6115c9dd5..d25580f646 100644
--- a/tools/email-footer.md
+++ b/tools/email-footer.md
@@ -8,6 +8,14 @@ Windows x64 Installer: http://nodejs.org/dist/__VERSION__/x64/node-__VERSION__-x
Windows x64 Files: http://nodejs.org/dist/__VERSION__/x64/
+Linux 32-bit Binary Package: http://nodejs.org/dist/__VERSION__/node-__VERSION__-linux-i686.tar.gz
+
+Linux 64-bit Binary Package: http://nodejs.org/dist/__VERSION__/node-__VERSION__-linux-x86_64.tar.gz
+
+Solaris 32-bit Binary Package: http://nodejs.org/dist/__VERSION__/node-__VERSION__-sunos-i386.tar.gz
+
+Solaris 64-bit Binary Package: http://nodejs.org/dist/__VERSION__/node-__VERSION__-sunos-x86_64.tar.gz
+
Other release files: http://nodejs.org/dist/__VERSION__/
Website: http://nodejs.org/docs/__VERSION__/
diff --git a/tools/install.py b/tools/install.py
index d03aae9d1c..1dd039a865 100755
--- a/tools/install.py
+++ b/tools/install.py
@@ -91,7 +91,9 @@ def waf_files(action):
'tools/wafadmin/Scripting.py',
'tools/wafadmin/TaskGen.py',
'tools/wafadmin/Task.py',
- 'tools/wafadmin/Tools/ar.py',
+ 'tools/wafadmin/Utils.py'],
+ 'lib/node/wafadmin/')
+ action(['tools/wafadmin/Tools/ar.py',
'tools/wafadmin/Tools/cc.py',
'tools/wafadmin/Tools/ccroot.py',
'tools/wafadmin/Tools/compiler_cc.py',
@@ -123,12 +125,11 @@ def waf_files(action):
'tools/wafadmin/Tools/unittestw.py',
'tools/wafadmin/Tools/winres.py',
'tools/wafadmin/Tools/xlc.py',
- 'tools/wafadmin/Tools/xlcxx.py',
- 'tools/wafadmin/Utils.py'],
- 'lib/node/')
+ 'tools/wafadmin/Tools/xlcxx.py'],
+ 'lib/node/wafadmin/Tools/')
def update_shebang(path, shebang):
- print 'updating shebang of %s' % path
+ print 'updating shebang of %s to %s' % (path, shebang)
s = open(path, 'r').read()
s = re.sub(r'#!.*\n', '#!' + shebang + '\n', s)
open(path, 'w').write(s)
@@ -153,7 +154,16 @@ def npm_files(action):
action([link_path], 'bin/npm')
elif action == install:
try_symlink('../lib/node_modules/npm/bin/npm-cli.js', link_path)
- update_shebang(link_path, node_prefix + '/bin/node')
+ if os.environ['PORTABLE']:
+ # This crazy hack is necessary to make the shebang execute the copy
+ # of node relative to the same directory as the npm script. The precompiled
+ # binary tarballs use a prefix of "/" which gets translated to "/bin/node"
+ # in the regular shebang modifying logic, which is incorrect since the
+ # precompiled bundle should be able to be extracted anywhere and "just work"
+ shebang = '/bin/sh\n// 2>/dev/null; exec "`dirname "$0"`/node" "$0" "$@"'
+ else:
+ shebang = os.path.join(node_prefix, 'bin/node')
+ update_shebang(link_path, shebang)
else:
assert(0) # unhandled action type