Magellan Linux

Contents of /branches/R11-stable/extras/python3/python3-3.3.2-r3.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 19619 - (show annotations) (download)
Mon Oct 7 08:29:47 2013 UTC (10 years, 11 months ago) by niro
File size: 4606 byte(s)
-release branches/R11-stable
1 # $Id$
2
3 PNAME="python3"
4 PVER="3.3.2"
5 PBUILD="r3"
6
7 PCAT="dev-lang"
8
9 DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language."
10 HOMEPAGE="http://www.python.org/"
11
12 DEPEND_x86_64=">= sys-apps/multiarch-wrapper-1"
13 SPECIAL_VARS="DEPEND_x86_64"
14
15 DEPEND="$(marchdepend)
16 >= virtual/glibc
17 >= sys-libs/ncurses-5.9
18 >= sys-libs/zlib-1.2
19 >= dev-libs/expat-2
20 >= dev-libs/openssl-1.0.1
21 >= sys-libs/readline-6.2
22 >= dev-db/db-6.0
23 >= dev-db/sqlite-3.7
24 >= app-arch/bzip2-1.0.6
25 >= dev-libs/libffi-3.0.13"
26
27 SDEPEND=">= virtual/sed"
28
29 SRCFILE="Python-${PVER/.0}.tar.bz2"
30 SRCDIR="${BUILDDIR}/Python-${PVER/.0}"
31
32 # disabled modules (needs the disable_modules patch)
33 export PYTHON_DISABLE_MODULES="gdbm dbm bsddb _tkinter" || die
34
35 # force usage of our CFLAGS
36 export OPT="${CFLAGS}"
37
38 # optimized ABIFLAGS is set to m = malloc in our builds
39 export PYTHON_ABIFLAGS="m"
40
41 sminclude mtools multilib
42 msetfeature "!check"
43
44 # uses PYVER and sometimes PVER; so keep both
45 SRC_URI=(
46 http://www.python.org/ftp/python/${PVER%.*}/${SRCFILE}
47 http://www.python.org/ftp/python/${PVER}/${SRCFILE}
48 mirror://python/${SRCFILE}
49 mirror://python/python-3.3.2-disable_modules_and_ssl.patch
50 mirror://python/python-2.5.0-mimetypes-apache.patch
51 mirror://python/python-3.3.2-lib64.patch
52 mirror://python/python-3.3.2-CVE-2013-2099.patch
53 )
54
55 # sed line: on 2 digits add an zero: 2.6 -> 2.6.0
56 UP2DATE="updatecmd ${HOMEPAGE}/download/releases/ | grep 'Python .*(.*)' | sed 's/.*Python\ \([0-9].*\) (.*/\1/g;s/\([0-9]\.[0-9]\$\)/\1.0/;q'"
57
58 src_prepare()
59 {
60 munpack ${SRCFILE} || die
61
62 # security fix
63 mpatch python-3.3.2-CVE-2013-2099.patch || die
64
65 mpatch python-3.3.2-disable_modules_and_ssl.patch || die
66 mpatch python-2.5.0-mimetypes-apache.patch || die
67
68 only-m64 mpatch python-3.3.2-lib64.patch || die
69
70 # ensure to use system-wide copies of expat, zlib and libffi
71 # rather than copies shipped in the tarball
72 all-abis 'rm -r Modules/expat || die'
73 all-abis 'rm -r Modules/zlib || die'
74 all-abis 'rm -r Modules/_ctypes/{darwin,libffi}* || die'
75 }
76
77 src_compile()
78 {
79 mconfigure \
80 --enable-shared \
81 --enable-ipv6 \
82 --infodir=/usr/share/info \
83 --mandir=/usr/share/man \
84 --with-threads \
85 --with-computed-gotos \
86 --with-system-expat \
87 --with-system-ffi \
88 || die
89
90 mmake || die
91 }
92
93 src_install()
94 {
95 # install some missing directories
96 minstalldir /usr || die
97
98 mmake DESTDIR=${BINDIR} altinstall || die
99
100 all-abis minstalldir /usr/'$(mlibdir)'/python${PVER%.*}/config-${PVER%.*}${PYTHON_ABIFLAGS} || die
101 all-abis minstallfile Makefile.pre.in /usr/'$(mlibdir)'/python${PVER%.*}/config-${PVER%.*}${PYTHON_ABIFLAGS} || die
102
103 # remove hardcoded CFLAGS from default Makefile
104 all-abis sed -i 's:^OPT=.*:OPT=-DNDEBUG:' ${BINDIR}/usr/'$(mlibdir)'/python${PVER%.*}/config-${PVER%.*}${PYTHON_ABIFLAGS}/Makefile || die
105
106 if [[ $(mlibdir) != lib ]]
107 then
108 # move config header
109 all-abis minstallfile pyconfig.h /usr/include/python${PVER%.*}${PYTHON_ABIFLAGS}/pyconfig-$(mabi).h || die
110
111 # install a stub header
112 cat > ${BINDIR}/usr/include/python${PVER%.*}${PYTHON_ABIFLAGS}/pyconfig.h << "EOF"
113 /* pyconfig.h - Stub Header */
114 #ifndef __STUB__PYCONFIG_H__
115 #define __STUB__PYCONFIG_H__
116
117 #if defined(__x86_64__) || \
118 defined(__sparc64__) || \
119 defined(__arch64__) || \
120 defined(__powerpc64__) || \
121 defined (__s390x__)
122 # include "pyconfig-m64.h"
123 #else
124 # include "pyconfig-m32.h"
125 #endif
126
127 #endif /* __STUB__PYCONFIG_H__ */
128 EOF
129 # install the multiarch-wrapper
130 for exec in python${PVER%.*} python${PVER%.*}${PYTHON_ABIFLAGS}
131 do
132 if [[ -f ${BINDIR}/usr/bin/${exec} ]]
133 then
134 rm -f ${BINDIR}/usr/bin/${exec} || die
135 fi
136 all-abis minstallexec python /usr/bin/${exec}-$(mabi) || die
137 mlink multiarch-wrapper /usr/bin/${exec} || die
138 # not our default python
139 #all-abis mlink ${exec} /usr/bin/python-$(mabi) || die
140 all-abis mlink ${exec}-$(mabi) /usr/bin/${exec/${PVER%.*}/${PVER:0:1}}-$(mabi) || die
141 done
142 fi
143
144 # not our default python
145 # # link python3.3m-config to python-config
146 # mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python-config || die
147
148 # link python3.3m-config to python3.3-config
149 mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python${PVER%.*}-config || die
150
151 # link python3.3m-config to python3-config
152 mlink python${PVER%.*}${PYTHON_ABIFLAGS}-config /usr/bin/python${PVER:0:1}-config || die
153
154 # not our default python
155 # # link python3.3 binary with python
156 # mlink python${PVER%.*} /usr/bin/python || die
157
158 # link python3.3 binary with python3
159 mlink python${PVER%.*} /usr/bin/python${PVER:0:1} || die
160
161 minstalldocs LICENSE README || die
162 }