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