Lots of tweaks to make this work in the new setting. Not fully tested yet.

This commit is contained in:
Jack Jansen 2003-03-22 00:02:23 +00:00
parent 8806d47aff
commit 57c914c1aa
2 changed files with 44 additions and 33 deletions

View file

@ -11,6 +11,14 @@ BUILDNUM=3
DOCLEANUP=no
PROGDIR="`dirname \"$0\"`"
case x$PROGDIR in
x|x.) PROGDIR=`pwd` ;;
x/*) ;;
*) echo "Please run with a full pathname"
exit 1
;;
esac
TMPDIR=/tmp/_py
#TMPDIR=/projects/_py
@ -18,9 +26,9 @@ BUILDROOT=$TMPDIR/build
INSTALLROOT=$TMPDIR/install
DMGDIR=$TMPDIR/dmg
RESOURCEDIR=$PROGDIR/resources
DESTDIR=/projects/wx/wxPython/dist
PYTHONSRC=/projects/Python-$PYVERSION
WASTEDIR=/projects/waste
DESTDIR=$TMPDIR/dist
PYTHONSRC=$PROGDIR/../../..
WASTEDIR=$PYTHONSRC/../waste
# Setup
mkdir -p $BUILDROOT
@ -71,10 +79,11 @@ popd
# Make the Installer package:
# First, remove the unix tools as their paths will be wrong. We'll recreate
# them in the postinstall.
rm -r $INSTALLROOT/usr
rm -rf $INSTALLROOT/usr
# Next, remove the .pyc/.pyo files
python $PROGDIR/../zappycfiles.py $INSTALLROOT/Library/Frameworks/Python.framework/Versions/$PYVER/lib/python$PYVER
python $PYTHONSRC/Mac/scripts/zappycfiles.py $INSTALLROOT/Library/Frameworks/Python.framework/Versions/$PYVER/lib/python$PYVER
python $PYTHONSRC/Mac/scripts/zappycfiles.py $INSTALLROOT/Library/Frameworks/Python.framework/Versions/$PYVER/Mac/Tools
# Make the welcome message
cat > $RESOURCEDIR/Welcome.txt <<EOF
@ -86,15 +95,9 @@ Build number: $BUILDNUM
Build date: `date`
EOF
# fix a bug in the IDLE install
IDLERES=$INSTALLROOT/Applications/MacPython-2.3/IDLE.app/Contents/Resources
mv $IDLERES/idlelib/idle $IDLERES
# Finally, build the package...
rm -rf MacPython-OSX.pkg
python $PROGDIR/../buildpkg.py \
python $PYTHONSRC/Mac/scripts/buildpkg.py \
--Title=MacPython-OSX \
--Version=$PYVERSION-$BUILDNUM \
--Description="Python $PYVERSION for Mac OS X, framework based" \
@ -108,7 +111,7 @@ python $PROGDIR/../buildpkg.py \
# ...and then make a disk image containing the package.
mv MacPython-OSX.pkg $DMGDIR/root
$PROGDIR/../makedmg $DMGDIR/root $DMGDIR MacPython-OSX-$PYVERSION-$BUILDNUM
$PROGDIR/makedmg $DMGDIR/root $DMGDIR MacPython-OSX-$PYVERSION-$BUILDNUM
echo Moving $DMGDIR/MacPython-OSX-$PYVERSION-$BUILDNUM to $DESTDIR
mv $DMGDIR/MacPython-OSX-$PYVERSION-$BUILDNUM.dmg $DESTDIR
@ -126,4 +129,5 @@ else
echo " $INSTALLROOT"
echo " $DMGDIR"
fi
echo "Your installer can be found in $DESTDIR"

View file

@ -22,23 +22,18 @@ fi
mkdir -p $TOOLDIR
# Make some links to the python executable
if [ -e $TOOLDIR/python$PYVER ]; then
rm $TOOLDIR/python$PYVER
fi
ln -fs $DEST/Library/Frameworks/Python.framework/Versions/$PYVER/bin/python $TOOLDIR/python$PYVER
if [ -e $TOOLDIR/python ]; then
rm $TOOLDIR/python
fi
ln -fs python$PYVER $TOOLDIR/python
ln -fsh $DEST/Library/Frameworks/Python.framework/Versions/$PYVER/bin/python $TOOLDIR/python$PYVER
ln -fsh python$PYVER $TOOLDIR/python
# make the pythonw script
cat > $TOOLDIR/pythonw <<EOF
rm -f $TOOLDIR/pythonw$PYVER
cat > $TOOLDIR/pythonw$PYVER <<EOF
#!/bin/sh
exec "$DEST/Library/Frameworks/Python.framework/Versions/$PYVER/Resources/Python.app/Contents/MacOS/python" "\$@"
EOF
chmod +x $TOOLDIR/pythonw
chmod +x $TOOLDIR/pythonw$PYVER
ln -fsh pythonw$PYVER $TOOLDIR/pythonw
# Compile the .py files in the Python library to .pyc's and then .pyo's
@ -48,20 +43,32 @@ $TOOLDIR/python -Wi -tt \
$TOOLDIR/python -Wi -tt -O \
$DEST/Library/Frameworks/Python.framework/Versions/$PYVER/lib/python$PYVER/compileall.py \
-x badsyntax -x site-packages $DEST/Library/Frameworks/Python.framework/Versions/$PYVER/lib/python$PYVER
-x badsyntax -x site-packages $DEST/Library/Frameworks/Python.framework/Versions/$PYVER/lib/python$PYVER
$TOOLDIR/python -Wi -tt \
$DEST/Library/Frameworks/Python.framework/Versions/$PYVER/lib/python$PYVER/compileall.py \
$DEST/Library/Frameworks/Python.framework/Versions/$PYVER/Mac/Tools
$TOOLDIR/python -Wi -tt -O \
$DEST/Library/Frameworks/Python.framework/Versions/$PYVER/lib/python$PYVER/compileall.py \
$DEST/Library/Frameworks/Python.framework/Versions/$PYVER/Mac/Tools
# Make the site-packages and other dirs writable by the admin.
for d in $DEST/Library/Frameworks/Python.framework/Versions/$PYVER/lib/python$PYVER/site-packages \
$DEST/Library/Frameworks/Python.framework/Versions/$PYVER/bin \
$DEST/Applications/MacPython-$PYVER; do
chgrp -R admin $d
chmod -R g+w $d
done
# Make the site-packages and other dirs writable by the admin if destination is /
if [ "$DEST" = "/" ]; then
for d in $DEST/Library/Frameworks/Python.framework/Versions/$PYVER/lib/python$PYVER/site-packages \
$DEST/Library/Frameworks/Python.framework/Versions/$PYVER/bin \
$DEST/Library/Frameworks/Python.framework/Versions/$PYVER/Resources/Python.app/Contents/Resources \
$DEST/Applications/MacPython-$PYVER; do
chgrp -R admin $d
chmod -R g+w $d
done
fi
# The link in the app bundles needs updated.
for app in BuildApplet IDLE PackageManager PythonIDE; do
ln -s $DEST/Library/Frameworks/Python.framework/Versions/$PYVER/Resources/Python.app/Contents/MacOS/python \
ln -fsh $DEST/Library/Frameworks/Python.framework/Versions/$PYVER/Resources/Python.app/Contents/MacOS/python \
$DEST/Applications/MacPython-$PYVER/$app.app/Contents/MacOS
done