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

Diff of /eclass/distutils.eclass

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

Revision 1.46 Revision 1.52
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.46 2008/02/28 20:20:32 dev-zero Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.52 2008/09/24 16:45:08 hawking Exp $
4 4
5# @ECLASS: distutils.eclass 5# @ECLASS: distutils.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Alastair Tse <liquidx@gentoo.org> 7# <python@gentoo.org>
8# 8#
9# Original author: Jon Nelson <jnelson@gentoo.org> 9# Original author: Jon Nelson <jnelson@gentoo.org>
10# @BLURB: This eclass allows easier installation of distutils-based python modules 10# @BLURB: This eclass allows easier installation of distutils-based python modules
11# @DESCRIPTION: 11# @DESCRIPTION:
12# The distutils eclass is designed to allow easier installation of 12# The distutils eclass is designed to allow easier installation of
69 # - liquidx (14/08/2006) 69 # - liquidx (14/08/2006)
70 pylibdir="$(${python} -c 'from distutils.sysconfig import get_python_lib; print get_python_lib()')" 70 pylibdir="$(${python} -c 'from distutils.sysconfig import get_python_lib; print get_python_lib()')"
71 [ -n "${pylibdir}" ] && dodir "${pylibdir}" 71 [ -n "${pylibdir}" ] && dodir "${pylibdir}"
72 72
73 if has_version ">=dev-lang/python-2.3"; then 73 if has_version ">=dev-lang/python-2.3"; then
74 ${python} setup.py install --root=${D} --no-compile "$@" || die 74 ${python} setup.py install --root="${D}" --no-compile "$@" ||\
75 die "python setup.py install failed"
75 else 76 else
76 ${python} setup.py install --root=${D} "$@" || die 77 ${python} setup.py install --root="${D}" "$@" ||\
78 die "python setup.py install failed"
77 fi 79 fi
78 80
79 DDOCS="CHANGELOG KNOWN_BUGS MAINTAINERS PKG-INFO CONTRIBUTORS TODO NEWS" 81 DDOCS="CHANGELOG KNOWN_BUGS MAINTAINERS PKG-INFO CONTRIBUTORS TODO NEWS"
80 DDOCS="${DDOCS} Change* MANIFEST* README* AUTHORS" 82 DDOCS="${DDOCS} Change* MANIFEST* README* AUTHORS"
81 83
88 90
89# @FUNCTION: distutils_pkg_postrm 91# @FUNCTION: distutils_pkg_postrm
90# @DESCRIPTION: 92# @DESCRIPTION:
91# Generic pyc/pyo cleanup script. This function is exported. 93# Generic pyc/pyo cleanup script. This function is exported.
92distutils_pkg_postrm() { 94distutils_pkg_postrm() {
93 PYTHON_MODNAME=${PYTHON_MODNAME:-${PN}} 95 if [ -z "${PYTHON_MODNAME}" ] && \
96 [ -d ${ROOT}/usr/$(get_libdir)/python*/site-packages/${PN} ]; then
97 PYTHON_MODNAME=${PN}
98 fi
94 99
95 if has_version ">=dev-lang/python-2.3"; then 100 if has_version ">=dev-lang/python-2.3"; then
96 ebegin "Performing Python Module Cleanup .." 101 ebegin "Performing Python Module Cleanup .."
97 if [ -n "${PYTHON_MODNAME}" ]; then 102 if [ -n "${PYTHON_MODNAME}" ]; then
98 for pymod in ${PYTHON_MODNAME}; do 103 for pymod in ${PYTHON_MODNAME}; do
110# @FUNCTION: distutils_pkg_postinst 115# @FUNCTION: distutils_pkg_postinst
111# @DESCRIPTION: 116# @DESCRIPTION:
112# This is a generic optimization, you should override it if your package 117# This is a generic optimization, you should override it if your package
113# installs things in another directory. This function is exported 118# installs things in another directory. This function is exported
114distutils_pkg_postinst() { 119distutils_pkg_postinst() {
115 PYTHON_MODNAME=${PYTHON_MODNAME:-${PN}} 120 if [ -z "${PYTHON_MODNAME}" ] && \
116 121 [ -d ${ROOT}/usr/$(get_libdir)/python*/site-packages/${PN} ]; then
117 # strip trailing slash 122 PYTHON_MODNAME=${PN}
118 myroot="${ROOT%/}" 123 fi
119 124
120 if has_version ">=dev-lang/python-2.3"; then 125 if has_version ">=dev-lang/python-2.3"; then
121 python_version 126 python_version
122 for pymod in ${PYTHON_MODNAME}; do 127 for pymod in ${PYTHON_MODNAME}; do
128 python_mod_optimize \
123 if [ -d "${myroot}/usr/$(get_libdir)/python${PYVER}/site-packages/${pymod}" ]; then 129 /usr/$(get_libdir)/python${PYVER}/site-packages/${pymod}
124 python_mod_optimize ${myroot}/usr/$(get_libdir)/python${PYVER}/site-packages/${pymod}
125 fi
126 done 130 done
127 fi 131 fi
128} 132}
129 133
130# @FUNCTION: distutils_python_version 134# @FUNCTION: distutils_python_version

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

  ViewVC Help
Powered by ViewVC 1.1.20