Magellan Linux

Contents of /smage/trunk/core/python/python-2.7.0-r5.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 861 - (show annotations) (download)
Fri Dec 3 21:21:23 2010 UTC (13 years, 4 months ago) by niro
File size: 4079 byte(s)
auto added: ver bump to 2.7.1-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="r5"
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_x86_64=">= sys-apps/multiarch-wrapper-1"
14 SPECIAL_VARS="DEPEND_x86_64"
15
16 DEPEND="\$(eval echo \\\$DEPEND_\${ARCH/i*86/x86} | tr ';' '\n')
17 >= virtual/glibc
18 >= sys-libs/ncurses-5.7
19 >= sys-libs/zlib-1.2
20 >= dev-libs/expat-2
21 >= dev-libs/openssl-1.0.0
22 >= sys-libs/readline-6.1
23 >= dev-db/sqlite-3.7"
24
25 SDEPEND=">= sys-apps/sed-4"
26
27 SRCFILE="${PNAME/py/Py}-${PVER/.0}.tar.bz2"
28 SRCDIR="${BUILDDIR}/${PNAME/py/Py}-${PVER/.0}"
29
30 # disabled modules (needs the gentoo_py_dontcompile patch)
31 export PYTHON_DISABLE_MODULES="gdbm dbm bsddb _tkinter" || die
32
33 # force usage of our CFLAGS
34 export OPT="${CFLAGS}"
35
36 sminclude mtools multilib
37
38 # uses PYVER and sometimes PVER; so keep both
39 SRC_URI=(
40 http://www.python.org/ftp/python/${PVER%.*}/${SRCFILE}
41 http://www.python.org/ftp/python/${PVER}/${SRCFILE}
42 mirror://${PNAME}/${SRCFILE}
43 mirror://${PNAME}/${PNAME}-2.7.0-gentoo_py_dontcompile.patch
44 mirror://${PNAME}/${PNAME}-2.4-disable_modules_and_ssl.patch
45 mirror://${PNAME}/${PNAME}-2.5.0-mimetypes-apache.patch
46 mirror://${PNAME}/${PNAME}-2.7.0-lib64-3.patch
47 )
48
49 # sed line: on 2 digits add an zero: 2.6 -> 2.6.0
50 UP2DATE="updatecmd ${HOMEPAGE}/download/releases/ | grep 'Python .*(.*)' | sed 's/.*Python\ \([0-9].*\) (.*/\1/g;s/\([0-9]\.[0-9]\$\)/\1.0/;q'"
51
52 src_prepare()
53 {
54 munpack ${SRCFILE} || die
55
56 # adds support for PYTHON_DONTCOMPILE shell environment to
57 # supress automatic generation of .pyc and .pyo files
58 mpatch ${PNAME}-2.7.0-gentoo_py_dontcompile.patch || die
59 mpatch ${PNAME}-2.4-disable_modules_and_ssl.patch || die
60 mpatch ${PNAME}-2.5.0-mimetypes-apache.patch || die
61
62 only-m64 mpatch ${PNAME}-2.7.0-lib64-3.patch || die
63 }
64
65 src_compile()
66 {
67 # disable all unneccessary modules
68 export PYTHON_DISABLE_MODULES="dbm _bsddb gdbm _curses _curses_panel readline _sqlite3 _tkinter _elementtree pyexpat"
69 # no ssl
70 export PYTHON_DISABLE_SSL="1"
71
72 mconfigure \
73 --with-fpectl \
74 --enable-shared \
75 --infodir='${prefix}'/share/info \
76 --mandir='${prefix}'/share/man \
77 --with-threads \
78 ${myconf} \
79 || die
80
81 mmake || die
82 }
83
84 src_install()
85 {
86 # install some missing directories
87 minstalldir /usr || die
88
89 mmake DESTDIR=${BINDIR} altinstall || die
90
91 all-abis minstalldir /usr/'$(mlibdir)'/python${PVER%.*}/config || die
92 all-abis minstallfile Makefile.pre.in /usr/'$(mlibdir)'/python${PVER%.*}/config || die
93
94 # remove hardcoded CFLAGS from default Makefile
95 all-abis sed -i 's:^OPT=.*:OPT=-DNDEBUG:' ${BINDIR}/usr/'$(mlibdir)'/python${PVER%.*}/config/Makefile || die
96
97 if [[ ${ARCH} = x86_64 ]]
98 then
99 # move config header
100 all-abis minstallfile pyconfig.h /usr/include/python${PVER%.*}/pyconfig-$(mabi).h || die
101
102 # install a stub header
103 cat > ${BINDIR}/usr/include/python${PVER%.*}/pyconfig.h << "EOF"
104 /* pyconfig.h - Stub Header */
105 #ifndef __STUB__PYCONFIG_H__
106 #define __STUB__PYCONFIG_H__
107
108 #if defined(__x86_64__) || \
109 defined(__sparc64__) || \
110 defined(__arch64__) || \
111 defined(__powerpc64__) || \
112 defined (__s390x__)
113 # include "pyconfig-m64.h"
114 #else
115 # include "pyconfig-m32.h"
116 #endif
117
118 #endif /* __STUB__PYCONFIG_H__ */
119 EOF
120 # install the multiarch-wrapper
121 if [[ -f ${BINDIR}/usr/bin/python${PVER%.*} ]]
122 then
123 rm -f ${BINDIR}/usr/bin/python${PVER%.*} || die
124 fi
125 all-abis minstallexec python /usr/bin/python${PVER%.*}-$(mabi) || die
126 mlink multiarch-wrapper /usr/bin/python${PVER%.*} || die
127 all-abis mlink python${PVER%.*}-$(mabi) /usr/bin/python-$(mabi) || die
128 all-abis mlink python${PVER%.*}-$(mabi) /usr/bin/python2-$(mabi) || die
129 fi
130
131 # link python${PVER%.*}-config to python-config
132 mlink python${PVER%.*}-config /usr/bin/python-config || die
133
134 # link python2.7 binary with python
135 mlink python${PVER%.*} /usr/bin/python || die
136
137 # link python2.7 binary with python2
138 mlink python${PVER%.*} /usr/bin/python2 || die
139
140 minstalldocs LICENSE README || die
141 }