IGNOREPATH=/etc:/home:/var:/dev:/boot:/root:/tmp:/usr/local:/bin:/sbin:/mnt:/usr/src
STRIPLIB=y
STRIPBIN=y

VERSION=2.3.1
PROGNAME="Python $VERSION"
DESC="\
python (object-oriented interpreted programming language)              \n\
                                                                       \n\
Python is an interpreted, interactive, object-oriented programming     \n\
language that combines remarkable power with very clear syntax.        \n\
Python's basic power can be extended with your own modules written in  \n\
C or C++.  Python is also adaptable as an extension language for       \n\
existing applications."

BUILD=1
MAINTAINER="Mark Post <mark.post@eds.com>"
SOURCE=http://www.python.org/ftp/python/src
PKGNAME=python-$VERSION-s390-$BUILD
TAG=OPT

compile() {
   tar -yxvf $CWD/Python-$VERSION.tar.bz2
   cd Python-$VERSION/
   chown -R root.root .
   find . -type d -exec chmod 755 {} \;
   find . -type f -perm 775 -exec chmod 755 {} \;
   find . -type f -perm 664 -exec chmod 644 {} \;
   find . -type d -name CVS -exec rm -r {} \;
   # Pat says:
   # Normally I don't trust -O3, but it is the Python default so
   # I'll assume that in this case it has been well tested.
   ./configure --prefix=/usr \
               --with-ncurses \
               --with-threads
   make OPT=-O3
}

install() {
   mkdir -p /package-python/usr/doc/python-$VERSION
   cp -a README Misc /package-python/usr/doc/python-$VERSION
   ( cd /package-python/usr/doc/python-$VERSION ; mkdir html )
   ( cd /package-python/usr/doc/python-$VERSION/html ; tar -xvyf $CWD/html-$VERSION.tar.bz2 )

   make OPT=-O3 install DESTDIR=/package-python

   ( cd /package-python/usr/bin ; rm -rf python )
   ( cd /package-python/usr/bin ; ln -sf python2.3 python )
 
   ( cd /package-python/usr/man/man1
     rm -f *.gz
     gzip -9 *.1
   )
}

special() {
   cd $PKG
   mv package-python/* .
   rmdir package-python

   chown -R root.bin usr/bin/

   cd $CTL
   cat $CWD/slack-desc > slack-desc

   sed -e s'/package-python\///' doinst.sh > doinst.sh.new
   cat doinst.sh.new > doinst.sh
   rm doinst.sh.new
}

subpacks() {
   repack python-demo
   repack python-tools
}

