_make_boundary(): Fix for SF bug #745478, broken boundary calculation
[python/dscho.git] / Mac / OSX / Dist / build
blob809f8ff49c77dad9d1c15d6c3369927541868800
1 #!/bin/sh -e
2 #----------------------------------------------------------------------
3 # Build MacPython 2.3 and make an Installer package of it
5 # TODO: Parameterize the versions, builddirs, etc...
7 # Script configs
8 PYVERSION=2.3b1
9 PYVER=2.3
10 BUILDNUM=1
11 DOCLEANUP=no
13 PROGDIR="`dirname \"$0\"`"
14 case x$PROGDIR in
15 x|x.) PROGDIR=`pwd` ;;
16 x/*) ;;
17 *) echo "Please run with a full pathname"
18 exit 1
20 esac
22 TMPDIR=/tmp/_py
23 #TMPDIR=/projects/_py
25 BUILDROOT=$TMPDIR/build
26 INSTALLROOT=$TMPDIR/install
27 DMGDIR=$TMPDIR/dmg
28 RESOURCEDIR=$PROGDIR/resources
29 DESTDIR=$TMPDIR/dist
30 PYTHONSRC=$PROGDIR/../../..
31 WASTEDIR=$PYTHONSRC/../waste
33 # Setup
34 mkdir -p $BUILDROOT
35 mkdir -p $INSTALLROOT
36 rm -rf $DMGDIR
37 mkdir -p $DMGDIR/root
40 # Configure and build Python
41 pushd $BUILDROOT
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"
48 exit
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
60 # needed.
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
68 ln -s $WASTEDIR waste
71 $PYTHONSRC/configure --enable-framework=$INSTALLROOT/Library/Frameworks LDFLAGS=-Wl,-x
72 make
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
77 echo ""
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
83 popd
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" \
103 --Relocatable="NO" \
104 --InstallOnly="YES" \
105 $INSTALLROOT \
106 $RESOURCEDIR
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
117 mkdir $DESTDIR
119 mv $DMGDIR/MacPython-OSX-$PYVERSION-$BUILDNUM.dmg $DESTDIR
122 # Cleanup build/install dirs
123 if [ $DOCLEANUP = yes ]; then
124 echo "Cleaning up..."
125 rm -rf $BUILDROOT
126 rm -rf $INSTALLROOT
127 rm -rf $DMGDIR
128 else
129 echo "Cleanup is disabled. You should remove these dirs when done:"
130 echo " $BUILDROOT"
131 echo " $INSTALLROOT"
132 echo " $DMGDIR"
134 echo "Your installer can be found in $DESTDIR"