Magellan Linux

Contents of /smage/trunk/core/python/python-2.6.3-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 849 - (show annotations) (download)
Mon Oct 25 10:17:38 2010 UTC (13 years, 6 months ago) by niro
File size: 2990 byte(s)
auto added: ver bump to 2.6.3-r2
1 # $Id: python-2.6.3-r2.smage2 3627 2009-10-27 15:43:35Z niro $
2
3 PNAME="python"
4 PVER="2.6.3"
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-0.9.8
18 >= sys-libs/readline-6.0
19 >= dev-db/sqlite-3.6"
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.6.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.6.0-lib64-2.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.6.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.6.0-lib64-2.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 minstalldocs LICENSE README || die
104 }
105
106 postinstall()
107 {
108 # link python2.4 binary with python
109 [ -e ${MROOT}/usr/bin/python ] && rm -f ${MROOT}/usr/bin/python
110 ln -snf python${mPYVER} ${MROOT}/usr/bin/python
111
112 # link python2.4 binary with python2
113 [ -e ${MROOT}/usr/bin/python2 ] && rm -f ${MROOT}/usr/bin/python2
114 ln -snf python${mPYVER} ${MROOT}/usr/bin/python2
115 }