Xcode/SDL/pkg-support/devel-resources/install.sh
branchSDL-1.2
changeset 5895 402eac854030
equal deleted inserted replaced
5894:414b2fa01526 5895:402eac854030
       
     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
       
     6 echo "Running post-install script"
       
     7 umask 022
       
     8 
       
     9 USER=`basename ~`
       
    10 echo "User is \"$USER\""
       
    11 
       
    12 ROOT=/Developer/Documentation/SDL
       
    13 echo "Fixing framework permissions"
       
    14 find $ROOT -type d -exec chmod a+rx {} \;
       
    15 find $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.
       
    27 rm -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
       
    37 if [ -e "/Library/Application Support/Apple/Developer Tools" ] ; then
       
    38     echo "Installing project stationary for XCode"
       
    39     PBXDIR="/Library/Application Support/Apple/Developer Tools"
       
    40 else
       
    41     echo "Installing project stationary for Project Builder"
       
    42     PBXDIR="/Developer/ProjectBuilder Extras"
       
    43 fi
       
    44 
       
    45 # move stationary to its proper home
       
    46 mkdir -p "$PBXDIR/Project Templates/Application"
       
    47 mkdir -p "$PBXDIR/Target Templates/SDL"
       
    48 
       
    49 cp -r "$ROOT/Project Stationary/SDL Application"              "$PBXDIR/Project Templates/Application/"
       
    50 cp -r "$ROOT/Project Stationary/SDL Cocoa Application"        "$PBXDIR/Project Templates/Application/"
       
    51 cp -r "$ROOT/Project Stationary/SDL Custom Cocoa Application" "$PBXDIR/Project Templates/Application/"
       
    52 cp -r "$ROOT/Project Stationary/SDL OpenGL Application"       "$PBXDIR/Project Templates/Application/"
       
    53 cp "$ROOT/Project Stationary/Application.trgttmpl"            "$PBXDIR/Target Templates/SDL/"
       
    54 
       
    55 rm -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
       
    73 sudo -u $USER cp "$ROOT/Readme SDL Developer.txt" ~/
       
    74 
       
    75 # open up the README file
       
    76 sudo -u $USER open ~/"Readme SDL Developer.txt"