diff --git a/tools/osx-dist.sh b/tools/osx-dist.sh new file mode 100755 index 00000000000..d139bf4ac62 --- /dev/null +++ b/tools/osx-dist.sh @@ -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' diff --git a/tools/osx-pkg-dmg-create.sh b/tools/osx-pkg-dmg-create.sh new file mode 100755 index 00000000000..e288d8f190f --- /dev/null +++ b/tools/osx-pkg-dmg-create.sh @@ -0,0 +1,65 @@ +#!/bin/bash +# Create a complete OS .dmg file (it needs the Apple Developers Tools installed) +# usage: +# pkg-create.sh +# + +CONTENTS=$1 +shift +NAME=$1 +shift +VERSION=$1 +shift +VENDOR=$1 + +PKGID="$VENDOR.$NAME-$VERSION" + +# unused pkg-info entries so far +# +# CFBundleExecutable +# $NAME +# CFBundleSignature +# ???? + +# +# 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" < + + + + CFBundleDevelopmentRegion + en + CFBundleIdentifier + $PKGID + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $NAME + CFBundlePackageType + APPL + CFBundleShortVersionString + $VERSION + CFBundleVersion + $VERSION + + +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 +