summaryrefslogtreecommitdiff
path: root/misc/osx/scripts/postinstall
diff options
context:
space:
mode:
Diffstat (limited to 'misc/osx/scripts/postinstall')
-rw-r--r--misc/osx/scripts/postinstall28
1 files changed, 28 insertions, 0 deletions
diff --git a/misc/osx/scripts/postinstall b/misc/osx/scripts/postinstall
new file mode 100644
index 000000000..f8545b8b0
--- /dev/null
+++ b/misc/osx/scripts/postinstall
@@ -0,0 +1,28 @@
+#!/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 .
+
+echo "Setting GOROOT system-wide"
+echo "eval \`/etc/profile_go\`" >> /etc/csh.login
+echo "eval \`/etc/profile_go\`" >> /etc/zshenv
+echo "eval \`/etc/profile_go\`" >> /etc/profile
+
+echo "Fixing debuggers via sudo.bash"
+# setgrp procmod the debuggers (sudo.bash)
+cd $GOROOT/src
+./sudo.bash
+
+echo "Installing miscellaneous files:"
+XCODE_MISC_DIR="/Library/Application Support/Developer/Shared/Xcode/Specifications/"
+if [ -f $XCODE_MISC_DIR ]; then
+ echo " XCode"
+ cp $GOROOT/misc/xcode/* $XCODE_MISC_DIR
+fi
+