This commit was manufactured by cvs2svn to create tag 'r234c1'.
[python/dscho.git] / Mac / OSX / Dist / build.panther
blobe97ea1cf56470ad56e1f6274b95d92742fdc4687
1 #!/bin/sh -e
2 #----------------------------------------------------------------------
3 # Build the MacPython 2.3 extensions for an installation to run
4 # on the pre-installed 2.3 framework build on OSX 10.3
6 # TODO: Parameterize the versions, builddirs, etc...
8 # Script configs
9 PYVERSION=2.3
10 PYVER=2.3
11 BUILDNUM=2
12 DOCLEANUP=no
14 PROGDIR="`dirname \"$0\"`"
15 case x$PROGDIR in
16 x|x.) PROGDIR=`pwd` ;;
17 x/*) ;;
18 *) echo "Please run with a full pathname"
19 exit 1
21 esac
23 if [ ! -e /usr/bin/python ]; then
24 echo "No /usr/bin/python; this script expects to be run on 10.3 only"
25 exit 1
28 TMPDIR=/tmp/_py
29 #TMPDIR=/projects/_py
31 INSTALLROOT=$TMPDIR/install
32 DMGDIR=$TMPDIR/dmg
33 RESOURCEDIR=$PROGDIR/resources.panther
34 DESTDIR=$TMPDIR/dist
35 PYTHONSRC=$PROGDIR/../../..
36 PYTHONOSXDIR=$PYTHONSRC/Mac/OSX
37 WASTEDIR=$PYTHONSRC/../waste
39 rm -rf $DMGDIR
40 if [ ! -e $TMPDIR ]; then
41 mkdir $TMPDIR
43 chgrp admin $TMPDIR
44 mkdir -p $DMGDIR/root
47 # Ask the user whether s/he has edited Welcome.txt
48 read -p "Have you updated $RESOURCEDIR/Welcome.txt (Y/n)? " welcome
50 if [ "$welcome" = "n" -o "$welcome" = "N" ]; then
51 echo "Please do so and retry"
52 exit
55 # Make the installation directories
56 mkdir -p $INSTALLROOT/Applications
57 mkdir -p $INSTALLROOT/Library/Python/$PYVER
59 # Make a temporary site-packages symlink
60 mkdir -p $INSTALLROOT/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/
61 ln -s $INSTALLROOT/Library/Python/$PYVER $INSTALLROOT/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages
63 pushd $PYTHONOSXDIR
65 make -f Makefile.panther DIRMODE=775 EXEMODE=775 FILEMODE=664 DESTDIR=$INSTALLROOT
67 # Remove the temporary symlink
68 rm -r $INSTALLROOT/System
70 # Unfortunately all the ...MODE arguments above still don't do the trick.
71 # Cop out, and recursively set everything group-writeable.
72 chmod -R ug+w $INSTALLROOT
74 popd
76 # Make the Installer package:
78 # Finally, build the package...
79 rm -rf MacPython-Panther.pkg
80 python $PYTHONSRC/Mac/scripts/buildpkg.py \
81 --Title=MacPython-Panther \
82 --Version=$PYVERSION-$BUILDNUM \
83 --Description="MacPython $PYVERSION tools and additions for Mac OS X 10.3" \
84 --NeedsAuthorization="YES" \
85 --Relocatable="NO" \
86 --InstallOnly="YES" \
87 --UseUserMask="NO" \
88 $INSTALLROOT \
89 $RESOURCEDIR
91 # --RootVolumeOnly="YES" \
93 # ...and then make a disk image containing the package.
94 mv MacPython-Panther.pkg $DMGDIR/root
95 cp $RESOURCEDIR/ReadMe.txt $DMGDIR/root/ReadMe.txt
96 $PROGDIR/makedmg $DMGDIR/root $DMGDIR MacPython-Panther-$PYVERSION-$BUILDNUM
98 echo Moving $DMGDIR/MacPython-Panther-$PYVERSION-$BUILDNUM to $DESTDIR
99 if [ ! -e $DESTDIR ]; then
100 mkdir $DESTDIR
102 mv $DMGDIR/MacPython-Panther-$PYVERSION-$BUILDNUM.dmg $DESTDIR
105 # Cleanup build/install dirs
106 if [ $DOCLEANUP = yes ]; then
107 echo "Cleaning up..."
108 rm -rf $INSTALLROOT
109 rm -rf $DMGDIR
110 else
111 echo "Cleanup is disabled. You should remove these dirs when done:"
112 echo " $INSTALLROOT"
113 echo " $DMGDIR"
115 echo "Your installer can be found in $DESTDIR"