2 # Copyright (C) 2006 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:=70084ffa561660f07de466c2c8c4842d
20 PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION)
21 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
23 include $(INCLUDE_DIR)/package.mk
26 _curses _curses_panel _tkinter nis
32 DEPENDS:=+libexpat +libopenssl +libpthread +libreadline +uclibcxx
33 TITLE:=Python 2.5 programming language
34 URL:=http://www.python.org/
37 define Package/python/description
38 Python programming language
39 Python is a dynamic object-oriented programming language that
40 can be used for many kinds of software development. It offers
41 strong support for integration with other languages and tools,
42 comes with extensive standard libraries, and can be learned in a
43 few days. Many Python programmers report substantial productivity
44 gains and feel the language encourages the development of higher
45 quality, more maintainable code.
48 define Build/Configure
49 (cd $(PKG_BUILD_DIR); \
50 rm -rf config.cache; \
52 ./configure --with-threads=no --with-cxx=no; \
53 $(MAKE) python Parser/pgen; \
54 mv python hostpython; \
55 mv Parser/pgen Parser/hostpgen; \
58 $(call Build/Configure/Default, \
64 HOSTPYTHON=./hostpython \
65 HOSTPGEN=./Parser/hostpgen \
70 $(TARGET_CONFIGURE_OPTS) \
71 PYTHON_MODULES_INCLUDE=$(STAGING_DIR)/include \
72 PYTHON_MODULES_LIB=$(STAGING_DIR)/lib \
73 PYTHON_DISABLE_MODULES="$(PY_DISABLED_MODULES)" \
74 CFLAGS="$(TARGET_CFLAGS) -fno-inline" \
75 LDFLAGS="$(TARGET_LDFLAGS)" \
77 HOSTPYTHON=./hostpython \
78 HOSTPGEN=./Parser/hostpgen
81 $(MAKE) -C $(PKG_BUILD_DIR) \
83 DESTDIR="$(PKG_INSTALL_DIR)" \
84 EXTRA_CFLAGS="$(TARGET_CFLAGS) -fno-inline" \
89 define Build/InstallDev
90 mkdir -p $(STAGING_DIR)/usr/bin
91 $(CP) $(PKG_BUILD_DIR)/hostpython $(STAGING_DIR)/usr/bin/
92 mkdir -p $(STAGING_DIR)/usr/include
93 $(CP) $(PKG_INSTALL_DIR)/usr/include/python2.5 $(STAGING_DIR)/usr/include/
94 mkdir -p $(STAGING_DIR)/usr/lib
95 $(CP) $(PKG_INSTALL_DIR)/usr/lib/python2.5 $(STAGING_DIR)/usr/lib/
96 $(CP) $(PKG_BUILD_DIR)/libpython2.5.a $(STAGING_DIR)/usr/lib/python2.5/
99 define Build/UninstallDev
100 rm -rf $(STAGING_DIR)/usr/bin/hostpython \
101 $(STAGING_DIR)/usr/include/python2.5 \
102 $(STAGING_DIR)/usr/lib/python2.5
105 define Package/python/install
106 $(INSTALL_DIR) $(1)/usr/bin
107 $(CP) $(PKG_INSTALL_DIR)/usr/bin/python2.5 $(1)/usr/bin/
108 $(CP) $(PKG_INSTALL_DIR)/usr/bin/python $(1)/usr/bin/
109 $(INSTALL_DIR) $(1)/usr/include/python2.5
110 $(CP) $(PKG_INSTALL_DIR)/usr/include/python2.5/Python.h $(1)/usr/include/python2.5/
111 $(INSTALL_DIR) $(1)/usr/lib
112 $(CP) $(PKG_INSTALL_DIR)/usr/lib/python2.5 $(1)/usr/lib/
113 rm -rf $(1)/usr/lib/python2.5/bsddb/test \
114 $(1)/usr/lib/python2.5/distutils/tests \
115 $(1)/usr/lib/python2.5/email/test \
116 $(1)/usr/lib/python2.5/idlelib \
117 $(1)/usr/lib/python2.5/lib-tk \
118 $(1)/usr/lib/python2.5/sqlite3/test \
119 $(1)/usr/lib/python2.5/ctypes/test \
120 $(1)/usr/lib/python2.5/test
124 $(eval $(call BuildPackage,python))