# $Id: python-2.6.3-r2.smage2 3627 2009-10-27 15:43:35Z niro $ PNAME="python" PVER="2.7.0" PBUILD="r3" PCATEGORIE="dev-lang" STATE="unstable" DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language." HOMEPAGE="http://www.python.org/" DEPEND=">= virtual/glibc >= sys-libs/ncurses-5.7 >= sys-libs/zlib-1.2 >= dev-libs/expat-2 >= dev-libs/openssl-1.0.0 >= sys-libs/readline-6.1 >= dev-db/sqlite-3.7" SDEPEND=">= sys-apps/sed-4" SRCFILE="${PNAME/py/Py}-${PVER/.0}.tar.bz2" SRCDIR="${BUILDDIR}/${PNAME/py/Py}-${PVER/.0}" # disabled modules (needs the gentoo_py_dontcompile patch) export PYTHON_DISABLE_MODULES="gdbm dbm bsddb _tkinter" || die # force usage of our CFLAGS export OPT="${CFLAGS}" sminclude mtools # uses PYVER and sometimes PVER; so keep both SRC_URI=( http://www.python.org/ftp/python/${PVER%.*}/${SRCFILE} http://www.python.org/ftp/python/${PVER}/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/${PNAME}-2.7.0-gentoo_py_dontcompile.patch mirror://${PNAME}/${PNAME}-2.4-disable_modules_and_ssl.patch mirror://${PNAME}/${PNAME}-2.5.0-mimetypes-apache.patch mirror://${PNAME}/${PNAME}-2.7.0-lib64-3.patch ) # sed line: on 2 digits add an zero: 2.6 -> 2.6.0 UP2DATE="updatecmd ${HOMEPAGE}/download/releases/ | grep 'Python .*(.*)' | sed 's/.*Python\ \([0-9].*\) (.*/\1/g;s/\([0-9]\.[0-9]\$\)/\1.0/;q'" src_prepare() { munpack ${SRCFILE} || die cd ${SRCDIR} # adds support for PYTHON_DONTCOMPILE shell environment to # supress automatic generation of .pyc and .pyo files mpatch ${PNAME}-2.7.0-gentoo_py_dontcompile.patch || die mpatch ${PNAME}-2.4-disable_modules_and_ssl.patch || die mpatch ${PNAME}-2.5.0-mimetypes-apache.patch || die if [[ $(mlibdir) = lib64 ]] then mpatch ${PNAME}-2.7.0-lib64-3.patch || die fi } src_compile() { cd ${SRCDIR} mconfigure \ --with-fpectl \ --enable-shared \ --infodir='${prefix}'/share/info \ --mandir='${prefix}'/share/man \ --with-threads || die mmake || die } src_install() { cd ${SRCDIR} # install some missing directories minstalldir /usr || die mmake DESTDIR=${BINDIR} altinstall || die # link python${PVER%.*}-config to python-config mlink python${PVER%.*}-config /usr/bin/python-config || die minstalldir /usr/$(mlibdir)/python${PVER%.*}/config || die minstallfile ${SRCDIR}/Makefile.pre.in /usr/$(mlibdir)/python${PVER%.*}/config || die # remove hardcoded CFLAGS from default Makefile sed -i 's:^OPT=.*:OPT=-DNDEBUG:' ${BINDIR}/usr/$(mlibdir)/python${PVER%.*}/config/Makefile || die # link python2.7 binary with python mlink python${PVER%.*} /usr/bin/python || die # link python2.7 binary with python2 mlink python${PVER%.*} /usr/bin/python2 || die minstalldocs LICENSE README || die }