• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2# finish up the installation
3# this script should be executed using the sudo command
4# this file is copied to SDL-devel.post_install and SDL-devel.post_upgrade
5# inside the .pkg bundle
6echo "Running post-install script"
7umask 022
8
9USER=`basename ~`
10echo "User is \"$USER\""
11
12ROOT=/Developer/Documentation/SDL
13echo "Fixing framework permissions"
14find $ROOT -type d -exec chmod a+rx {} \;
15find $ROOT -type f -exec chmod a+r {} \;
16
17## We're not installing frameworks here anymore. The single
18## framework should be installed to /Library/Frameworks which
19## is handled by the standard package (not developer package).
20## Using the home directory here is problematic for multi-user systems too.
21# echo "Moving SDL.framework to ~/Library/Frameworks"
22# move SDL to its proper home, so the target stationary works
23#sudo -u $USER mkdir -p ~/Library/Frameworks
24#sudo -u $USER /Developer/Tools/CpMac -r $ROOT/SDL.framework ~/Library/Frameworks
25
26## I'm not sure where this gets created and what's put in there.
27rm -rf $ROOT/SDL.framework
28
29## I think precompiled headers have changed through the revisions of Apple's gcc.
30## I don't know how useful this is anymore w.r.t. Apple's newest system for precompiled headers.
31## I'm removing this for now.
32# echo "Precompiling Header"
33# precompile header for speedier compiles
34#sudo -u $USER /usr/bin/cc -precomp ~/Library/Frameworks/SDL.framework/Headers/SDL.h -o ~/Library/Frameworks/SDL.framework/Headers/SDL.p
35
36# find the directory to store stationary in
37if [ -e "/Library/Application Support/Apple/Developer Tools" ] ; then
38    echo "Installing project stationary for XCode"
39    PBXDIR="/Library/Application Support/Apple/Developer Tools"
40else
41    echo "Installing project stationary for Project Builder"
42    PBXDIR="/Developer/ProjectBuilder Extras"
43fi
44
45# move stationary to its proper home
46mkdir -p "$PBXDIR/Project Templates/Application"
47mkdir -p "$PBXDIR/Target Templates/SDL"
48
49cp -r "$ROOT/Project Stationary/SDL Application"              "$PBXDIR/Project Templates/Application/"
50cp -r "$ROOT/Project Stationary/SDL Cocoa Application"        "$PBXDIR/Project Templates/Application/"
51cp -r "$ROOT/Project Stationary/SDL Custom Cocoa Application" "$PBXDIR/Project Templates/Application/"
52cp -r "$ROOT/Project Stationary/SDL OpenGL Application"       "$PBXDIR/Project Templates/Application/"
53cp "$ROOT/Project Stationary/Application.trgttmpl"            "$PBXDIR/Target Templates/SDL/"
54
55rm -rf "$ROOT/Project Stationary"
56
57# Actually, man doesn't check this directory by default, so this isn't
58# very helpful anymore.
59#echo "Installing Man Pages"
60## remove old man pages
61#rm -rf "/Developer/Documentation/ManPages/man3/SDL"*
62#
63## install man pages
64#mkdir -p "/Developer/Documentation/ManPages/man3"
65#cp "$ROOT/docs/man3/SDL"* "/Developer/Documentation/ManPages/man3/"
66#rm -rf "$ROOT/docs/man3"
67#
68#echo "Rebuilding Apropos Database"
69## rebuild apropos database
70#/usr/libexec/makewhatis
71
72# copy README file to your home directory
73sudo -u $USER cp "$ROOT/Readme SDL Developer.txt" ~/
74
75# open up the README file
76sudo -u $USER open ~/"Readme SDL Developer.txt"
77