Magellan Linux

Contents of /branches/R11-stable/include/python.sminc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8123 - (show annotations) (download)
Tue Jul 12 17:20:55 2011 UTC (13 years, 3 months ago) by niro
Original Path: branches/magellan-next/include/python.sminc
File size: 1405 byte(s)
-fixed libdir
1 # $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
31 if [[ -e setup.py ]]
32 then
33 python setup.py build "$@" || die
34 elif [[ -e waf ]]
35 then
36 python waf configure --prefix=/usr --libdir=/usr/$(mlibdir) "$@" || die
37 python waf build "$@" || die
38 elif [[ -e configure ]]
39 then
40 mconfigure "$@" || die
41 mmake || die
42 else
43 mmake || die
44 fi
45 }
46
47 python_src_install()
48 {
49 cd ${SRCDIR}
50
51 if [[ -e setup.py ]]
52 then
53 python setup.py install --no-compile --root ${BINDIR} "$@" || die
54 elif [[ -e waf ]]
55 then
56 python waf install --destdir="${BINDIR}" "$@" || die
57 else
58 mmake DESTDIR=${BINDIR} install || die
59 fi
60
61 local i
62 for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \
63 FAQ LICENSE NEWS README TODO
64 do
65 if [ -f ${SRCDIR}/${i} ]
66 then
67 minstalldocs ${i} || die
68 fi
69 done
70 }
71
72 export_inherits python src_prepare src_compile src_install