Magellan Linux

Contents of /branches/R11-stable/core/python/python-2.7.3-r3.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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