| 1 |
vapier |
1.5 |
# Copyright 1999-2003 Gentoo Technologies, Inc.
|
| 2 |
vapier |
1.4 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
liquidx |
1.10 |
# $Header: /home/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.9 2003/03/06 05:47:32 kutsuya Exp $
|
| 4 |
vapier |
1.5 |
#
|
| 5 |
jnelson |
1.1 |
# Author: Jon Nelson <jnelson@gentoo.org>
|
| 6 |
vapier |
1.5 |
#
|
| 7 |
jnelson |
1.1 |
# The distutils eclass is designed to allow easier installation of
|
| 8 |
|
|
# distutils-based python modules, and their incorporation into
|
| 9 |
|
|
# the Gentoo Linux system.
|
| 10 |
|
|
|
| 11 |
|
|
ECLASS=distutils
|
| 12 |
|
|
INHERITED="$INHERITED $ECLASS"
|
| 13 |
|
|
|
| 14 |
|
|
EXPORT_FUNCTIONS src_compile src_install
|
| 15 |
|
|
|
| 16 |
kutsuya |
1.6 |
# This helps make it possible to add extensions to python slots.
|
| 17 |
kutsuya |
1.9 |
# Normally only a -py21- ebuild would set PYTHON_SLOT_VERSION.
|
| 18 |
kutsuya |
1.6 |
if [ "${PYTHON_SLOT_VERSION}" = 2.1 ] ; then
|
| 19 |
kutsuya |
1.9 |
newdepend "=dev-lang/python-2.1*"
|
| 20 |
kutsuya |
1.6 |
python="python2.1"
|
| 21 |
|
|
else
|
| 22 |
vapier |
1.8 |
newdepend "virtual/python"
|
| 23 |
kutsuya |
1.6 |
python="python"
|
| 24 |
|
|
fi
|
| 25 |
jnelson |
1.1 |
|
| 26 |
|
|
distutils_src_compile() {
|
| 27 |
liquidx |
1.10 |
${python} setup.py build ${@} || die "compilation failed"
|
| 28 |
jnelson |
1.1 |
}
|
| 29 |
|
|
|
| 30 |
|
|
distutils_src_install() {
|
| 31 |
liquidx |
1.10 |
${python} setup.py install --root=${D} ${@} || die
|
| 32 |
jnelson |
1.3 |
dodoc CHANGELOG COPYRIGHT KNOWN_BUGS MAINTAINERS
|
| 33 |
jnelson |
1.1 |
dodoc CONTRIBUTORS LICENSE COPYING*
|
| 34 |
|
|
dodoc Change* MANIFEST* README* ${mydoc}
|
| 35 |
|
|
}
|
| 36 |
kutsuya |
1.6 |
|
| 37 |
|
|
# e.g. insinto ${ROOT}/usr/include/python${PYVER}
|
| 38 |
|
|
|
| 39 |
|
|
distutils_python_version()
|
| 40 |
|
|
{
|
| 41 |
|
|
local tmpstr="$(${python} -V 2>&1 )"
|
| 42 |
kutsuya |
1.7 |
tmpstr="${tmpstr#Python }"
|
| 43 |
|
|
tmpstr=${tmpstr%.*}
|
| 44 |
kutsuya |
1.6 |
|
| 45 |
|
|
PYVER_MAJOR="${tmpstr%.[0-9]*}"
|
| 46 |
|
|
PYVER_MINOR="${tmpstr#[0-9]*.}"
|
| 47 |
|
|
PYVER="${PYVER_MAJOR}.${PYVER_MINOR}"
|
| 48 |
vapier |
1.8 |
}
|