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 INSTALLROOT
=$TMPDIR/install
27 RESOURCEDIR
=$PROGDIR/resources
29 PYTHONSRC
=$PROGDIR/..
/..
/..
30 WASTEDIR
=$PYTHONSRC/..
/waste
34 BUILDROOT
=$TMPDIR/build
42 if [ -e $BUILDROOT ]; then
43 echo Using existing build directory
$BUILDROOT
46 echo Creating clean build directory
$BUILDROOT
51 if [ ! -e $TMPDIR ]; then
58 # Configure and build Python
61 # Ask the user whether s/he has edited Welcome.txt
62 read -p "Have you updated $RESOURCEDIR/Welcome.txt (Y/n)? " welcome
64 if [ "$welcome" = "n" -o "$welcome" = "N" ]; then
65 echo "Please do so and retry"
69 # Check if we should build and install the docs, but only if it
70 # doesn't appear to be done already. TODO: fix this path to be version independent
71 if [ ! -e "build/temp.darwin-6.3-Power Macintosh-2.3/build-html/build-html idx" ]; then
72 read -p "Build the Python docs? (y/N)? " builddocs
75 # If the filesystem is case-sensitive then "python" will be built, but
76 # some parts of the install expect "python.exe which is what is built
77 # on a case-insensitive filesystem. Make a link just in case it is
79 if [ ! -e python.exe
]; then
80 ln -s python python.exe
83 # Make a link to the waste dir so that lib can be found. This allows
84 # the PythonIDE to be built
85 if [ ! -e waste
]; then
89 $PYTHONSRC/configure
-C --enable-framework LDFLAGS
=-Wl,-x
91 make DIRMODE
=775 EXEMODE
=775 FILEMODE
=664 DESTDIR
=$INSTALLROOT frameworkinstall
92 make DIRMODE
=775 EXEMODE
=775 FILEMODE
=664 DESTDIR
=$INSTALLROOT frameworkinstallextras
94 # Unfortunately all the ...MODE arguments above still don't do the trick.
95 # Cop out, and recursively set everything group-writeable.
96 chmod -R ug
+w
$INSTALLROOT
98 if [ "$builddocs" = "y" -o "$builddocs" = "Y" ]; then
99 .
/python.exe
$PYTHONSRC/Mac
/OSX
/setupDocs.py build
101 read -p "When the help indexer is done press Enter..." ans
102 .
/python.exe
$PYTHONSRC/Mac
/OSX
/setupDocs.py
install \
103 --prefix=$INSTALLROOT/Library
/Frameworks
/Python.framework
/Versions
/$PYVER
110 # Make the Installer package:
111 # First, remove the unix tools as their paths will be wrong. We'll recreate
112 # them in the postinstall.
113 rm -rf $INSTALLROOT/usr
115 # Next, remove the .pyc/.pyo files
116 python
$PYTHONSRC/Mac
/scripts
/zappycfiles.py
$INSTALLROOT/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/lib
/python
$PYVER
117 python
$PYTHONSRC/Mac
/scripts
/zappycfiles.py
$INSTALLROOT/Library
/Frameworks
/Python.framework
/Versions
/$PYVER/Mac
/Tools
119 # Finally, build the package...
120 rm -rf MacPython-OSX.pkg
121 python
$PYTHONSRC/Mac
/scripts
/buildpkg.py \
122 --Title=MacPython-OSX \
123 --Version=$PYVERSION-$BUILDNUM \
124 --Description="Python $PYVERSION for Mac OS X, framework based" \
125 --NeedsAuthorization="YES" \
127 --InstallOnly="YES" \
132 # --RootVolumeOnly="YES" \
134 # ...and then make a disk image containing the package.
135 mv MacPython-OSX.pkg
$DMGDIR/root
136 cp $RESOURCEDIR/ReadMe.txt
$DMGDIR/root
/ReadMe.txt
137 $PROGDIR/makedmg
$DMGDIR/root
$DMGDIR MacPython-OSX-
$PYVERSION-$BUILDNUM
139 echo Moving
$DMGDIR/MacPython-OSX-
$PYVERSION-$BUILDNUM to
$DESTDIR
140 if [ ! -e $DESTDIR ]; then
143 mv $DMGDIR/MacPython-OSX-
$PYVERSION-$BUILDNUM.dmg
$DESTDIR
146 # Cleanup build/install dirs
147 if [ $DOCLEANUP = yes ]; then
148 echo "Cleaning up..."
149 if [ $CLEANBUILD = yes ]; then
155 echo "Cleanup is disabled. You should remove these dirs when done:"
156 if [ $CLEANBUILD = yes ]; then
162 echo "Your installer can be found in $DESTDIR"