2011-12-06 11:42:37 +01:00
|
|
|
#!/bin/bash
|
2011-12-05 10:44:07 +01:00
|
|
|
|
2012-03-08 20:45:55 +01:00
|
|
|
. $(dirname $0)/environment.sh
|
2011-12-06 15:33:48 +01:00
|
|
|
|
2012-03-11 01:54:06 +01:00
|
|
|
if [ -f $BUILDROOT/python/lib/python27.zip ]; then
|
|
|
|
echo "Python already reduced and compressed."
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Starting reducing python 2.7"
|
2011-12-05 10:44:07 +01:00
|
|
|
|
2012-03-11 17:22:45 +01:00
|
|
|
try rm -rf $BUILDROOT/python/embed/include/python2.7
|
|
|
|
try mkdir -p $BUILDROOT/python/embed/include/python2.7
|
|
|
|
try cp $BUILDROOT/python/include/python2.7/pyconfig.h $BUILDROOT/python/embed/include/python2.7/pyconfig.h
|
|
|
|
|
2011-12-06 18:06:34 +01:00
|
|
|
try cd $BUILDROOT/python/lib/python2.7
|
2011-12-05 10:44:07 +01:00
|
|
|
find . -iname '*.pyc' | xargs rm
|
|
|
|
find . -iname '*.py' | xargs rm
|
2011-12-06 18:06:34 +01:00
|
|
|
find . -iname 'test*' | xargs rm -rf
|
|
|
|
rm -rf *test* lib* wsgiref bsddb curses idlelib hotshot || true
|
|
|
|
try cd ..
|
2011-12-06 10:49:14 +01:00
|
|
|
rm -rf pkgconfig || true
|
2012-03-11 01:54:06 +01:00
|
|
|
|
|
|
|
echo "Compressing to python27.zip"
|
|
|
|
try pushd $BUILDROOT/python/lib/python2.7
|
|
|
|
rm config/libpython2.7.a config/python.o config/config.c.in config/makesetup
|
|
|
|
mv config ..
|
|
|
|
mv site-packages ..
|
|
|
|
zip -r ../python27.zip *
|
|
|
|
rm -rf *
|
|
|
|
mv ../config .
|
|
|
|
mv ../site-packages .
|
|
|
|
popd
|