2 #----------------------------------------------------------------------
3 # Build MacPython 2.3 and make an Installer package of it
5 # TODO: Parameterize the versions, builddirs, etc...
13 PROGDIR
="`dirname \"$0\"`"
15 x|x.
) PROGDIR
=`pwd` ;;
17 *) echo "Please run with a full pathname"
25 BUILDROOT
=$TMPDIR/build
26 INSTALLROOT
=$TMPDIR/install
28 RESOURCEDIR
=$PROGDIR/resources
30 PYTHONSRC
=$PROGDIR/..
/..
/..
31 WASTEDIR
=$PYTHONSRC/..
/waste
40 # Configure and build Python
43 # Ask the user whether s/he has edited Welcome.txt
44 read -p "Have you updated $RESOURCEDIR/Welcome.txt (Y/n)? " welcome
46 if [ "$welcome" = "n" -o "$welcome" = "N" ]; then
47 echo "Please do so and retry"
51 # Check if we should build and install the docs, but only if it
52 # doesn't appear to be done already. TODO: fix this path to be version independent
53 if [ ! -e "build/temp.darwin-6.3-Power Macintosh-2.3/build-html/build-html idx" ]; then
54 read -p "Build the Python docs? (y/N)? " builddocs
57 # If the filesystem is case-sensitive then "python" will be built, but
58 # some parts of the install expect "python.exe which is what is built
59 # on a case-insensitive filesystem. Make a link just in case it is
61 if [ ! -e python.exe
]; then
62 ln -s python python.exe
65 # Make a link to the waste dir so that lib can be found. This allows
66 # the PythonIDE to be built
67 if [ ! -e waste
]; then
71 $PYTHONSRC/configure
--enable-framework=$INSTALLROOT/Library
/Frameworks LDFLAGS
=-Wl,-x
73 make DIRMODE
=775 EXEMODE
=775 FILEMODE
=664 frameworkinstall
75 if [ "$builddocs" = "y" -o "$builddocs" = "Y" ]; then
76 .
/python.exe
$PYTHONSRC/Mac
/OSX
/setupDocs.py build
78 read -p "When the help indexer is done press Enter..." ans
79 .
/python.exe
$PYTHONSRC/Mac
/OSX
/setupDocs.py
install \
80 --prefix=$INSTALLROOT/Library
/Frameworks
/Python.framework
/Versions
/$PYVER
87 # Make the Installer package:
88 # First, remove the unix tools as their paths will be wrong. We'll recreate
89 # them in the postinstall.
90 rm -rf $INSTALLROOT/usr
92 # Next, remove the .pyc/.pyo files
93 python
$PYTHONSRC/Mac
/scripts
/zappycfiles.py
$INSTALLROOT/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/lib
/python
$PYVER
94 python
$PYTHONSRC/Mac
/scripts
/zappycfiles.py
$INSTALLROOT/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/Mac
/Tools
96 # Finally, build the package...
97 rm -rf MacPython-OSX.pkg
98 python
$PYTHONSRC/Mac
/scripts
/buildpkg.py \
99 --Title=MacPython-OSX \
100 --Version=$PYVERSION-$BUILDNUM \
101 --Description="Python $PYVERSION for Mac OS X, framework based" \
102 --NeedsAuthorization="YES" \
104 --InstallOnly="YES" \
108 ## --RootVolumeOnly="YES" \
110 # ...and then make a disk image containing the package.
111 mv MacPython-OSX.pkg
$DMGDIR/root
112 cp $RESOURCEDIR/Welcome.txt
$DMGDIR/root
/README.txt
113 $PROGDIR/makedmg
$DMGDIR/root
$DMGDIR MacPython-OSX-
$PYVERSION-$BUILDNUM
115 echo Moving
$DMGDIR/MacPython-OSX-
$PYVERSION-$BUILDNUM to
$DESTDIR
116 if [ ! -e $DESTDIR ]; then
119 mv $DMGDIR/MacPython-OSX-
$PYVERSION-$BUILDNUM.dmg
$DESTDIR
122 # Cleanup build/install dirs
123 if [ $DOCLEANUP = yes ]; then
124 echo "Cleaning up..."
129 echo "Cleanup is disabled. You should remove these dirs when done:"
134 echo "Your installer can be found in $DESTDIR"