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
:=394a5f56a5ce811fb0f023197ec0833e
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
2.5 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
+libffi
48 define Package
/python
/description
49 $(call Package
/python
/Default
/description
)
51 This package contains the full Python
install.
54 define Package
/python-mini
55 $(call Package
/python
/Default
)
57 DEPENDS
:=+libpthread
+zlib
61 define Package
/python-mini
/description
62 $(call Package
/python
/Default
/description
)
64 This package contains only a minimal Python
install.
67 define Package
/python-doc
68 $(call Package
/python
/Default
)
69 TITLE
:=Python interactive documentation
73 define Package
/python-expat
74 $(call Package
/python
/Default
)
75 TITLE
:=Python support for expat
76 DEPENDS
+= python-core
+libexpat
79 define Package
/python-openssl
80 $(call Package
/python
/Default
)
81 TITLE
:=Python support for OpenSSL
82 DEPENDS
+= python-core
+libopenssl
86 PY_DISABLED_MODULES
:= \
87 readline _curses _curses_panel _tkinter nis
90 $(TARGET_CONFIGURE_OPTS
) \
91 PYTHON_DISABLE_MODULES
="$(PY_DISABLED_MODULES)" \
92 PYTHON_MODULES_INCLUDE
="$(STAGING_DIR)/usr/include" \
93 PYTHON_MODULES_LIB
="$(STAGING_DIR)/usr/lib" \
95 CFLAGS
="$(TARGET_CFLAGS) -fno-inline" \
96 LDFLAGS
="$(TARGET_LDFLAGS)" \
98 HOSTPYTHON
=.
/hostpython \
101 define Build
/Configure
105 -$(MAKE
) -C
$(PKG_BUILD_DIR
) distclean
106 (cd
$(PKG_BUILD_DIR
); \
107 rm -rf config.cache
; \
109 OPT
="$(HOST_CFLAGS)" \
110 .
/configure
--without-cxx-main
--without-threads
--prefix=$(PKG_INSTALL_DIR
)/host
; \
112 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
114 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
115 HOSTPYTHON
=$(PKG_BUILD_DIR
)/python \
117 (cd
$(PKG_BUILD_DIR
);mv Parser
/pgen hostpgen
)
119 # The python executable needs to stay in the rootdir since its location will
120 # be used to compute the path of the config files.
121 $(CP
) $(PKG_BUILD_DIR
)/python
$(PKG_BUILD_DIR
)/hostpython
122 $(MAKE
) -C
$(PKG_BUILD_DIR
) distclean
124 $(call Build
/Configure
/Default
, \
131 ac_cv_lib_readline_readline
=no \
132 OPT
="$(TARGET_CFLAGS)" \
134 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
136 DESTDIR
="$(PKG_INSTALL_DIR)" \
140 define Build
/InstallDev
141 $(INSTALL_DIR
) $(1)/mk
$(2)/bin
$(1)/usr
/bin
$(1)/usr
/include $(1)/usr
/lib
142 $(INSTALL_DATA
) .
/files
/python-package.mk
$(1)/mk
/
144 $(PKG_INSTALL_DIR
)/usr
/include/python
$(PYTHON_VERSION
) \
147 $(PKG_INSTALL_DIR
)/host
/lib
/python
$(PYTHON_VERSION
) \
148 $(PKG_BUILD_DIR
)/libpython
$(PYTHON_VERSION
).a \
152 $(PKG_INSTALL_DIR
)/usr
/lib
/python
$(PYTHON_VERSION
)/config \
153 $(1)/usr
/lib
/python
$(PYTHON_VERSION
)/
156 $(PKG_INSTALL_DIR
)/host
/bin
/python \
157 $(1)/usr
/bin
/hostpython
159 ln
-sf ..
/..
/usr
/bin
/hostpython python
$(PYTHON_VERSION
); \
160 ln
-sf python
$(PYTHON_VERSION
) python
)
163 $(PKG_INSTALL_DIR
)/host
/bin
/python
$(PYTHON_VERSION
)-config \
165 $(SED
) 's,^#!.*,#!/usr/bin/env python2.5,g' $(2)/bin
/python
$(PYTHON_VERSION
)-config
168 ln
-sf python
$(PYTHON_VERSION
)-config python-config
;)
171 define PyPackage
/python
/filespec
172 +|
/usr
/bin
/python
$(PYTHON_VERSION
)
173 +|
/usr
/include/python
$(PYTHON_VERSION
)/pyconfig.h
174 +|
/usr
/lib
/python
$(PYTHON_VERSION
)
175 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/bsddb
/test
176 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/config
177 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/config
/Makefile
178 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/ctypes
/test
179 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/distutils
/command
/wininst-
*.exe
180 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/distutils
/tests
181 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/email
/test
182 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/idlelib
183 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-tk
184 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/sqlite3
/test
185 -|
/usr
/lib
/python
$(PYTHON_VERSION
)/test
188 define PyPackage
/python
/install
189 ln
-sf python
$(PYTHON_VERSION
) $(1)/usr
/bin
/python
192 define PyPackage
/python-mini
/filespec
193 +|
/usr
/bin
/python
$(PYTHON_VERSION
)
194 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/__future__.py
195 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/codecs.py
196 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/compileall.py
197 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/ConfigParser.py
198 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/copy.py
199 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/copy_reg.py
200 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/dis.py
201 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/encodings
202 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/fnmatch.py
203 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/getopt.py
204 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/glob.py
205 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/hashlib.py
206 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/inspect.py
207 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/array.so
208 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/binascii.so
209 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/cStringIO.so
210 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/fcntl.so
211 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/grp.so
212 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/itertools.so
213 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/math.so
214 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/operator.so
215 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_random.so
216 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/select.so
217 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_socket.so
218 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/strop.so
219 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_struct.so
220 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/syslog.so
221 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/time.so
222 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/unicodedata.so
223 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/zlib.so
224 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/linecache.py
225 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/md5.py
226 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/opcode.py
227 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/optparse.py
228 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/os.py
229 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/pickle.py
230 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/pickle.py
231 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/pkgutil.py
232 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/popen2.py
233 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/posixpath.py
234 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/py_compile.py
235 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/random.py
236 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/repr.py
237 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/re.py
238 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/sha.py
239 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/site.py
240 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/socket.py
241 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/sre_compile.py
242 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/sre_constants.py
243 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/sre_parse.py
244 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/sre.py
245 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/stat.py
246 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/StringIO.py
247 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/stringprep.py
248 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/string.py
249 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/struct.py
250 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/subprocess.py
251 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/tempfile.py
252 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/textwrap.py
253 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/tokenize.py
254 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/token.py
255 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/traceback.py
256 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/types.py
257 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/UserDict.py
258 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/warnings.py
261 define PyPackage
/python-mini
/install
262 ln
-sf python
$(PYTHON_VERSION
) $(1)/usr
/bin
/python
265 define PyPackage
/python-doc
/filespec
266 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/pydoc.py
269 define PyPackage
/python-expat
/filespec
270 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/pyexpat.so
273 define PyPackage
/python-openssl
/filespec
274 +|
/usr
/lib
/python
$(PYTHON_VERSION
)/lib-dynload
/_ssl.so
277 $(eval
$(call PyPackage
,python
))
278 $(eval
$(call PyPackage
,python-mini
))
279 $(eval
$(call PyPackage
,python-doc
))
280 $(eval
$(call PyPackage
,python-expat
))
281 $(eval
$(call PyPackage
,python-openssl
))
283 $(eval
$(call BuildPackage
,python
))
284 $(eval
$(call BuildPackage
,python-mini
))
285 $(eval
$(call BuildPackage
,python-doc
))
286 $(eval
$(call BuildPackage
,python-expat
))
287 $(eval
$(call BuildPackage
,python-openssl
))