2 # Copyright (C) 2006-2008 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=Python-
$(PKG_VERSION
).
tar.bz2
15 PKG_SOURCE_URL
:=http
://www.python.org
/ftp
/python
/$(PKG_VERSION
)/
16 PKG_MD5SUM
:=e81c2f0953aa60f8062c05a4673f2be0
18 PKG_BUILD_DIR
:=$(BUILD_DIR
)/Python-
$(PKG_VERSION
)
20 include $(INCLUDE_DIR
)/package.mk
21 -include $(if
$(DUMP
),,.
/files
/python-package.mk
)
23 define Package
/python
/Default
27 TITLE
:=Python
$(PYTHON_VERSION
) programming language
28 URL
:=http
://www.python.org
/
31 define Package
/python
/Default
/description
32 Python is a dynamic object-oriented programming language that can be used
33 for many kinds of software development. It offers strong support for
34 integration with other languages and tools
, comes with extensive standard
35 libraries
, and can be learned in a few days. Many Python programmers
36 report substantial productivity gains and feel the language encourages
37 the development of higher quality
, more maintainable code.
41 $(call Package
/python
/Default
)
43 DEPENDS
:=+libpthread
+zlib
+PACKAGE_python
:libffi
+python-mini
46 define Package
/python
/description
47 $(call Package
/python
/Default
/description
)
49 This package contains the full Python
install.
52 define Package
/python-mini
53 $(call Package
/python
/Default
)
55 DEPENDS
:=+libpthread
+zlib
58 define Package
/python-mini
/description
59 $(call Package
/python
/Default
/description
)
61 This package contains only a minimal Python
install.
64 define Package
/python-doc
65 $(call Package
/python
/Default
)
66 TITLE
:=Python interactive documentation
70 define Package
/python-expat
71 $(call Package
/python
/Default
)
72 TITLE
:=Python support for expat
73 DEPENDS
+=+python-mini
+libexpat
76 define Package
/python-openssl
77 $(call Package
/python
/Default
)
78 TITLE
:=Python support for OpenSSL
79 DEPENDS
+=+python-mini
+libopenssl
82 define Package
/python-sqlite3
83 $(call Package
/python
/Default
)
84 TITLE
:=Python support for sqlite3
85 DEPENDS
+=+python-mini
+libsqlite3
89 PY_DISABLED_MODULES
:= \
90 readline _curses _curses_panel _tkinter nis
93 $(TARGET_CONFIGURE_OPTS
) \
94 PYTHON_DISABLE_MODULES
="$(PY_DISABLED_MODULES)" \
95 PYTHON_MODULES_INCLUDE
="$(STAGING_DIR)/usr/include" \
96 PYTHON_MODULES_LIB
="$(STAGING_DIR)/usr/lib" \
98 CFLAGS
="$(TARGET_CFLAGS) -fno-inline" \
99 LDFLAGS
="$(TARGET_LDFLAGS)" \
101 HOSTPYTHON
=.
/hostpython \
102 HOSTPGEN
=.
/hostpgen \
104 define Build
/Configure
108 -$(MAKE
) -C
$(PKG_BUILD_DIR
) distclean
109 (cd
$(PKG_BUILD_DIR
); autoreconf
--force --install || exit
0);
110 (cd
$(PKG_BUILD_DIR
); \
111 rm -rf config.cache
; \
113 OPT
="$(HOST_CFLAGS)" \
114 .
/configure
--without-cxx-main
--without-threads
--prefix=$(PKG_INSTALL_DIR
)/host
; \
116 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
118 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
119 HOSTPYTHON
=$(PKG_BUILD_DIR
)/python \
121 (cd
$(PKG_BUILD_DIR
);mv Parser
/pgen hostpgen
)
122 # The python executable needs to stay in the rootdir since its location will
123 # be used to compute the path of the config files.
124 $(CP
) $(PKG_BUILD_DIR
)/python
$(PKG_BUILD_DIR
)/hostpython
125 $(MAKE
) -C
$(PKG_BUILD_DIR
) distclean
126 $(call Build
/Configure
/Default
, \
133 ac_cv_lib_readline_readline
=no \
134 ac_cv_have_chflags
=no \
135 ac_cv_have_lchflags
=no \
136 ac_cv_py_format_size_t
=no \
137 OPT
="$(TARGET_CFLAGS)" \
139 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
141 DESTDIR
="$(PKG_INSTALL_DIR)" \
145 define Build
/InstallDev
146 $(INSTALL_DIR
) $(1)/mk
$(2)/bin
$(1)/usr
/bin
$(1)/usr
/include $(1)/usr
/lib
147 $(INSTALL_DATA
) .
/files
/python-package.mk
$(1)/mk
/
149 $(PKG_INSTALL_DIR
)/usr
/include/python
$(PYTHON_VERSION
) \
152 $(PKG_INSTALL_DIR
)/host
/lib
/python
$(PYTHON_VERSION
) \
153 $(PKG_BUILD_DIR
)/libpython
$(PYTHON_VERSION
).a \
157 $(PKG_INSTALL_DIR
)/usr
/lib
/python
$(PYTHON_VERSION
)/config \
158 $(1)/usr
/lib
/python
$(PYTHON_VERSION
)/
161 $(PKG_INSTALL_DIR
)/host
/bin
/python \
162 $(1)/usr
/bin
/hostpython
164 ln
-sf ..
/..
/usr
/bin
/hostpython python
$(PYTHON_VERSION
); \
165 ln
-sf python
$(PYTHON_VERSION
) python
)
168 $(PKG_INSTALL_DIR
)/host
/bin
/python
$(PYTHON_VERSION
)-config \
170 $(SED
) 's,^#!.*,#!/usr/bin/env python$(PYTHON_VERSION),g' $(2)/bin
/python
$(PYTHON_VERSION
)-config
173 ln
-sf python
$(PYTHON_VERSION
)-config python-config
;)
176 define PyPackage
/python
/filespec
177 +|
/usr
/bin
/python
$(PYTHON_VERSION
)
178 +|
/usr
/lib
/python
$(PYTHON_VERSION
)
179 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/bsddb
/test
180 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/config
181 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/config
/Makefile
182 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/ctypes
/test
183 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/distutils
/command
/wininst-
*.exe
184 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/distutils
/tests
185 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/email
/test
186 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/idlelib
187 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/json
/tests
188 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-tk
189 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/sqlite3
190 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/test
191 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib2to3
192 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-old
193 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_sqlite3.so
194 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_ssl.so
195 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/pyexpat.so
196 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/pydoc_topics.py
197 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/pydoc.py
198 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_ctypes_test.so
199 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_testcapi.so
200 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/__future__.py
201 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/_abcoll.py
202 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/abc.py
203 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/codecs.py
204 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/compileall.py
205 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/ConfigParser.py
206 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/copy.py
207 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/copy_reg.py
208 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/dis.py
209 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/encodings
210 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/fnmatch.py
211 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/genericpath.py
212 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/getopt.py
213 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/glob.py
214 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/hashlib.py
215 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/inspect.py
216 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/array.so
217 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/binascii.so
218 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/cStringIO.so
219 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/fcntl.so
220 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/grp.so
221 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/itertools.so
222 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/math.so
223 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/operator.so
224 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_random.so
225 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/select.so
226 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_socket.so
227 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/strop.so
228 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_struct.so
229 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/syslog.so
230 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/time.so
231 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/unicodedata.so
232 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/zlib.so
233 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_weakref.so
234 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/linecache.py
235 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/md5.py
236 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/new.py
237 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/opcode.py
238 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/optparse.py
239 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/os.py
240 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/pickle.py
241 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/pickle.py
242 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/pkgutil.py
243 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/popen2.py
244 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/posixpath.py
245 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/py_compile.py
246 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/random.py
247 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/repr.py
248 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/re.py
249 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/sha.py
250 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/site.py
251 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/socket.py
252 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/sre_compile.py
253 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/sre_constants.py
254 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/sre_parse.py
255 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/sre.py
256 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/stat.py
257 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/StringIO.py
258 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/stringprep.py
259 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/string.py
260 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/struct.py
261 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/subprocess.py
262 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/tempfile.py
263 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/textwrap.py
264 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/tokenize.py
265 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/token.py
266 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/traceback.py
267 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/types.py
268 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/UserDict.py
269 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/warnings.py
270 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/weakref.py
273 define PyPackage
/python
/install
274 ln
-sf python
$(PYTHON_VERSION
) $(1)/usr
/bin
/python
277 define PyPackage
/python-mini
/filespec
278 +|
/usr
/bin
/python
$(PYTHON_VERSION
)
279 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/__future__.py
280 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/_abcoll.py
281 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/abc.py
282 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/codecs.py
283 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/compileall.py
284 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/ConfigParser.py
285 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/copy.py
286 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/copy_reg.py
287 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/dis.py
288 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/encodings
289 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/fnmatch.py
290 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/genericpath.py
291 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/getopt.py
292 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/glob.py
293 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/hashlib.py
294 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/inspect.py
295 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/array.so
296 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/binascii.so
297 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/cStringIO.so
298 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/fcntl.so
299 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/grp.so
300 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/itertools.so
301 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/math.so
302 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/operator.so
303 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_random.so
304 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/select.so
305 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_socket.so
306 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/strop.so
307 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_struct.so
308 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/syslog.so
309 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/time.so
310 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/unicodedata.so
311 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/zlib.so
312 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_weakref.so
313 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/linecache.py
314 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/md5.py
315 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/new.py
316 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/opcode.py
317 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/optparse.py
318 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/os.py
319 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/pickle.py
320 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/pickle.py
321 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/pkgutil.py
322 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/popen2.py
323 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/posixpath.py
324 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/py_compile.py
325 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/random.py
326 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/repr.py
327 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/re.py
328 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/sha.py
329 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/site.py
330 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/socket.py
331 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/sre_compile.py
332 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/sre_constants.py
333 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/sre_parse.py
334 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/sre.py
335 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/stat.py
336 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/StringIO.py
337 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/stringprep.py
338 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/string.py
339 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/struct.py
340 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/subprocess.py
341 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/tempfile.py
342 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/textwrap.py
343 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/tokenize.py
344 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/token.py
345 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/traceback.py
346 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/types.py
347 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/UserDict.py
348 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/warnings.py
349 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/weakref.py
352 define PyPackage
/python-mini
/install
353 ln
-sf python
$(PYTHON_VERSION
) $(1)/usr
/bin
/python
356 define PyPackage
/python-doc
/filespec
357 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/pydoc_topics.py
358 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/pydoc.py
361 define PyPackage
/python-expat
/filespec
362 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/pyexpat.so
365 define PyPackage
/python-openssl
/filespec
366 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_ssl.so
369 define PyPackage
/python-sqlite3
/filespec
370 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/sqlite3
371 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_sqlite3.so
374 $(eval
$(call PyPackage
,python
))
375 $(eval
$(call PyPackage
,python-mini
))
376 $(eval
$(call PyPackage
,python-doc
))
377 $(eval
$(call PyPackage
,python-expat
))
378 $(eval
$(call PyPackage
,python-openssl
))
379 $(eval
$(call PyPackage
,python-sqlite3
))
381 $(eval
$(call BuildPackage
,python
))
382 $(eval
$(call BuildPackage
,python-mini
))
383 $(eval
$(call BuildPackage
,python-doc
))
384 $(eval
$(call BuildPackage
,python-expat
))
385 $(eval
$(call BuildPackage
,python-openssl
))
386 $(eval
$(call BuildPackage
,python-sqlite3
))