| 1 | # Copyright 1999-2004 Gentoo Foundation |
1 | # Copyright 1999-2004 Gentoo Foundation |
| 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.44 2007/10/25 13:49:10 hawking Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.45 2008/01/23 22:19:04 hawking Exp $ |
| 4 | # |
4 | # |
| 5 | # Author: Jon Nelson <jnelson@gentoo.org> |
5 | # Author: Jon Nelson <jnelson@gentoo.org> |
| 6 | # Current Maintainer: Alastair Tse <liquidx@gentoo.org> |
6 | # Current Maintainer: Alastair Tse <liquidx@gentoo.org> |
| 7 | # |
7 | # |
| 8 | # The distutils eclass is designed to allow easier installation of |
8 | # The distutils eclass is designed to allow easier installation of |
| … | |
… | |
| 97 | # installs things in another directory |
97 | # installs things in another directory |
| 98 | |
98 | |
| 99 | distutils_pkg_postinst() { |
99 | distutils_pkg_postinst() { |
| 100 | PYTHON_MODNAME=${PYTHON_MODNAME:-${PN}} |
100 | PYTHON_MODNAME=${PYTHON_MODNAME:-${PN}} |
| 101 | |
101 | |
|
|
102 | # strip trailing slash |
|
|
103 | myroot="${ROOT%/}" |
|
|
104 | |
| 102 | if has_version ">=dev-lang/python-2.3"; then |
105 | if has_version ">=dev-lang/python-2.3"; then |
| 103 | python_version |
106 | python_version |
| 104 | for pymod in ${PYTHON_MODNAME}; do |
107 | for pymod in ${PYTHON_MODNAME}; do |
| 105 | if [ -d "${ROOT}usr/$(get_libdir)/python${PYVER}/site-packages/${pymod}" ]; then |
108 | if [ -d "${myroot}/usr/$(get_libdir)/python${PYVER}/site-packages/${pymod}" ]; then |
| 106 | python_mod_optimize ${ROOT}usr/$(get_libdir)/python${PYVER}/site-packages/${pymod} |
109 | python_mod_optimize ${myroot}/usr/$(get_libdir)/python${PYVER}/site-packages/${pymod} |
| 107 | fi |
110 | fi |
| 108 | done |
111 | done |
| 109 | fi |
112 | fi |
| 110 | } |
113 | } |
| 111 | |
114 | |