Contents of /branches/magellan-next/core/python/python-2.7.0-r2.smage2
Parent Directory | Revision Log
Revision 6140 -
(show annotations)
(download)
Thu Aug 19 16:49:38 2010 UTC (13 years, 8 months ago) by niro
File size: 2766 byte(s)
Thu Aug 19 16:49:38 2010 UTC (13 years, 8 months ago) by niro
File size: 2766 byte(s)
-dropped r79310 patch, must be reverted
1 | # $Id: python-2.6.3-r2.smage2 3627 2009-10-27 15:43:35Z niro $ |
2 | |
3 | PNAME="python" |
4 | PVER="2.7.0" |
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=">= virtual/glibc |
14 | >= sys-libs/ncurses-5.7 |
15 | >= sys-libs/zlib-1.2 |
16 | >= dev-libs/expat-2 |
17 | >= dev-libs/openssl-1.0.0 |
18 | >= sys-libs/readline-6.1 |
19 | >= dev-db/sqlite-3.7" |
20 | |
21 | SDEPEND=">= sys-apps/sed-4" |
22 | |
23 | SRCFILE="${PNAME/py/Py}-${PVER/.0}.tar.bz2" |
24 | SRCDIR="${BUILDDIR}/${PNAME/py/Py}-${PVER/.0}" |
25 | |
26 | PYVER="${PVER%.*}" |
27 | |
28 | # disabled modules (needs the gentoo_py_dontcompile patch) |
29 | export PYTHON_DISABLE_MODULES="gdbm dbm bsddb _tkinter" || die |
30 | |
31 | # force usage of our CFLAGS |
32 | export OPT="${CFLAGS}" |
33 | |
34 | sminclude mtools |
35 | |
36 | # uses PYVER and sometimes PVER; so keep both |
37 | SRC_URI=( |
38 | http://www.python.org/ftp/python/${PYVER}/${SRCFILE} |
39 | http://www.python.org/ftp/python/${PVER}/${SRCFILE} |
40 | mirror://${PNAME}/${SRCFILE} |
41 | mirror://${PNAME}/${PNAME}-2.7.0-gentoo_py_dontcompile.patch |
42 | mirror://${PNAME}/${PNAME}-2.4-disable_modules_and_ssl.patch |
43 | mirror://${PNAME}/${PNAME}-2.5.0-mimetypes-apache.patch |
44 | mirror://${PNAME}/${PNAME}-2.7.0-lib64-3.patch |
45 | ) |
46 | |
47 | # sed line: on 2 digits add an zero: 2.6 -> 2.6.0 |
48 | UP2DATE="updatecmd ${HOMEPAGE}/download/releases/ | grep 'Python .*(.*)' | sed 's/.*Python\ \([0-9].*\) (.*/\1/g;s/\([0-9]\.[0-9]\$\)/\1.0/;q'" |
49 | |
50 | src_prepare() |
51 | { |
52 | munpack ${SRCFILE} || die |
53 | cd ${SRCDIR} |
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 | if [[ $(mlibdir) = lib64 ]] |
62 | then |
63 | mpatch ${PNAME}-2.7.0-lib64-3.patch || die |
64 | fi |
65 | } |
66 | |
67 | src_compile() |
68 | { |
69 | cd ${SRCDIR} |
70 | |
71 | mconfigure \ |
72 | --with-fpectl \ |
73 | --enable-shared \ |
74 | --infodir='${prefix}'/share/info \ |
75 | --mandir='${prefix}'/share/man \ |
76 | --with-threads || die |
77 | |
78 | mmake || die |
79 | } |
80 | |
81 | src_install() |
82 | { |
83 | cd ${SRCDIR} |
84 | |
85 | # install some missing directories |
86 | minstalldir /usr || die |
87 | |
88 | mmake DESTDIR=${BINDIR} altinstall || die |
89 | |
90 | # link python${PYVER}-config to python-config |
91 | mlink python${PYVER}-config /usr/bin/python-config || die |
92 | |
93 | minstalldir /usr/$(mlibdir)/python${PYVER}/config || die |
94 | minstallfile ${SRCDIR}/Makefile.pre.in /usr/$(mlibdir)/python${PYVER}/config || die |
95 | |
96 | # remove hardcoded CFLAGS from default Makefile |
97 | sed -i 's:^OPT=.*:OPT=-DNDEBUG:' ${BINDIR}/usr/$(mlibdir)/python${PYVER}/config/Makefile || die |
98 | |
99 | # link python2.4 binary with python |
100 | mlink python${mPYVER} /usr/bin/python || die |
101 | |
102 | # link python2.4 binary with python2 |
103 | mlink python${mPYVER} /usr/bin/python2 || die |
104 | |
105 | minstalldocs LICENSE README || die |
106 | } |