--- smage/trunk/include/python.sminc 2011/08/29 20:03:18 2792 +++ smage/trunk/include/python.sminc 2012/07/09 17:43:13 3578 @@ -1,4 +1,4 @@ -# $Header: /magellan-cvs/smage/include/python.sminc,v 1.4 2007/01/23 20:46:41 niro Exp $ +# $Id$ # get the major.minor current installed python version # -> ex 2.4 @@ -14,42 +14,71 @@ get_python_libdir() { local pylib - pylib=$(python -c 'from distutils import sysconfig; print sysconfig.get_python_version()') + pylib=$(python -c 'from distutils import sysconfig; print sysconfig.get_python_lib()') echo "${pylib}" return 0 } +get_python_includedir() +{ + local pyinc + pyinc=$(python -c 'from distutils import sysconfig; print sysconfig.get_python_inc()') + echo "${pyinc}" + return 0 +} + python_src_prepare() { munpack ${SRCFILE} || die } -python_src_compile() +python_docompile() { - cd ${SRCDIR} - if [[ -e setup.py ]] then - python setup.py build "$@" || die + python setup.py build $@ || die + elif [[ -e waf ]] + then + python waf configure --prefix=/usr --libdir=/usr/$(mlibdir) $@ || die + python waf build $@ || die elif [[ -e configure ]] then - mconfigure "$@" || die + mconfigure $@ || die mmake || die + elif [[ -e install.py ]] + then + echo "install.py found - nothing to compile here." else mmake || die fi } -python_src_install() +python_doinstall() { - cd ${SRCDIR} - if [[ -e setup.py ]] then - python setup.py install --no-compile --root ${BINDIR} "$@" || die + python setup.py install --no-compile --root ${BINDIR} $@ || die + elif [[ -e waf ]] + then + python waf install --destdir=${BINDIR} $@ || die + elif [[ -e install.py ]] + then + python install.py --prefix=/usr --files-only --destdir=${BINDIR} $@ || die else mmake DESTDIR=${BINDIR} install || die fi +} + +python_src_compile() +{ + cd ${SRCDIR} + python_docompile || die +} + +python_src_install() +{ + cd ${SRCDIR} + python_doinstall || die local i for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \