Magellan Linux

Diff of /trunk/include/python.sminc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 8643 by niro, Wed Jul 27 11:10:28 2011 UTC revision 9472 by niro, Thu Dec 1 18:46:32 2011 UTC
# Line 1  Line 1 
1  # $Id$  # $Id$
2    
 # needed for mbindir()  
 sminclude mtools  
   
3  # get the major.minor current installed python version  # get the major.minor current installed python version
4  # -> ex 2.4  # -> ex 2.4
5  get_python_version()  get_python_version()
# Line 22  get_python_libdir() Line 19  get_python_libdir()
19   return 0   return 0
20  }  }
21    
22    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  python_src_prepare()  python_src_prepare()
31  {  {
32   munpack ${SRCFILE} || die   munpack ${SRCFILE} || die
33  }  }
34    
35  python_src_compile()  python_docompile()
36  {  {
  cd ${SRCDIR}  
   
37   if [[ -e setup.py ]]   if [[ -e setup.py ]]
38   then   then
39   python setup.py build "$@" || die   python setup.py build $@ || die
40   elif [[ -e waf ]]   elif [[ -e waf ]]
41   then   then
42   python waf configure --prefix=/usr --libdir=/usr/$(mlibdir) "$@" || die   python waf configure --prefix=/usr --libdir=/usr/$(mlibdir) $@ || die
43   python waf build "$@" || die   python waf build $@ || die
44   elif [[ -e configure ]]   elif [[ -e configure ]]
45   then   then
46   mconfigure "$@" || die   mconfigure $@ || die
47   mmake || die   mmake || die
48     elif [[ -e install.py ]]
49     then
50     echo "install.py found - nothing to compile here."
51   else   else
52   mmake || die   mmake || die
53   fi   fi
54  }  }
55    
56  python_src_install()  python_doinstall()
57  {  {
  cd ${SRCDIR}  
   
58   if [[ -e setup.py ]]   if [[ -e setup.py ]]
59   then   then
60   python setup.py install --no-compile --root $(mbindir) "$@" || die   python setup.py install --no-compile --root ${BINDIR} $@ || die
61   elif [[ -e waf ]]   elif [[ -e waf ]]
62   then   then
63   python waf install --destdir="$(mbindir)" "$@" || die   python waf install --destdir=${BINDIR} $@ || die
64     elif [[ -e install.py ]]
65     then
66     python install.py --prefix=/usr --files-only --destdir=${BINDIR} $@ || die
67   else   else
68   mmake DESTDIR=$(mbindir) install || die   mmake DESTDIR=${BINDIR} install || die
69   fi   fi
70    }
71    
72    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   local i   local i
84   for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \   for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \

Legend:
Removed from v.8643  
changed lines
  Added in v.9472