2 #----------------------------------------------------------------------
3 # Create the unix tools and compile the .py files after Python has been
5 #----------------------------------------------------------------------
12 # Make sure things are group-writeable
15 # if destination is / then use usr/local/bin, otherwise just bin
16 if [ "$DEST" = "/" ]; then
17 TOOLDIR
=/usr
/local
/bin
23 # Make sure the dir exists
26 # Make some links to the python executable
27 ln -fsh $DEST/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/bin
/python
$TOOLDIR/python
$PYVER
28 ln -fsh python
$PYVER $TOOLDIR/python
31 # make the pythonw script
32 rm -f $TOOLDIR/pythonw
$PYVER
33 cat > $TOOLDIR/pythonw
$PYVER <<EOF
35 exec "$DEST/Library/Frameworks/Python.framework/Versions/$PYVER/Resources/Python.app/Contents/MacOS/Python" "\$@"
37 chmod +x
$TOOLDIR/pythonw
$PYVER
38 ln -fsh pythonw
$PYVER $TOOLDIR/pythonw
41 # Compile the .py files in the Python library to .pyc's and then .pyo's
42 $TOOLDIR/python
-Wi -tt \
43 $DEST/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/lib
/python
$PYVER/compileall.py \
44 -x badsyntax
-x site-packages
$DEST/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/lib
/python
$PYVER
46 $TOOLDIR/python
-Wi -tt -O \
47 $DEST/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/lib
/python
$PYVER/compileall.py \
48 -x badsyntax
-x site-packages
$DEST/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/lib
/python
$PYVER
50 $TOOLDIR/python
-Wi -tt \
51 $DEST/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/lib
/python
$PYVER/compileall.py \
52 $DEST/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/Mac
/Tools
54 $TOOLDIR/python
-Wi -tt -O \
55 $DEST/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/lib
/python
$PYVER/compileall.py \
56 $DEST/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/Mac
/Tools
59 # Make the site-packages and other dirs writable by the admin if destination is /
61 if [ "$DEST" = "/" ]; then
62 for d
in $DEST/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/lib
/python
$PYVER/site-packages \
63 $DEST/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/bin \
64 $DEST/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/Resources
/Python.app
/Contents
/Resources \
65 $DEST/Applications
/MacPython-
$PYVER; do
71 if [ "$DEST" != "/" ]; then
72 # The link in the app bundles and in pydoc need updating.
73 installed_python
=$DEST/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/Resources
/Python.app
/Contents
/MacOS
/python
74 for app
in BuildApplet IDLE PackageManager PythonIDE
; do
75 ln -fsh $installed_python \
76 $DEST/Applications
/MacPython-
$PYVER/$app.app
/Contents
/MacOS
77 ed
-s $DEST/Applications
/MacPython-
$PYVER/$app.app
/Contents
/MacOS
/$app << xyzzy
84 ed
-s $DEST/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/bin
/pydoc
<< xyzzy