| 1 | # Copyright 2005 Gentoo Foundation |
1 | # Copyright 2005 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License, v2 or later |
2 | # Distributed under the terms of the GNU General Public License, v2 or later |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/twisted.eclass,v 1.4 2006/04/09 23:18:36 marienz Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/twisted.eclass,v 1.5 2006/05/16 16:52:49 marienz Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: Marien Zwart <marienz@gentoo.org> |
5 | # Author: Marien Zwart <marienz@gentoo.org> |
| 6 | # |
6 | # |
| 7 | # eclass to aid installing and testing twisted packages. |
7 | # eclass to aid installing and testing twisted packages. |
| 8 | # |
8 | # |
| 9 | # you should set MY_PACKAGE to something like 'Names' before inheriting. |
9 | # you should set MY_PACKAGE to something like 'Names' before inheriting. |
| 10 | # you may set MY_PV to the right version (defaults to PV). |
10 | # you may set MY_PV to the right version (defaults to PV). |
| 11 | |
11 | |
| 12 | inherit distutils versionator |
12 | inherit distutils versionator eutils |
| 13 | |
13 | |
| 14 | MY_PV=${MY_PV:-${PV}} |
14 | MY_PV=${MY_PV:-${PV}} |
| 15 | MY_VERSION=$(get_version_component_range 1-2 ${MY_PV}) |
15 | MY_VERSION=$(get_version_component_range 1-2 ${MY_PV}) |
| 16 | MY_P=Twisted${MY_PACKAGE}-${MY_PV} |
16 | MY_P=Twisted${MY_PACKAGE}-${MY_PV} |
| 17 | |
17 | |
| … | |
… | |
| 28 | twisted_src_test() { |
28 | twisted_src_test() { |
| 29 | python_version |
29 | python_version |
| 30 | # This is a hack to make tests work without installing to the live |
30 | # This is a hack to make tests work without installing to the live |
| 31 | # filesystem. We copy the twisted site-packages to a temporary |
31 | # filesystem. We copy the twisted site-packages to a temporary |
| 32 | # dir, install there, and run from there. |
32 | # dir, install there, and run from there. |
| 33 | local spath="usr/lib/python${PYVER}/site-packages/" |
33 | local spath="usr/$(get_libdir)/python${PYVER}/site-packages/" |
| 34 | mkdir -p "${T}/${spath}" |
34 | mkdir -p "${T}/${spath}" |
| 35 | cp -R "${ROOT}${spath}/twisted" "${T}/${spath}" || die |
35 | cp -R "${ROOT}${spath}/twisted" "${T}/${spath}" || die |
| 36 | if has_version ">=dev-lang/python-2.3"; then |
36 | if has_version ">=dev-lang/python-2.3"; then |
| 37 | ${python} setup.py install --root="${T}" --no-compile --force || die |
37 | "${python}" setup.py install --root="${T}" --no-compile --force \ |
|
|
38 | --install-lib="${spath}" || die |
| 38 | else |
39 | else |
| 39 | ${python} setup.py install --root="${T}" --force || die |
40 | "${python}" setup.py install --root="${T}" --force \ |
|
|
41 | --install-lib="${spath}" || die |
| 40 | fi |
42 | fi |
| 41 | cd "${T}/${spath}" || die |
43 | cd "${T}/${spath}" || die |
| 42 | local trialopts |
44 | local trialopts |
| 43 | if ! has_version ">=dev-python/twisted-2.2"; then |
45 | if ! has_version ">=dev-python/twisted-2.2"; then |
| 44 | trialopts=-R |
46 | trialopts=-R |
| … | |
… | |
| 48 | cd "${S}" |
50 | cd "${S}" |
| 49 | rm -rf "${T}/${spath}" |
51 | rm -rf "${T}/${spath}" |
| 50 | } |
52 | } |
| 51 | |
53 | |
| 52 | twisted_src_install() { |
54 | twisted_src_install() { |
|
|
55 | python_version |
|
|
56 | # The explicit --install-lib here and in src_test is needed to |
|
|
57 | # make everything (core and all subpackages) go into lib64 on |
|
|
58 | # amd64. Without it pure python subpackages install into lib while |
|
|
59 | # stuff with c extensions goes into lib64. |
| 53 | distutils_src_install |
60 | distutils_src_install \ |
|
|
61 | --install-lib="usr/$(get_libdir)/python${PYVER}/site-packages/" |
| 54 | |
62 | |
| 55 | if [[ -d doc/man ]]; then |
63 | if [[ -d doc/man ]]; then |
| 56 | doman doc/man/* |
64 | doman doc/man/* |
| 57 | fi |
65 | fi |
| 58 | |
66 | |