Magellan Linux

Contents of /smage/trunk/include/python.sminc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (show annotations) (download)
Sat Jan 2 16:59:51 2010 UTC (14 years, 3 months ago) by niro
File size: 994 byte(s)
-initial smage includes
1 # $Header: /alx-cvs/smage-eglibc/include/python.sminc,v 1.1.1.1 2008/02/27 09:26:22 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