diff options
author | Alastair Tse <liquidx@gentoo.org> | 2003-05-10 18:29:16 +0000 |
---|---|---|
committer | Alastair Tse <liquidx@gentoo.org> | 2003-05-10 18:29:16 +0000 |
commit | 2b633acec20e00f10209301758dda6455f7dfe8b (patch) | |
tree | 80e260f4bbaf068deaaff8f31b38b40f8901b043 /eclass | |
parent | New upstream version, plus PAM fixes (diff) | |
download | gentoo-2-2b633acec20e00f10209301758dda6455f7dfe8b.tar.gz gentoo-2-2b633acec20e00f10209301758dda6455f7dfe8b.tar.bz2 gentoo-2-2b633acec20e00f10209301758dda6455f7dfe8b.zip |
Add comments and tkinter function. also deprecating mydoc in favour of DOCS.
Both currently work.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/distutils.eclass | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/eclass/distutils.eclass b/eclass/distutils.eclass index a2a7d87b1864..d4591999e997 100644 --- a/eclass/distutils.eclass +++ b/eclass/distutils.eclass @@ -1,18 +1,27 @@ # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.11 2003/04/28 02:46:51 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.12 2003/05/10 18:29:16 liquidx Exp $ # # Author: Jon Nelson <jnelson@gentoo.org> +# Current Maintainer: Alastair Tse <liquidx@gentoo.org> # # The distutils eclass is designed to allow easier installation of # distutils-based python modules and their incorporation into # the Gentoo Linux system. +# +# - Features: +# distutils_src_compile() - does python setup.py build +# distutils_src_install() - does python setup.py install and install docs +# distutils_python_version() - sets PYVER/PYVER_MAJOR/PYVER_MINOR +# distutils_python_tkinter() - checks for tkinter support in python +# +# - Variables: +# PYTHON_SLOT_VERSION - for Zope support +# DOCS - additional DOCS ECLASS=distutils INHERITED="$INHERITED $ECLASS" -EXPORT_FUNCTIONS src_compile src_install - # This helps make it possible to add extensions to python slots. # Normally only a -py21- ebuild would set PYTHON_SLOT_VERSION. if [ "${PYTHON_SLOT_VERSION}" = 2.1 ] ; then @@ -29,9 +38,15 @@ distutils_src_compile() { distutils_src_install() { ${python} setup.py install --root=${D} ${@} || die + dodoc CHANGELOG COPYRIGHT KNOWN_BUGS MAINTAINERS dodoc CONTRIBUTORS LICENSE COPYING* - dodoc Change* MANIFEST* README* ${mydoc} + dodoc Change* MANIFEST* README* + + [ -n "${DOCS}" ] && dodoc ${DOCS} + + # deprecated! please use DOCS instead. + [ -n "${mydoc}" ] && dodoc ${mydoc} } # e.g. insinto ${ROOT}/usr/include/python${PYVER} @@ -42,7 +57,21 @@ distutils_python_version() tmpstr="${tmpstr#Python }" tmpstr=${tmpstr%.*} - PYVER_MAJOR="${tmpstr%.[0-9]*}" - PYVER_MINOR="${tmpstr#[0-9]*.}" - PYVER="${PYVER_MAJOR}.${PYVER_MINOR}" + export PYVER_MAJOR="${tmpstr%.[0-9]*}" + export PYVER_MINOR="${tmpstr#[0-9]*.}" + export PYVER="${PYVER_MAJOR}.${PYVER_MINOR}" +} + +# checks for if tkinter support is compiled into python +distutils_python_tkinter() { + if ! python -c "import Tkinter" >/dev/null 2>&1; then + eerror "You need to recompile python with Tkinter support." + eerror "That means: USE='tcltk' emerge python" + echo + die "missing tkinter support with installed python" + fi } + + +EXPORT_FUNCTIONS src_compile src_install + |