This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Adding OS X .dmg build scripts.

Simply place this into the root of your nodejs git working copy and
run ./tools/osx-dist.sh. It will create an dist-osx folder which will
comprise of the resulting .dmg file (install path is
/usr/local/nodejs with symlinks added to /usr/local/bin) along with
other files used during its construction.

$ ls -1 dist-osx/
nodejs-v0.1.26-11-gcd6397c
nodejs-v0.1.26-11-gcd6397c.dmg
nodejs-v0.1.26-11-gcd6397c.pkg
nodejs-v0.1.26-11-gcd6397c.plist

The resulting installed package is going to be visible using the
OS X 'pkgutil --packages' command. You can even safely uninstall
sudoing 'pkgutil --unlink org.nodejs.NodeJS-...' and subsequently
let the system forget about the package being ever seen by
'pkgutil --forget org.nodejs.NodeJS-...'.

Here is the current package ID I have installed:

$ pkgutil --pkgs | grep node
org.nodejs.NodeJS-v0.1.26-11-gcd6397c

Use this patch freely without hesitation.

Signed-off-by: Standa Opichal <opichals@gmail.com>
  • Loading branch information...
1 parent 1bb5294 commit 5a702240813b172d096961edb4c461973b09998b @opichals opichals committed with ry Jan 26, 2010
Showing with 88 additions and 0 deletions.
  1. +23 −0 tools/osx-dist.sh
  2. +65 −0 tools/osx-pkg-dmg-create.sh
View
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+TOOLS=`dirname $0`
+ROOT=$TOOLS/..
+
+VERSION=`git describe`
+CONTENTS=dist-osx/nodejs-$VERSION
+
+# go build it in the root of the git repository
+pushd $ROOT
+
+./configure --prefix=/usr/local/nodejs
+make
+make install DESTDIR="$CONTENTS"
+
+mkdir -p "$CONTENTS/usr/local/bin"
+pushd "$CONTENTS/usr/local/bin"
+ln -s ../nodejs/bin/* .
+popd # $CONTENTS/usr/local/bin
+
+popd # $ROOT
+
+"$TOOLS/osx-pkg-dmg-create.sh" "$ROOT/$CONTENTS" NodeJS $VERSION 'org.nodejs'
@@ -0,0 +1,65 @@
+#!/bin/bash
+# Create a complete OS .dmg file (it needs the Apple Developers Tools installed)
+# usage:
+# pkg-create.sh <contents-root-folder> <package-name> <package-version> <vendor-string>
+#
+
+CONTENTS=$1
+shift
+NAME=$1
+shift
+VERSION=$1
+shift
+VENDOR=$1
+
+PKGID="$VENDOR.$NAME-$VERSION"
+
+# unused pkg-info entries so far
+#
+# <key>CFBundleExecutable</key>
+# <string>$NAME</string>
+# <key>CFBundleSignature</key>
+# <string>????</string>
+
+#
+# Need the .plist file in order for the packagemaker to create a package which the
+# pkgutil --packages later on would return an entry about. pkgutil can then --unlink
+# and --forget about the package nicely.
+#
+cat > "$CONTENTS.plist" <<PINFO
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<pkg-info version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleIdentifier</key>
+ <string>$PKGID</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>$NAME</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>$VERSION</string>
+ <key>CFBundleVersion</key>
+ <string>$VERSION</string>
+</dict>
+</pkg-info>
+PINFO
+
+packagemaker=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
+
+$packagemaker \
+ --id "$PKGID" \
+ --info "$CONTENTS.plist" \
+ --root "$CONTENTS" \
+ --target 10.5 \
+ --out "$CONTENTS".pkg
+
+hdiutil create "$CONTENTS.dmg" \
+ -format UDZO -ov \
+ -volname "$NAME $VERSION" \
+ -srcfolder $CONTENTS.pkg
+

0 comments on commit 5a70224

Please sign in to comment.