2 #----------------------------------------------------------------------
3 # Create the unix tools and compile the .py files after Python has been
5 #----------------------------------------------------------------------
13 # if destination is / then use usr/local/bin, otherwise just bin
14 if [ "$DEST" = "/" ]; then
15 TOOLDIR
=/usr
/local
/bin
21 # Make sure the dir exists
24 # Make some links to the python executable
25 if [ -e $TOOLDIR/python
$PYVER ]; then
26 rm $TOOLDIR/python
$PYVER
28 ln -fs $DEST/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/bin
/python
$TOOLDIR/python
$PYVER
30 if [ -e $TOOLDIR/python
]; then
33 ln -fs python
$PYVER $TOOLDIR/python
36 # make the pythonw script
37 cat > $TOOLDIR/pythonw
<<EOF
39 exec "$DEST/Library/Frameworks/Python.framework/Versions/$PYVER/Resources/Python.app/Contents/MacOS/python" "\$@"
41 chmod +x
$TOOLDIR/pythonw
44 # Compile the .py files in the Python library to .pyc's and then .pyo's
45 $TOOLDIR/python
-Wi -tt \
46 $DEST/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/lib
/python
$PYVER/compileall.py \
47 -x badsyntax
-x site
-packages $DEST/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/lib
/python
$PYVER
49 $TOOLDIR/python
-Wi -tt -O \
50 $DEST/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/lib
/python
$PYVER/compileall.py \
51 -x badsyntax
-x site
-packages $DEST/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/lib
/python
$PYVER
54 # Make the site-packages and other dirs writable by the admin.
55 for d
in $DEST/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/lib
/python
$PYVER/site
-packages \
56 $DEST/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/bin \
57 $DEST/Applications
/MacPython
-$PYVER; do
63 # The link in the app bundles needs updated.
64 for app
in BuildApplet IDLE PackageManager PythonIDE
; do
65 ln -s $DEST/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/Resources
/Python.app
/Contents
/MacOS
/python \
66 $DEST/Applications
/MacPython
-$PYVER/$app.app
/Contents
/MacOS