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

Diff of /eclass/distutils.eclass

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

Revision 1.18 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.18 2003/10/09 15:37:57 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
53 53
54 # deprecated! please use DOCS instead. 54 # deprecated! please use DOCS instead.
55 [ -n "${mydoc}" ] && dodoc ${mydoc} 55 [ -n "${mydoc}" ] && dodoc ${mydoc}
56} 56}
57 57
58# generic pyc/pyo cleanup script.
59
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
72 python_mod_cleanup
73 fi
74 eend 0
75 fi
76}
77
78# this is a generic optimization, you should override it if your package
79# installs things in another directory
80
81distutils_pkg_postinst() {
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
92}
93
58# e.g. insinto ${ROOT}/usr/include/python${PYVER} 94# e.g. insinto ${ROOT}/usr/include/python${PYVER}
59 95
60distutils_python_version() { 96distutils_python_version() {
61 local tmpstr="$(${python} -V 2>&1 )" 97 local tmpstr="$(${python} -V 2>&1 )"
62 export PYVER_ALL="${tmpstr#Python }" 98 export PYVER_ALL="${tmpstr#Python }"
76 die "missing tkinter support with installed python" 112 die "missing tkinter support with installed python"
77 fi 113 fi
78} 114}
79 115
80 116
81EXPORT_FUNCTIONS src_compile src_install 117EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm
82 118

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

  ViewVC Help
Powered by ViewVC 1.1.20