2 # Copyright (C) 2006-2010 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
:=fee5408634a54e721a93531aba37f8c1
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
88 define Package
/python-gdbm
89 $(call Package
/python
/Default
)
90 TITLE
:=Python support for gdbm
91 DEPENDS
+=+python-mini
+libgdbm
94 PY_DISABLED_MODULES
:= \
95 readline _curses _curses_panel _tkinter nis
98 $(TARGET_CONFIGURE_OPTS
) \
99 PYTHON_DISABLE_MODULES
="$(PY_DISABLED_MODULES)" \
100 PYTHON_MODULES_INCLUDE
="$(STAGING_DIR)/usr/include" \
101 PYTHON_MODULES_LIB
="$(STAGING_DIR)/usr/lib" \
103 CFLAGS
="$(TARGET_CFLAGS) -fno-inline" \
104 LDFLAGS
="$(TARGET_LDFLAGS)" \
106 HOSTPYTHON
=.
/hostpython \
107 HOSTPGEN
=.
/hostpgen \
109 define Build
/Configure
113 -$(MAKE
) -C
$(PKG_BUILD_DIR
) distclean
114 (cd
$(PKG_BUILD_DIR
); autoreconf
--force --install || exit
0);
115 (cd
$(PKG_BUILD_DIR
); \
116 rm -rf config.cache
; \
118 OPT
="$(HOST_CFLAGS)" \
119 .
/configure
--without-cxx-main
--without-threads
--prefix=$(PKG_INSTALL_DIR
)/host
; \
121 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
123 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
124 HOSTPYTHON
=$(PKG_BUILD_DIR
)/python \
126 (cd
$(PKG_BUILD_DIR
);mv Parser
/pgen hostpgen
)
127 # The python executable needs to stay in the rootdir since its location will
128 # be used to compute the path of the config files.
129 $(CP
) $(PKG_BUILD_DIR
)/python
$(PKG_BUILD_DIR
)/hostpython
130 $(MAKE
) -C
$(PKG_BUILD_DIR
) distclean
131 $(call Build
/Configure
/Default
, \
137 ac_cv_lib_readline_readline
=no \
138 ac_cv_have_chflags
=no \
139 ac_cv_have_lchflags
=no \
140 ac_cv_py_format_size_t
=no \
141 OPT
="$(TARGET_CFLAGS)" \
143 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
145 DESTDIR
="$(PKG_INSTALL_DIR)" \
149 define Build
/InstallDev
150 $(INSTALL_DIR
) $(1)/mk
$(2)/bin
$(1)/usr
/bin
$(1)/usr
/include $(1)/usr
/lib
151 $(INSTALL_DATA
) .
/files
/python-package.mk
$(1)/mk
/
153 $(PKG_INSTALL_DIR
)/usr
/include/python
$(PYTHON_VERSION
) \
156 $(PKG_INSTALL_DIR
)/host
/lib
/python
$(PYTHON_VERSION
) \
157 $(PKG_BUILD_DIR
)/libpython
$(PYTHON_VERSION
).a \
161 $(PKG_INSTALL_DIR
)/usr
/lib
/python
$(PYTHON_VERSION
)/config \
162 $(1)/usr
/lib
/python
$(PYTHON_VERSION
)/
165 $(PKG_INSTALL_DIR
)/host
/bin
/python \
166 $(1)/usr
/bin
/hostpython
168 ln
-sf ..
/..
/usr
/bin
/hostpython python
$(PYTHON_VERSION
); \
169 ln
-sf python
$(PYTHON_VERSION
) python
)
172 $(PKG_INSTALL_DIR
)/host
/bin
/python
$(PYTHON_VERSION
)-config \
174 $(SED
) 's,^#!.*,#!/usr/bin/env python$(PYTHON_VERSION),g' $(2)/bin
/python
$(PYTHON_VERSION
)-config
177 ln
-sf python
$(PYTHON_VERSION
)-config python-config
;)
180 define PyPackage
/python
/filespec
181 +|
/usr
/bin
/python
$(PYTHON_VERSION
)
182 +|
/usr
/lib
/python
$(PYTHON_VERSION
)
183 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/bsddb
/test
184 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/config
185 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/config
/Makefile
186 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/ctypes
/test
187 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/distutils
/command
/wininst-
*.exe
188 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/distutils
/tests
189 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/email
/test
190 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/idlelib
191 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/json
/tests
192 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-tk
193 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/sqlite3
194 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/test
195 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib2to3
196 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-old
197 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/gdbm.so
198 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_sqlite3.so
199 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_ssl.so
200 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/pyexpat.so
201 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/pydoc_topics.py
202 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/pydoc.py
203 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_ctypes_test.so
204 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_testcapi.so
205 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/__future__.py
206 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/_abcoll.py
207 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/abc.py
208 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/codecs.py
209 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/compileall.py
210 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/ConfigParser.py
211 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/copy.py
212 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/copy_reg.py
213 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/dis.py
214 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/encodings
215 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/fnmatch.py
216 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/genericpath.py
217 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/getopt.py
218 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/glob.py
219 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/hashlib.py
220 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/inspect.py
221 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/array.so
222 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/binascii.so
223 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/cStringIO.so
224 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/fcntl.so
225 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/grp.so
226 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/itertools.so
227 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/math.so
228 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/operator.so
229 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_random.so
230 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/select.so
231 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_socket.so
232 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/strop.so
233 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_struct.so
234 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/syslog.so
235 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/time.so
236 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/unicodedata.so
237 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/zlib.so
238 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_weakref.so
239 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/linecache.py
240 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/md5.py
241 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/new.py
242 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/opcode.py
243 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/optparse.py
244 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/os.py
245 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/pickle.py
246 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/pickle.py
247 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/pkgutil.py
248 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/popen2.py
249 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/posixpath.py
250 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/py_compile.py
251 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/random.py
252 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/repr.py
253 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/re.py
254 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/sha.py
255 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/site.py
256 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/socket.py
257 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/sre_compile.py
258 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/sre_constants.py
259 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/sre_parse.py
260 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/sre.py
261 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/stat.py
262 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/StringIO.py
263 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/stringprep.py
264 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/string.py
265 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/struct.py
266 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/subprocess.py
267 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/tempfile.py
268 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/textwrap.py
269 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/tokenize.py
270 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/token.py
271 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/traceback.py
272 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/types.py
273 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/UserDict.py
274 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/warnings.py
275 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/weakref.py
278 define PyPackage
/python
/install
279 ln
-sf python
$(PYTHON_VERSION
) $(1)/usr
/bin
/python
282 define PyPackage
/python-mini
/filespec
283 +|
/usr
/bin
/python
$(PYTHON_VERSION
)
284 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/__future__.py
285 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/_abcoll.py
286 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/abc.py
287 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/codecs.py
288 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/compileall.py
289 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/ConfigParser.py
290 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/copy.py
291 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/copy_reg.py
292 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/dis.py
293 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/encodings
294 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/fnmatch.py
295 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/genericpath.py
296 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/getopt.py
297 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/glob.py
298 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/hashlib.py
299 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/inspect.py
300 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/array.so
301 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/binascii.so
302 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/cStringIO.so
303 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/fcntl.so
304 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/grp.so
305 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/itertools.so
306 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/math.so
307 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/operator.so
308 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_random.so
309 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/select.so
310 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_socket.so
311 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/strop.so
312 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_struct.so
313 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/syslog.so
314 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/time.so
315 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/unicodedata.so
316 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/zlib.so
317 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_weakref.so
318 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/linecache.py
319 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/md5.py
320 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/new.py
321 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/opcode.py
322 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/optparse.py
323 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/os.py
324 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/pickle.py
325 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/pickle.py
326 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/pkgutil.py
327 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/popen2.py
328 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/posixpath.py
329 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/py_compile.py
330 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/random.py
331 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/repr.py
332 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/re.py
333 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/sha.py
334 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/site.py
335 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/socket.py
336 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/sre_compile.py
337 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/sre_constants.py
338 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/sre_parse.py
339 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/sre.py
340 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/stat.py
341 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/StringIO.py
342 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/stringprep.py
343 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/string.py
344 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/struct.py
345 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/subprocess.py
346 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/tempfile.py
347 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/textwrap.py
348 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/tokenize.py
349 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/token.py
350 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/traceback.py
351 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/types.py
352 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/UserDict.py
353 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/warnings.py
354 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/weakref.py
357 define PyPackage
/python-mini
/install
358 ln
-sf python
$(PYTHON_VERSION
) $(1)/usr
/bin
/python
361 define PyPackage
/python-doc
/filespec
362 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/pydoc_topics.py
363 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/pydoc.py
366 define PyPackage
/python-expat
/filespec
367 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/pyexpat.so
370 define PyPackage
/python-openssl
/filespec
371 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_ssl.so
374 define PyPackage
/python-sqlite3
/filespec
375 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/sqlite3
376 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_sqlite3.so
379 define PyPackage
/python-gdbm
/filespec
380 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/gdbm.so
383 $(eval
$(call PyPackage
,python
))
384 $(eval
$(call PyPackage
,python-mini
))
385 $(eval
$(call PyPackage
,python-doc
))
386 $(eval
$(call PyPackage
,python-expat
))
387 $(eval
$(call PyPackage
,python-openssl
))
388 $(eval
$(call PyPackage
,python-sqlite3
))
389 $(eval
$(call PyPackage
,python-gdbm
))
391 $(eval
$(call BuildPackage
,python
))
392 $(eval
$(call BuildPackage
,python-mini
))
393 $(eval
$(call BuildPackage
,python-doc
))
394 $(eval
$(call BuildPackage
,python-expat
))
395 $(eval
$(call BuildPackage
,python-openssl
))
396 $(eval
$(call BuildPackage
,python-sqlite3
))
397 $(eval
$(call BuildPackage
,python-gdbm
))