summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eclass/distutils.eclass16
-rw-r--r--eclass/python.eclass14
2 files changed, 21 insertions, 9 deletions
diff --git a/eclass/distutils.eclass b/eclass/distutils.eclass
index 72ec564c7e56..52901df902c2 100644
--- a/eclass/distutils.eclass
+++ b/eclass/distutils.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.16 2003/10/09 08:41:41 liquidx Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/distutils.eclass,v 1.17 2003/10/09 15:11:24 liquidx Exp $
#
# Author: Jon Nelson <jnelson@gentoo.org>
# Current Maintainer: Alastair Tse <liquidx@gentoo.org>
@@ -35,13 +35,11 @@ else
fi
distutils_src_compile() {
- python_disable_pyc
${python} setup.py build "$@" || die "compilation failed"
}
distutils_src_install() {
- python_disable_pyc
- ${python} setup.py install --root=${D} "$@" || die
+ ${python} setup.py install --root=${D} --no-compile "$@" || die
dodoc CHANGELOG COPYRIGHT KNOWN_BUGS MAINTAINERS PKG-INFO
dodoc CONTRIBUTORS LICENSE COPYING*
@@ -53,6 +51,14 @@ distutils_src_install() {
[ -n "${mydoc}" ] && dodoc ${mydoc}
}
+distutils_pkg_postrm() {
+ python_mod_cleanup
+}
+
+distutils_pkg_postinst() {
+ python_mod_optimize
+}
+
# e.g. insinto ${ROOT}/usr/include/python${PYVER}
distutils_python_version() {
@@ -76,5 +82,5 @@ distutils_python_tkinter() {
}
-EXPORT_FUNCTIONS src_compile src_install
+EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm
diff --git a/eclass/python.eclass b/eclass/python.eclass
index 01a3f4832a96..70428f29b94e 100644
--- a/eclass/python.eclass
+++ b/eclass/python.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.3 2003/10/09 08:57:20 liquidx Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python.eclass,v 1.4 2003/10/09 15:11:24 liquidx Exp $
#
# Author: Alastair Tse <liquidx@gentoo.org>
#
@@ -26,6 +26,12 @@ python_disable_pyc() {
export PYTHON_DONTCOMPILE=1
}
+python_enable_pyc() {
+ unset PYTHON_DONTCOMPILE
+}
+
+python_disable_pyc
+
#
# name: python_version
# desc: run without arguments and it will export the version of python
@@ -115,10 +121,10 @@ python_mod_compile() {
# python_mod_optimize ${ROOT}usr/share/codegen
#
python_mod_optimize() {
- einfo "Byte Compiling Python modules .."
python_version
- echo ${PYVER}
- python ${ROOT}usr/lib/python${PYVER}/compileall.py $@
+ einfo "Byte Compiling Python modules for ${PYVER} .."
+ python ${ROOT}usr/lib/python${PYVER}/compileall.py -q $@
+ python -O ${ROOT}usr/lib/python${PYVER}/compileall.py -q $@
}
#