diff options
Diffstat (limited to 'misc/makerelease/darwin')
-rw-r--r-- | misc/makerelease/darwin/Distribution | 32 | ||||
-rw-r--r-- | misc/makerelease/darwin/Resources/bg.png | bin | 0 -> 11466 bytes | |||
-rw-r--r-- | misc/makerelease/darwin/etc/paths.d/go | 1 | ||||
-rwxr-xr-x | misc/makerelease/darwin/scripts/postinstall | 10 | ||||
-rwxr-xr-x | misc/makerelease/darwin/scripts/preinstall | 8 |
5 files changed, 51 insertions, 0 deletions
diff --git a/misc/makerelease/darwin/Distribution b/misc/makerelease/darwin/Distribution new file mode 100644 index 000000000..8b764b69f --- /dev/null +++ b/misc/makerelease/darwin/Distribution @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8" standalone="no"?> +<installer-script minSpecVersion="1.000000"> + <title>Go</title> + <background mime-type="image/png" file="bg.png"/> + <options customize="never" allow-external-scripts="no"/> + <domains enable_localSystem="true" /> + <installation-check script="installCheck();"/> + <script> +function installCheck() { + if(!(system.compareVersions(system.version.ProductVersion, '10.6.0') >= 0)) { + my.result.title = 'Unable to install'; + my.result.message = 'Go requires Mac OS X 10.6 or later.'; + my.result.type = 'Fatal'; + return false; + } + if(system.files.fileExistsAtPath('/usr/local/go/bin/go')) { + my.result.title = 'Previous Installation Detected'; + my.result.message = 'A previous installation of Go exists at /usr/local/go. This installer will remove the previous installation prior to installing. Please back up any data before proceeding.'; + my.result.type = 'Warning'; + return false; + } + return true; +} + </script> + <choices-outline> + <line choice="com.googlecode.go.choice"/> + </choices-outline> + <choice id="com.googlecode.go.choice" title="Go"> + <pkg-ref id="com.googlecode.go.pkg"/> + </choice> + <pkg-ref id="com.googlecode.go.pkg" auth="Root">com.googlecode.go.pkg</pkg-ref> +</installer-script> diff --git a/misc/makerelease/darwin/Resources/bg.png b/misc/makerelease/darwin/Resources/bg.png Binary files differnew file mode 100644 index 000000000..c3d8ea93a --- /dev/null +++ b/misc/makerelease/darwin/Resources/bg.png diff --git a/misc/makerelease/darwin/etc/paths.d/go b/misc/makerelease/darwin/etc/paths.d/go new file mode 100644 index 000000000..532e5f936 --- /dev/null +++ b/misc/makerelease/darwin/etc/paths.d/go @@ -0,0 +1 @@ +/usr/local/go/bin diff --git a/misc/makerelease/darwin/scripts/postinstall b/misc/makerelease/darwin/scripts/postinstall new file mode 100755 index 000000000..13f5bff9b --- /dev/null +++ b/misc/makerelease/darwin/scripts/postinstall @@ -0,0 +1,10 @@ +#!/bin/bash + +GOROOT=/usr/local/go + +echo "Fixing permissions" +cd $GOROOT +find . -exec chmod ugo+r \{\} \; +find bin -exec chmod ugo+rx \{\} \; +find . -type d -exec chmod ugo+rx \{\} \; +chmod o-w . diff --git a/misc/makerelease/darwin/scripts/preinstall b/misc/makerelease/darwin/scripts/preinstall new file mode 100755 index 000000000..4cdaaa4bc --- /dev/null +++ b/misc/makerelease/darwin/scripts/preinstall @@ -0,0 +1,8 @@ +#!/bin/bash + +GOROOT=/usr/local/go + +echo "Removing previous installation" +if [ -d $GOROOT ]; then + rm -r $GOROOT +fi |