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

Diff of /eclass/distutils.eclass

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

Revision 1.17 Revision 1.19
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.17 2003/10/09 15:11:24 liquidx Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.19 2003/10/17 07:14:26 liquidx 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
37distutils_src_compile() { 37distutils_src_compile() {
38 ${python} setup.py build "$@" || die "compilation failed" 38 ${python} setup.py build "$@" || die "compilation failed"
39} 39}
40 40
41distutils_src_install() { 41distutils_src_install() {
42 if has_version ">=dev-lang/python-2.3"; then
42 ${python} setup.py install --root=${D} --no-compile "$@" || die 43 ${python} setup.py install --root=${D} --no-compile "$@" || die
44 else
45 ${python} setup.py install --root=${D} "$@" || die
46 fi
43 47
44 dodoc CHANGELOG COPYRIGHT KNOWN_BUGS MAINTAINERS PKG-INFO 48 dodoc CHANGELOG COPYRIGHT KNOWN_BUGS MAINTAINERS PKG-INFO
45 dodoc CONTRIBUTORS LICENSE COPYING* 49 dodoc CONTRIBUTORS LICENSE COPYING*
46 dodoc Change* MANIFEST* README* 50 dodoc Change* MANIFEST* README*
47 51
49 53
50 # deprecated! please use DOCS instead. 54 # deprecated! please use DOCS instead.
51 [ -n "${mydoc}" ] && dodoc ${mydoc} 55 [ -n "${mydoc}" ] && dodoc ${mydoc}
52} 56}
53 57
58# generic pyc/pyo cleanup script.
59
54distutils_pkg_postrm() { 60distutils_pkg_postrm() {
61 PYTHON_MODNAME=${PYTHON_MODNAME:-${PN}}
62
63 if has_version ">=dev-lang/python-2.3"; then
64 ebegin "Performing Python Module Cleanup .."
65 if [ -n "${PYTHON_MODNAME}" ]; then
66 for pymod in "${PYTHON_MODNAME}"; do
67 for moddir in "`ls -d --color=none -1 ${ROOT}usr/lib/python*/site-packages/${pymod}`"; do
68 python_mod_cleanup ${moddir}
69 done
70 done
71 else
55 python_mod_cleanup 72 python_mod_cleanup
73 fi
74 eend 0
75 fi
56} 76}
57 77
78# this is a generic optimization, you should override it if your package
79# installs things in another directory
80
58distutils_pkg_postinst() { 81distutils_pkg_postinst() {
59 python_mod_optimize 82 PYTHON_MODNAME=${PYTHON_MODNAME:-${PN}}
83
84 if has_version ">=dev-lang/python-2.3"; then
85 python_version
86 for pymod in "${PYTHON_MODNAME}"; do
87 if [ -d "${ROOT}usr/lib/python${PYVER}/site-packages/${pymod}" ]; then
88 python_mod_optimize ${ROOT}usr/lib/python${PYVER}/site-packages/${pymod}
89 fi
90 done
91 fi
60} 92}
61 93
62# e.g. insinto ${ROOT}/usr/include/python${PYVER} 94# e.g. insinto ${ROOT}/usr/include/python${PYVER}
63 95
64distutils_python_version() { 96distutils_python_version() {

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.19

  ViewVC Help
Powered by ViewVC 1.1.20