Contents of /branches/magellan-next/core/python/python-2.7.2-r1.smage2
Parent Directory | Revision Log
Revision 8873 -
(show annotations)
(download)
Thu Aug 4 21:10:27 2011 UTC (13 years, 1 month ago) by niro
File size: 3791 byte(s)
Thu Aug 4 21:10:27 2011 UTC (13 years, 1 month ago) by niro
File size: 3791 byte(s)
auto added: ver bump to 2.7.2-r1
1 | # $Id$ |
2 | |
3 | PNAME="python" |
4 | PVER="2.7.2" |
5 | PBUILD="r1" |
6 | |
7 | PCATEGORIE="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="\$(eval echo \\\$DEPEND_\${ARCH/i*86/x86} | tr ';' '\n') |
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.0 |
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 | |
37 | # uses PYVER and sometimes PVER; so keep both |
38 | SRC_URI=( |
39 | http://www.python.org/ftp/python/${PVER%.*}/${SRCFILE} |
40 | http://www.python.org/ftp/python/${PVER}/${SRCFILE} |
41 | mirror://${PNAME}/${SRCFILE} |
42 | mirror://${PNAME}/${PNAME}-2.7.0-gentoo_py_dontcompile.patch |
43 | mirror://${PNAME}/${PNAME}-2.4-disable_modules_and_ssl.patch |
44 | mirror://${PNAME}/${PNAME}-2.5.0-mimetypes-apache.patch |
45 | mirror://${PNAME}/${PNAME}-2.7.1-lib64.patch |
46 | ) |
47 | |
48 | # sed line: on 2 digits add an zero: 2.6 -> 2.6.0 |
49 | UP2DATE="updatecmd ${HOMEPAGE}/download/releases/ | grep 'Python .*(.*)' | sed 's/.*Python\ \([0-9].*\) (.*/\1/g;s/\([0-9]\.[0-9]\$\)/\1.0/;q'" |
50 | |
51 | src_prepare() |
52 | { |
53 | munpack ${SRCFILE} || die |
54 | |
55 | # adds support for PYTHON_DONTCOMPILE shell environment to |
56 | # supress automatic generation of .pyc and .pyo files |
57 | mpatch ${PNAME}-2.7.0-gentoo_py_dontcompile.patch || die |
58 | mpatch ${PNAME}-2.4-disable_modules_and_ssl.patch || die |
59 | mpatch ${PNAME}-2.5.0-mimetypes-apache.patch || die |
60 | |
61 | only-m64 mpatch ${PNAME}-2.7.1-lib64.patch || die |
62 | } |
63 | |
64 | src_compile() |
65 | { |
66 | mconfigure \ |
67 | --with-fpectl \ |
68 | --enable-shared \ |
69 | --infodir='${prefix}'/share/info \ |
70 | --mandir='${prefix}'/share/man \ |
71 | --with-threads \ |
72 | || die |
73 | |
74 | mmake || die |
75 | } |
76 | |
77 | src_install() |
78 | { |
79 | # install some missing directories |
80 | minstalldir /usr || die |
81 | |
82 | mmake DESTDIR=${BINDIR} altinstall || die |
83 | |
84 | all-abis minstalldir /usr/'$(mlibdir)'/python${PVER%.*}/config || die |
85 | all-abis minstallfile Makefile.pre.in /usr/'$(mlibdir)'/python${PVER%.*}/config || die |
86 | |
87 | # remove hardcoded CFLAGS from default Makefile |
88 | all-abis sed -i 's:^OPT=.*:OPT=-DNDEBUG:' ${BINDIR}/usr/'$(mlibdir)'/python${PVER%.*}/config/Makefile || die |
89 | |
90 | if [[ ${ARCH} = x86_64 ]] |
91 | then |
92 | # move config header |
93 | all-abis minstallfile pyconfig.h /usr/include/python${PVER%.*}/pyconfig-$(mabi).h || die |
94 | |
95 | # install a stub header |
96 | cat > ${BINDIR}/usr/include/python${PVER%.*}/pyconfig.h << "EOF" |
97 | /* pyconfig.h - Stub Header */ |
98 | #ifndef __STUB__PYCONFIG_H__ |
99 | #define __STUB__PYCONFIG_H__ |
100 | |
101 | #if defined(__x86_64__) || \ |
102 | defined(__sparc64__) || \ |
103 | defined(__arch64__) || \ |
104 | defined(__powerpc64__) || \ |
105 | defined (__s390x__) |
106 | # include "pyconfig-m64.h" |
107 | #else |
108 | # include "pyconfig-m32.h" |
109 | #endif |
110 | |
111 | #endif /* __STUB__PYCONFIG_H__ */ |
112 | EOF |
113 | # install the multiarch-wrapper |
114 | if [[ -f ${BINDIR}/usr/bin/python${PVER%.*} ]] |
115 | then |
116 | rm -f ${BINDIR}/usr/bin/python${PVER%.*} || die |
117 | fi |
118 | all-abis minstallexec python /usr/bin/python${PVER%.*}-$(mabi) || die |
119 | mlink multiarch-wrapper /usr/bin/python${PVER%.*} || die |
120 | all-abis mlink python${PVER%.*}-$(mabi) /usr/bin/python-$(mabi) || die |
121 | all-abis mlink python${PVER%.*}-$(mabi) /usr/bin/python2-$(mabi) || die |
122 | fi |
123 | |
124 | # link python${PVER%.*}-config to python-config |
125 | mlink python${PVER%.*}-config /usr/bin/python-config || die |
126 | |
127 | # link python2.7 binary with python |
128 | mlink python${PVER%.*} /usr/bin/python || die |
129 | |
130 | # link python2.7 binary with python2 |
131 | mlink python${PVER%.*} /usr/bin/python2 || die |
132 | |
133 | minstalldocs LICENSE README || die |
134 | } |