Annotation of /trunk/include/python.sminc
Parent Directory | Revision Log
Revision 9880 -
(hide annotations)
(download)
Sat Jan 14 01:48:34 2012 UTC (12 years, 9 months ago) by niro
File size: 1752 byte(s)
Sat Jan 14 01:48:34 2012 UTC (12 years, 9 months ago) by niro
File size: 1752 byte(s)
-imported from magellan-next
1 | niro | 8643 | # $Id$ |
2 | niro | 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 | niro | 8643 | pylib=$(python -c 'from distutils import sysconfig; print sysconfig.get_python_lib()') |
18 | niro | 2 | echo "${pylib}" |
19 | return 0 | ||
20 | } | ||
21 | |||
22 | niro | 8673 | get_python_includedir() |
23 | { | ||
24 | local pyinc | ||
25 | pyinc=$(python -c 'from distutils import sysconfig; print sysconfig.get_python_inc()') | ||
26 | echo "${pyinc}" | ||
27 | return 0 | ||
28 | } | ||
29 | |||
30 | niro | 2 | python_src_prepare() |
31 | { | ||
32 | munpack ${SRCFILE} || die | ||
33 | } | ||
34 | |||
35 | niro | 8645 | python_docompile() |
36 | niro | 2 | { |
37 | niro | 6882 | if [[ -e setup.py ]] |
38 | then | ||
39 | niro | 8645 | python setup.py build $@ || die |
40 | niro | 8121 | elif [[ -e waf ]] |
41 | then | ||
42 | niro | 8645 | python waf configure --prefix=/usr --libdir=/usr/$(mlibdir) $@ || die |
43 | python waf build $@ || die | ||
44 | niro | 6882 | elif [[ -e configure ]] |
45 | then | ||
46 | niro | 8645 | mconfigure $@ || die |
47 | niro | 6882 | mmake || die |
48 | niro | 9471 | elif [[ -e install.py ]] |
49 | niro | 9472 | then |
50 | niro | 9471 | echo "install.py found - nothing to compile here." |
51 | niro | 6882 | else |
52 | mmake || die | ||
53 | fi | ||
54 | niro | 2 | } |
55 | |||
56 | niro | 8645 | python_doinstall() |
57 | niro | 2 | { |
58 | niro | 6882 | if [[ -e setup.py ]] |
59 | then | ||
60 | niro | 8645 | python setup.py install --no-compile --root ${BINDIR} $@ || die |
61 | niro | 8121 | elif [[ -e waf ]] |
62 | then | ||
63 | niro | 8645 | python waf install --destdir=${BINDIR} $@ || die |
64 | niro | 9471 | elif [[ -e install.py ]] |
65 | niro | 9472 | then |
66 | niro | 9471 | python install.py --prefix=/usr --files-only --destdir=${BINDIR} $@ || die |
67 | niro | 6882 | else |
68 | niro | 8645 | mmake DESTDIR=${BINDIR} install || die |
69 | niro | 6882 | fi |
70 | niro | 8645 | } |
71 | niro | 6882 | |
72 | niro | 8645 | python_src_compile() |
73 | { | ||
74 | cd ${SRCDIR} | ||
75 | python_docompile || die | ||
76 | } | ||
77 | |||
78 | python_src_install() | ||
79 | { | ||
80 | cd ${SRCDIR} | ||
81 | python_doinstall || die | ||
82 | |||
83 | niro | 2 | local i |
84 | for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ | ||
85 | FAQ LICENSE NEWS README TODO | ||
86 | do | ||
87 | if [ -f ${SRCDIR}/${i} ] | ||
88 | then | ||
89 | minstalldocs ${i} || die | ||
90 | fi | ||
91 | done | ||
92 | } | ||
93 | |||
94 | export_inherits python src_prepare src_compile src_install |