Magellan Linux

Contents of /branches/magellan-next/core/python/python-2.7.0-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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