summaryrefslogtreecommitdiff
blob: 90db3530c6169644b74489a4b95c29d956f467d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
.TH PYTHON.ECLASS 5 "Nov 2004" "Portage 2.0.51" portage
.SH NAME
python.eclass \- functions for Python-related ebuilds
.SH DESCRIPTION
The \fBpython\fR eclass provides general utility functions for Python-related
ebuilds.
.SH VARIABLES
.TP
.B PYVER
Defines major and minor Python version.  This is a READ-ONLY variable, set by
the \fBpython_version\fR function.
.TP
.B PYVER_MAJOR
Defines major Python version.  This is a READ-ONLY variable, set by the
\fBpython_version\fR function.
.TP
.B PYVER_MINOR
Defines minor Python version.  This is a READ-ONLY variable, set by the
\fBpython_version\fR function.
.TP
.B PYVER_MICRO
Defines micro Python version.  This is a READ-ONLY variable, set by the
\fBpython_version\fR function.
.TP
.B PYTHON_OVERRIDE_PYVER = \fI"2.2"\fR
When set, overrides the version of Python to use in the \fBpython_mod_compile\fR
and \fBpython_mod_optimize\fR functions.
.SH FUNCTIONS
.TP
.B python_version
Sets variables \fBPYVER\fR, \fBPYVER_MAJOR\fR, \fBPYVER_MINOR\fR, and
\fBPYVER_MICRO\fR to the version of Python currently available.
.TP
.B python_disable_pyc
Disables automatic recompilation of modules to .pyc/.pyo.  This is supported by
>=dev-lang/python-2.2.3-r3 only.
.TP
.B python_enable_pyc
Enables automatic recompilation of modules to .pyc/.pyo.  This is supported by
>=dev-lang/python-2.2.3-r2 only.
.TP
.B python_makesym
Creates the /usr/bin/python symbolic link to point to the latest installed
version of Python.
.TP
.B python_tkinter_exists
Checks to see if Python was compiled with Tkinter support (via USE=tcltk).
If not, this function will print an error message informing the user that
Tkinter support is required and then die.
.TP
.B python_mod_exists \fI[ module ]\fR
Checks to see if the specified module is installed and loadable.  Returns true
(0) if so or false (1) if not.
.TP
.B python_mod_compile \fI[ file ]\fR
Precompiles the specified file, creating the module's pyc and pyo files.  If
the variable, \fBPYTHON_OVERRIDE_PYVER\fR is set, this function will use the
specified version of Python to compile rather than the version detected by
\fBpython_version\fR.  This function should only be run from \fBpkg_postinst\fR.
.TP
.B python_mod_optimize \fI< dir1 > < dir 2 >\fR
If called with no arguments, this function will recompile all modules under
sys.path without recursing into subdirectories.  Called with arguments, this
function will recursively compile all modules in the specified directories.
If the variable, \fBPYTHON_OVERRIDE_PYVER\fR is set, this function will use
the specified version of Python rather than the version detected by
\fBpython_version\fR.
.TP
.B python_mod_cleanup \fI< dir1 > < dir2 >\fR
Recursively searches specified directories (or /usr/lib/python*/site-packages
if called with no arguments) removing orphaned bytecode (.pyc/.pyo files with
no corresponding .py file).
.SH REPORTING BUGS
Please report bugs via http://bugs.gentoo.org/
.SH SEE ALSO
.BR ebuild (5)
.SH FILES
.BR /usr/portage/eclass/python.eclass
.SH AUTHORS
Aaron Walker <ka0ttic@gentoo.org>
.SH CVS HEADER
$Header: /var/cvsroot/gentoo-src/portage/man/python.eclass.5,v 1.1.2.2 2005/01/15 00:19:36 vapier Exp $