Improve OSX installer
authorRyan Dahl <ry@tinyclouds.org>
Fri, 11 Nov 2011 02:16:51 +0000 (18:16 -0800)
committerRyan Dahl <ry@tinyclouds.org>
Fri, 11 Nov 2011 02:41:44 +0000 (18:41 -0800)
.gitignore
Makefile
doc/mac_osx_nodejs_installer_logo.png [new file with mode: 0644]
tools/msvs/msi/getnodeversion.py
tools/osx-dist.sh
tools/osx-pkg-dmg-create.sh [deleted file]
tools/osx-pkg.pmdoc/01local.xml [new file with mode: 0644]
tools/osx-pkg.pmdoc/index.xml [new file with mode: 0644]

index 68b5843..2b27112 100644 (file)
@@ -33,3 +33,4 @@ ipch/
 /options.gypi
 *-nodegyp*
 /gyp-mac-tool
+/dist-osx
index 2ac3cd7..1d207cd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -120,6 +120,7 @@ clean:
 
 distclean: docclean
        -find tools -name "*.pyc" | xargs rm -f
+       -rm -rf dist-osx
        -rm -rf out/ node node_g
 
 check:
diff --git a/doc/mac_osx_nodejs_installer_logo.png b/doc/mac_osx_nodejs_installer_logo.png
new file mode 100644 (file)
index 0000000..8570d91
Binary files /dev/null and b/doc/mac_osx_nodejs_installer_logo.png differ
index a9a5274..551d95d 100644 (file)
@@ -6,4 +6,4 @@ for line in sys.stdin:
     minor = line.split()[2]
   if re.match('#define NODE_PATCH_VERSION', line):
     patch = line.split()[2]
-print '{0:s}.{1:s}.{2:s}.0'.format(major, minor, patch)
+print '{0:s}.{1:s}.{2:s}'.format(major, minor, patch)
index d139bf4..98fb232 100755 (executable)
@@ -3,21 +3,26 @@
 TOOLS=`dirname $0`
 ROOT=$TOOLS/..
 
-VERSION=`git describe`
-CONTENTS=dist-osx/nodejs-$VERSION
+VERSION=`python $TOOLS/msvs/msi/getnodeversion.py < $ROOT/src/node_version.h`
+CONTENTS=$ROOT/dist-osx
+PMDOC=$TOOLS/osx-pkg.pmdoc
+VENDOR='org.nodejs'
+NAME=NodeJS
 
 # go build it in the root of the git repository
 pushd $ROOT
 
-./configure --prefix=/usr/local/nodejs
+./configure --prefix=/usr/local
 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'
+PKGID="$VENDOR.$NAME-$VERSION"
+
+packagemaker=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
+
+$packagemaker \
+  --id "$PKGID" \
+  --doc $PMDOC \
+  --out $CONTENTS/node-$VERSION.pkg
diff --git a/tools/osx-pkg-dmg-create.sh b/tools/osx-pkg-dmg-create.sh
deleted file mode 100755 (executable)
index e288d8f..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/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
-
diff --git a/tools/osx-pkg.pmdoc/01local.xml b/tools/osx-pkg.pmdoc/01local.xml
new file mode 100644 (file)
index 0000000..91e2156
--- /dev/null
@@ -0,0 +1 @@
+<pkgref spec="1.12" uuid="053587FE-BDF3-4EF5-815D-281427431048"><config><identifier>org.nodejs.pkg</identifier><version>1.0</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true" mod="true">../dist-osx/usr/local/</installFrom><installTo mod="true" relocatable="true">/usr/local</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>installTo.isRelativeType</mod><mod>installTo</mod><mod>locationType</mod><mod>relocatable</mod><mod>installFrom.path</mod><mod>installTo.isAbsoluteType</mod><mod>identifier</mod><mod>parent</mod><mod>installTo.path</mod><mod>installFrom.isRelativeType</mod></config><contents><file-list>01local-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>
\ No newline at end of file
diff --git a/tools/osx-pkg.pmdoc/index.xml b/tools/osx-pkg.pmdoc/index.xml
new file mode 100644 (file)
index 0000000..56b96bd
--- /dev/null
@@ -0,0 +1,15 @@
+<pkmkdoc spec="1.12"><properties><title>Node</title><build>/Users/ryan/Desktop/Node.pkg</build><organization>org.nodejs</organization><userSees ui="easy"/><min-target os="3"/><domain system="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><contents><choice title="node" id="choice3" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="org.nodejs.pkg"/></choice></contents><resources bg-scale="none" bg-align="topleft"><locale lang="en"><resource relative="true" mod="true" type="background">../doc/mac_osx_nodejs_installer_logo.png</resource><resource mime-type="text/rtf" kind="embedded" type="welcome"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
+
+\f0\fs26 \cf0 This package will install node and node-waf into /usr/local/bin}]]></resource><resource mime-type="text/rtf" kind="embedded" type="conclusion"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360
+{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
+{\colortbl;\red255\green255\blue255;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
+
+\f0\fs26 \cf0 Node was installed at\
+\
+   /usr/local/bin/node\
+\
+Make sure that /usr/local/bin is in your path.}]]></resource></locale></resources><flags/><item type="file">01local.xml</item><mod>properties.title</mod><mod>properties.userDomain</mod><mod>properties.anywhereDomain</mod><mod>properties.systemDomain</mod></pkmkdoc>
\ No newline at end of file