Contents of /branches/magellan-next/core/python/python-2.7.0-r3.smage2
Parent Directory | Revision Log
Revision 6145 -
(show annotations)
(download)
Thu Aug 19 17:29:19 2010 UTC (13 years, 8 months ago) by niro
File size: 2760 byte(s)
Thu Aug 19 17:29:19 2010 UTC (13 years, 8 months ago) by niro
File size: 2760 byte(s)
-fixed broken python/python2 symlinks
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="r3" |
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 | # disabled modules (needs the gentoo_py_dontcompile patch) |
27 | export PYTHON_DISABLE_MODULES="gdbm dbm bsddb _tkinter" || die |
28 | |
29 | # force usage of our CFLAGS |
30 | export OPT="${CFLAGS}" |
31 | |
32 | sminclude mtools |
33 | |
34 | # uses PYVER and sometimes PVER; so keep both |
35 | SRC_URI=( |
36 | http://www.python.org/ftp/python/${PVER%.*}/${SRCFILE} |
37 | http://www.python.org/ftp/python/${PVER}/${SRCFILE} |
38 | mirror://${PNAME}/${SRCFILE} |
39 | mirror://${PNAME}/${PNAME}-2.7.0-gentoo_py_dontcompile.patch |
40 | mirror://${PNAME}/${PNAME}-2.4-disable_modules_and_ssl.patch |
41 | mirror://${PNAME}/${PNAME}-2.5.0-mimetypes-apache.patch |
42 | mirror://${PNAME}/${PNAME}-2.7.0-lib64-3.patch |
43 | ) |
44 | |
45 | # sed line: on 2 digits add an zero: 2.6 -> 2.6.0 |
46 | UP2DATE="updatecmd ${HOMEPAGE}/download/releases/ | grep 'Python .*(.*)' | sed 's/.*Python\ \([0-9].*\) (.*/\1/g;s/\([0-9]\.[0-9]\$\)/\1.0/;q'" |
47 | |
48 | src_prepare() |
49 | { |
50 | munpack ${SRCFILE} || die |
51 | cd ${SRCDIR} |
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 | if [[ $(mlibdir) = lib64 ]] |
60 | then |
61 | mpatch ${PNAME}-2.7.0-lib64-3.patch || die |
62 | fi |
63 | } |
64 | |
65 | src_compile() |
66 | { |
67 | cd ${SRCDIR} |
68 | |
69 | mconfigure \ |
70 | --with-fpectl \ |
71 | --enable-shared \ |
72 | --infodir='${prefix}'/share/info \ |
73 | --mandir='${prefix}'/share/man \ |
74 | --with-threads || die |
75 | |
76 | mmake || die |
77 | } |
78 | |
79 | src_install() |
80 | { |
81 | cd ${SRCDIR} |
82 | |
83 | # install some missing directories |
84 | minstalldir /usr || die |
85 | |
86 | mmake DESTDIR=${BINDIR} altinstall || die |
87 | |
88 | # link python${PVER%.*}-config to python-config |
89 | mlink python${PVER%.*}-config /usr/bin/python-config || die |
90 | |
91 | minstalldir /usr/$(mlibdir)/python${PVER%.*}/config || die |
92 | minstallfile ${SRCDIR}/Makefile.pre.in /usr/$(mlibdir)/python${PVER%.*}/config || die |
93 | |
94 | # remove hardcoded CFLAGS from default Makefile |
95 | sed -i 's:^OPT=.*:OPT=-DNDEBUG:' ${BINDIR}/usr/$(mlibdir)/python${PVER%.*}/config/Makefile || die |
96 | |
97 | # link python2.7 binary with python |
98 | mlink python${PVER%.*} /usr/bin/python || die |
99 | |
100 | # link python2.7 binary with python2 |
101 | mlink python${PVER%.*} /usr/bin/python2 || die |
102 | |
103 | minstalldocs LICENSE README || die |
104 | } |