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