Magellan Linux

Contents of /trunk/extras/python3/python3-3.3.2-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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