Annotation of /branches/magellan-next/include/python.sminc
Parent Directory | Revision Log
Revision 6654 -
(hide annotations)
(download)
Tue Sep 14 16:46:32 2010 UTC (14 years ago) by niro
File size: 988 byte(s)
Tue Sep 14 16:46:32 2010 UTC (14 years ago) by niro
File size: 988 byte(s)
imported from trunk
1 | niro | 2 | # $Header: /magellan-cvs/smage/include/python.sminc,v 1.4 2007/01/23 20:46:41 niro Exp $ |
2 | |||
3 | # get the major.minor current installed python version | ||
4 | # -> ex 2.4 | ||
5 | get_python_version() | ||
6 | { | ||
7 | # PYVER="$(python -V 2>&1 | cut -d' ' -f2 | cut -d. -f1-2)" | ||
8 | PYVER=$(python -c "import sys ; print sys.version[:3]") | ||
9 | [[ -z ${PYVER} ]] && return 1 | ||
10 | echo "${PYVER}" | ||
11 | return 0 | ||
12 | } | ||
13 | |||
14 | get_python_libdir() | ||
15 | { | ||
16 | local pylib | ||
17 | pylib=$(python -c 'from distutils import sysconfig; print sysconfig.get_python_version()') | ||
18 | echo "${pylib}" | ||
19 | return 0 | ||
20 | } | ||
21 | |||
22 | python_src_prepare() | ||
23 | { | ||
24 | munpack ${SRCFILE} || die | ||
25 | } | ||
26 | |||
27 | python_src_compile() | ||
28 | { | ||
29 | cd ${SRCDIR} | ||
30 | python setup.py build "$@" || die | ||
31 | } | ||
32 | |||
33 | python_src_install() | ||
34 | { | ||
35 | cd ${SRCDIR} | ||
36 | python setup.py install --no-compile --root ${BINDIR} "$@" || die | ||
37 | |||
38 | local i | ||
39 | for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ | ||
40 | FAQ LICENSE NEWS README TODO | ||
41 | do | ||
42 | if [ -f ${SRCDIR}/${i} ] | ||
43 | then | ||
44 | minstalldocs ${i} || die | ||
45 | fi | ||
46 | done | ||
47 | } | ||
48 | |||
49 | export_inherits python src_prepare src_compile src_install |