Magellan Linux

Annotation of /smage/trunk/core/python/python-2.7.1-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1385 - (hide annotations) (download)
Tue Mar 1 19:06:01 2011 UTC (13 years, 2 months ago) by niro
File size: 3945 byte(s)
-rebuild against ncurses-5.8
1 niro 1385 # $Id$
2    
3     PNAME="python"
4     PVER="2.7.1"
5     PBUILD="r2"
6    
7     PCATEGORIE="dev-lang"
8     STATE="unstable"
9    
10     DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language."
11     HOMEPAGE="http://www.python.org/"
12    
13     DEPEND_x86_64=">= sys-apps/multiarch-wrapper-1"
14     SPECIAL_VARS="DEPEND_x86_64"
15    
16     DEPEND="\$(eval echo \\\$DEPEND_\${ARCH/i*86/x86} | tr ';' '\n')
17     >= virtual/glibc
18     >= sys-libs/ncurses-5.8
19     >= sys-libs/zlib-1.2
20     >= dev-libs/expat-2"
21    
22     SDEPEND=">= virtual/sed"
23    
24     SRCFILE="${PNAME/py/Py}-${PVER/.0}.tar.bz2"
25     SRCDIR="${BUILDDIR}/${PNAME/py/Py}-${PVER/.0}"
26    
27     # disabled modules (needs the gentoo_py_dontcompile patch)
28     export PYTHON_DISABLE_MODULES="gdbm dbm bsddb _tkinter" || die
29    
30     # force usage of our CFLAGS
31     export OPT="${CFLAGS}"
32    
33     sminclude mtools multilib
34    
35     # uses PYVER and sometimes PVER; so keep both
36     SRC_URI=(
37     http://www.python.org/ftp/python/${PVER%.*}/${SRCFILE}
38     http://www.python.org/ftp/python/${PVER}/${SRCFILE}
39     mirror://${PNAME}/${SRCFILE}
40     mirror://${PNAME}/${PNAME}-2.7.0-gentoo_py_dontcompile.patch
41     mirror://${PNAME}/${PNAME}-2.4-disable_modules_and_ssl.patch
42     mirror://${PNAME}/${PNAME}-2.5.0-mimetypes-apache.patch
43     mirror://${PNAME}/${PNAME}-2.7.0-lib64-3.patch
44     )
45    
46     # sed line: on 2 digits add an zero: 2.6 -> 2.6.0
47     UP2DATE="updatecmd ${HOMEPAGE}/download/releases/ | grep 'Python .*(.*)' | sed 's/.*Python\ \([0-9].*\) (.*/\1/g;s/\([0-9]\.[0-9]\$\)/\1.0/;q'"
48    
49     src_prepare()
50     {
51     munpack ${SRCFILE} || die
52    
53     # adds support for PYTHON_DONTCOMPILE shell environment to
54     # supress automatic generation of .pyc and .pyo files
55     mpatch ${PNAME}-2.7.0-gentoo_py_dontcompile.patch || die
56     mpatch ${PNAME}-2.4-disable_modules_and_ssl.patch || die
57     mpatch ${PNAME}-2.5.0-mimetypes-apache.patch || die
58    
59     only-m64 mpatch ${PNAME}-2.7.0-lib64-3.patch || die
60     }
61    
62     src_compile()
63     {
64     # disable all unneccessary modules
65     export PYTHON_DISABLE_MODULES="dbm _bsddb gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat"
66     # no ssl
67     export PYTHON_DISABLE_SSL="1"
68    
69     mconfigure \
70     --with-fpectl \
71     --enable-shared \
72     --infodir='${prefix}'/share/info \
73     --mandir='${prefix}'/share/man \
74     --with-threads \
75     ${myconf} \
76     || die
77    
78     mmake || die
79     }
80    
81     src_install()
82     {
83     # install some missing directories
84     minstalldir /usr || die
85    
86     mmake DESTDIR=${BINDIR} altinstall || die
87    
88     all-abis minstalldir /usr/'$(mlibdir)'/python${PVER%.*}/config || die
89     all-abis minstallfile Makefile.pre.in /usr/'$(mlibdir)'/python${PVER%.*}/config || die
90    
91     # remove hardcoded CFLAGS from default Makefile
92     all-abis sed -i 's:^OPT=.*:OPT=-DNDEBUG:' ${BINDIR}/usr/'$(mlibdir)'/python${PVER%.*}/config/Makefile || die
93    
94     if [[ ${ARCH} = x86_64 ]]
95     then
96     # move config header
97     all-abis minstallfile pyconfig.h /usr/include/python${PVER%.*}/pyconfig-$(mabi).h || die
98    
99     # install a stub header
100     cat > ${BINDIR}/usr/include/python${PVER%.*}/pyconfig.h << "EOF"
101     /* pyconfig.h - Stub Header */
102     #ifndef __STUB__PYCONFIG_H__
103     #define __STUB__PYCONFIG_H__
104    
105     #if defined(__x86_64__) || \
106     defined(__sparc64__) || \
107     defined(__arch64__) || \
108     defined(__powerpc64__) || \
109     defined (__s390x__)
110     # include "pyconfig-m64.h"
111     #else
112     # include "pyconfig-m32.h"
113     #endif
114    
115     #endif /* __STUB__PYCONFIG_H__ */
116     EOF
117     # install the multiarch-wrapper
118     if [[ -f ${BINDIR}/usr/bin/python${PVER%.*} ]]
119     then
120     rm -f ${BINDIR}/usr/bin/python${PVER%.*} || die
121     fi
122     all-abis minstallexec python /usr/bin/python${PVER%.*}-$(mabi) || die
123     mlink multiarch-wrapper /usr/bin/python${PVER%.*} || die
124     all-abis mlink python${PVER%.*}-$(mabi) /usr/bin/python-$(mabi) || die
125     all-abis mlink python${PVER%.*}-$(mabi) /usr/bin/python2-$(mabi) || die
126     fi
127    
128     # link python${PVER%.*}-config to python-config
129     mlink python${PVER%.*}-config /usr/bin/python-config || die
130    
131     # link python2.7 binary with python
132     mlink python${PVER%.*} /usr/bin/python || die
133    
134     # link python2.7 binary with python2
135     mlink python${PVER%.*} /usr/bin/python2 || die
136    
137     minstalldocs LICENSE README || die
138     }