#!/bin/sh -e # # Create a MachoPython package from the currently installed verison # and put it on a disk image # PYVER=2.2 curDir=`pwd` progDir="`dirname \"$0\"`" defDstPath="/projects/wx/wxPython/dist" pkgName="MachoPython" version=2.2.1-2 dmgRoot="dmg-root" pkgRoot="pkg-root" sitePkgDir="$pkgRoot/Library/Frameworks/Python.framework/Versions/$PYVER/lib/python$PYVER/site-packages" pythonExec="python$PYVER" makePkgExec="./makepkg" makeDmgExec="./makedmg" usage() { echo `basename $0`: ERROR: $* 1>&2 echo usage: `basename $0` '[-d dir]' 1>&2 exit 1 } quotemeta() { # probably not quite correct, but seems to work echo "$1" | sed -e 's/\([^a-zA-z0-9.,--;_/]\)/\\\1/g' } msg() { echo "---------------------------------------------" echo $@ } msgdo() { echo "--> " $@ $@ } user=$1 shift dstPath= while :; do case "$1" in -d) shift; dstPath="$1";; -*) usage "bad argument $1";; *) break;; esac shift done #----------------------------------- msg check and prepare build directories if ! test "$dstPath"; then dstPath=$defDstPath fi if ! test -d "$dstPath"; then msgdo mkdir -p -m 775 "$dstPath" msgdo chown ${user}:staff "$dstPath" fi temp="tmp$$" if test -e "$dstPath/$temp"; then msgdo rm -rf "$dstPath/$temp" fi msgdo mkdir -m 775 "$dstPath/$temp" if test -e "$dstPath/$temp/$pkgRoot"; then msgdo rm -rf "$dstPath/$temp/$pkgRoot" fi msgdo mkdir -m 1775 "$dstPath/$temp/$pkgRoot" msgdo chown root:admin "$dstPath/$temp/$pkgRoot" if test -e "$dstPath/$temp/$dmgRoot"; then msgdo rm -rf "$dstPath/$temp/$dmgRoot" fi msgdo mkdir -p -m 775 "$dstPath/$temp/$dmgRoot" msgdo chown $user:staff "$dstPath/$temp/$dmgRoot" #----------------------------------- msg Copying files to package build dir for d in Applications/Python.app Library/Frameworks/Python.framework; do msgdo mkdir -p -m 755 $dstPath/$temp/$pkgRoot/$d msgdo cp -pR /$d/* $dstPath/$temp/$pkgRoot/$d done msgdo mkdir -p -m 755 $dstPath/$temp/$pkgRoot/usr/local/bin msgdo cd $dstPath/$temp/$pkgRoot/usr/local/bin for f in pydoc python python$PYVER; do msgdo ln -s ../../../Library/Frameworks/Python.framework/Versions/Current/bin/$f . done cat > pythonw <