/[gentoo-x86]/eclass/distutils.eclass
Gentoo

Diff of /eclass/distutils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.52 Revision 1.54
1# Copyright 1999-2008 Gentoo Foundation 1# Copyright 1999-2008 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.52 2008/09/24 16:45:08 hawking Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.54 2008/10/28 21:29:28 hawking Exp $
4 4
5# @ECLASS: distutils.eclass 5# @ECLASS: distutils.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# <python@gentoo.org> 7# <python@gentoo.org>
8# 8#
61# The distutils src_install function, this function is exported. 61# The distutils src_install function, this function is exported.
62# It also installs the "standard docs" (CHANGELOG, Change*, KNOWN_BUGS, MAINTAINERS, 62# It also installs the "standard docs" (CHANGELOG, Change*, KNOWN_BUGS, MAINTAINERS,
63# PKG-INFO, CONTRIBUTORS, TODO, NEWS, MANIFEST*, README*, and AUTHORS) 63# PKG-INFO, CONTRIBUTORS, TODO, NEWS, MANIFEST*, README*, and AUTHORS)
64distutils_src_install() { 64distutils_src_install() {
65 65
66 # Mark the package to be rebuilt after a python upgrade.
67 python_need_rebuild
68
66 # need this for python-2.5 + setuptools in cases where 69 # need this for python-2.5 + setuptools in cases where
67 # a package uses distutils but does not install anything 70 # a package uses distutils but does not install anything
68 # in site-packages. (eg. dev-java/java-config-2.x) 71 # in site-packages. (eg. dev-java/java-config-2.x)
69 # - liquidx (14/08/2006) 72 # - liquidx (14/08/2006)
70 pylibdir="$(${python} -c 'from distutils.sysconfig import get_python_lib; print get_python_lib()')" 73 pylibdir="$(${python} -c 'from distutils.sysconfig import get_python_lib; print get_python_lib()')"
90 93
91# @FUNCTION: distutils_pkg_postrm 94# @FUNCTION: distutils_pkg_postrm
92# @DESCRIPTION: 95# @DESCRIPTION:
93# Generic pyc/pyo cleanup script. This function is exported. 96# Generic pyc/pyo cleanup script. This function is exported.
94distutils_pkg_postrm() { 97distutils_pkg_postrm() {
98 local moddir pylibdir pymod
95 if [ -z "${PYTHON_MODNAME}" ] && \ 99 if [[ -z "${PYTHON_MODNAME}" ]]; then
96 [ -d ${ROOT}/usr/$(get_libdir)/python*/site-packages/${PN} ]; then 100 for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do
101 if [[ -d "${pylibdir}"/site-packages/${PN} ]]; then
97 PYTHON_MODNAME=${PN} 102 PYTHON_MODNAME=${PN}
103 fi
104 done
98 fi 105 fi
99 106
100 if has_version ">=dev-lang/python-2.3"; then 107 if has_version ">=dev-lang/python-2.3"; then
101 ebegin "Performing Python Module Cleanup .." 108 ebegin "Performing Python Module Cleanup .."
102 if [ -n "${PYTHON_MODNAME}" ]; then 109 if [[ -n "${PYTHON_MODNAME}" ]]; then
103 for pymod in ${PYTHON_MODNAME}; do 110 for pymod in ${PYTHON_MODNAME}; do
104 for moddir in "`ls -d --color=none -1 ${ROOT}usr/$(get_libdir)/python*/site-packages/${pymod} 2> /dev/null`"; do 111 for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do
105 python_mod_cleanup ${moddir} 112 if [[ -d "${pylibdir}"/site-packages/${pymod} ]]; then
113 python_mod_cleanup "${pylibdir#${ROOT}}"/site-packages/${pymod}
114 fi
106 done 115 done
107 done 116 done
108 else 117 else
109 python_mod_cleanup 118 python_mod_cleanup
110 fi 119 fi
115# @FUNCTION: distutils_pkg_postinst 124# @FUNCTION: distutils_pkg_postinst
116# @DESCRIPTION: 125# @DESCRIPTION:
117# This is a generic optimization, you should override it if your package 126# This is a generic optimization, you should override it if your package
118# installs things in another directory. This function is exported 127# installs things in another directory. This function is exported
119distutils_pkg_postinst() { 128distutils_pkg_postinst() {
129 local pylibdir pymod
120 if [ -z "${PYTHON_MODNAME}" ] && \ 130 if [[ -z "${PYTHON_MODNAME}" ]]; then
121 [ -d ${ROOT}/usr/$(get_libdir)/python*/site-packages/${PN} ]; then 131 for pylibdir in "${ROOT}"/usr/$(get_libdir)/python*; do
132 if [[ -d "${pylibdir}"/site-packages/${PN} ]]; then
122 PYTHON_MODNAME=${PN} 133 PYTHON_MODNAME=${PN}
134 fi
135 done
123 fi 136 fi
124 137
125 if has_version ">=dev-lang/python-2.3"; then 138 if has_version ">=dev-lang/python-2.3"; then
126 python_version 139 python_version
127 for pymod in ${PYTHON_MODNAME}; do 140 for pymod in ${PYTHON_MODNAME}; do

Legend:
Removed from v.1.52  
changed lines
  Added in v.1.54

  ViewVC Help
Powered by ViewVC 1.1.20