3 # Create a MachoPython package from the currently installed verison
4 # and put it on a disk image
11 progDir
="`dirname \"$0\"`"
13 defDstPath
="/projects/wx/wxPython/dist"
19 sitePkgDir
="$pkgRoot/Library/Frameworks/Python.framework/Versions/$PYVER/lib/python$PYVER/site-packages"
21 pythonExec
="python$PYVER"
22 makePkgExec
="./makepkg"
23 makeDmgExec
="./makedmg"
27 echo `basename $0`: ERROR
: $
* 1>&2
28 echo usage
: `basename $0` '[-d dir]' 1>&2
33 # probably not quite correct, but seems to work
34 echo "$1" | sed -e 's/\([^a-zA-z0-9.,--;_/]\)/\\\1/g'
39 echo "---------------------------------------------"
56 -d) shift; dstPath
="$1";;
57 -*) usage
"bad argument $1";;
64 #-----------------------------------
65 msg check and prepare build directories
67 if ! test "$dstPath"; then
70 if ! test -d "$dstPath"; then
71 msgdo
mkdir -p -m 775 "$dstPath"
72 msgdo chown
${user}:staff
"$dstPath"
76 if test -e "$dstPath/$temp"; then
77 msgdo
rm -rf "$dstPath/$temp"
79 msgdo
mkdir -m 775 "$dstPath/$temp"
81 if test -e "$dstPath/$temp/$pkgRoot"; then
82 msgdo
rm -rf "$dstPath/$temp/$pkgRoot"
84 msgdo
mkdir -m 1775 "$dstPath/$temp/$pkgRoot"
85 msgdo chown root
:admin
"$dstPath/$temp/$pkgRoot"
87 if test -e "$dstPath/$temp/$dmgRoot"; then
88 msgdo
rm -rf "$dstPath/$temp/$dmgRoot"
90 msgdo
mkdir -p -m 775 "$dstPath/$temp/$dmgRoot"
91 msgdo chown
$user:staff
"$dstPath/$temp/$dmgRoot"
93 #-----------------------------------
94 msg Copying files to package build dir
96 for d
in Applications
/Python.app Library
/Frameworks
/Python.framework
; do
97 msgdo
mkdir -p -m 755 $dstPath/$temp/$pkgRoot/$d
98 msgdo
cp -pR /$d/* $dstPath/$temp/$pkgRoot/$d
101 msgdo
mkdir -p -m 755 $dstPath/$temp/$pkgRoot/usr
/local
/bin
102 msgdo
cd $dstPath/$temp/$pkgRoot/usr
/local
/bin
103 for f
in pydoc python python
$PYVER; do
104 msgdo
ln -s ..
/..
/..
/Library
/Frameworks
/Python.framework
/Versions
/Current
/bin
/$f .
109 exec /Applicaitons/Python.app/Contents/MacOS/python $@
115 #-----------------------------------
116 msg Removing locally installed extension modules
118 msgdo
cd $dstPath/$temp/$sitePkgDir
120 if [ $f != README
]; then
124 for f
in Numeric numarray
; do
125 rm -r $dstPath/$temp/$pkgRoot/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/include
/python
$PYVER/$f
129 #-----------------------------------
130 msg making installer package
131 msgdo
cp -pR "$progDir/resourcesPython" "$dstPath/$temp/"
132 msgdo
mv "$dstPath/$temp/resourcesPython" "$dstPath/$temp/resources"
133 msgdo
cp $progDir/$pkgName.info
$progDir/$pkgName-$version.info
135 msgdo
"$makePkgExec" $dstPath/$temp/$pkgRoot $pkgName-$version.info
-d $dstPath/$temp/$dmgRoot -r $dstPath/$temp/resources
136 msgdo chown
-R ${user}:staff
$dstPath/$temp/$dmgRoot/$pkgName-$version.pkg
140 #-----------------------------------
141 msg making disk image
143 msgdo
"$makeDmgExec" $dstPath/$temp/$dmgRoot $dstPath/$temp $pkgName-$version
144 dmgName
="$pkgName-$version"
145 msgdo
mv "$dstPath/$temp/$pkgName-$version.dmg" "$dstPath/$dmgName.dmg"
146 msgdo chown
${user}:staff
"$dstPath/$dmgName.dmg"
150 #-----------------------------------
152 msgdo
rm $progDir/$pkgName-$version.info
153 msgdo
rm -rf "$dstPath/$temp"