add python package (contributed by Pavlov Media)
[openwrt/svn-archive/archive.git] / lang / python / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=python
4 PKG_VERSION:=2.4.3
5 PKG_RELEASE:=1
6
7 PKG_SOURCE:=Python-$(PKG_VERSION).tar.bz2
8 PKG_SOURCE_URL:=http://www.python.org/ftp/python/2.4.3/
9 PKG_MD5SUM:=141c683447d5e76be1d2bd4829574f02
10 PKG_CAT:=bzcat
11
12 PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION)
13
14 include $(INCLUDE_DIR)/package.mk
15
16 define Package/python
17 SECTION:=lang
18 CATEGORY:=Languages
19 TITLE:=Python programming language
20 URL:=http://www.python.org
21 DEPENDS:=+uclibcxx
22 endef
23
24 define Package/python/description
25 Python programming language
26 Python is a dynamic object-oriented programming language that
27 can be used for many kinds of software development. It offers
28 strong support for integration with other languages and tools,
29 comes with extensive standard libraries, and can be learned in a
30 few days. Many Python programmers report substantial productivity
31 gains and feel the language encourages the development of higher
32 quality, more maintainable code.
33 endef
34
35 define Build/Configure
36 (cd $(PKG_BUILD_DIR); \
37 CONFIG_SITE= \
38 ./configure --with-threads=no; \
39 $(MAKE) python Parser/pgen; \
40 mv python hostpython; \
41 mv Parser/pgen Parser/hostpgen; \
42 make distclean; \
43 echo "import sys" > $(PKG_BUILD_DIR)/setup.py.new; \
44 echo "sys.path.append('$(PKG_BUILD_DIR)/Lib')" >> $(PKG_BUILD_DIR)/setup.py.new; \
45 cat $(PKG_BUILD_DIR)/setup.py.new $(PKG_BUILD_DIR)/setup.py > $(PKG_BUILD_DIR)/setup.py.foo; \
46 mv $(PKG_BUILD_DIR)/setup.py.foo $(PKG_BUILD_DIR)/setup.py; \
47 rm $(PKG_BUILD_DIR)/setup.py.new; \
48 );
49 $(call Build/Configure/Default, \
50 --disable-shared \
51 --sysconfdir=/etc \
52 --with-threads=no, \
53 HOSTPYTHON=./hostpython \
54 HOSTPGEN=./Parser/hostpgen \
55 )
56 endef
57
58 MAKE_OPTS= \
59 $(TARGET_CONFIGURE_OPTS) \
60 CFLAGS="$(TARGET_CFLAGS)" \
61 LD_LIBRARY_PATH="$(STAGING_DIR)/lib:$(LD_LIBRARY_PATH)" \
62 LD="$(TARGET_CC)" \
63 HOSTPYTHON=./hostpython \
64 HOSTPGEN=./Parser/hostpgen
65
66 define Build/Compile
67 $(MAKE) -C $(PKG_BUILD_DIR) \
68 DESTDIR="$(PKG_INSTALL_DIR)" \
69 $(MAKE_OPTS) \
70 all
71 endef
72
73 define Package/python/install
74 mkdir -p $(1)/lib
75 $(MAKE) -C $(PKG_BUILD_DIR) \
76 $(MAKE_OPTS) \
77 DESTDIR="$(1)" \
78 install
79 endef
80
81 $(eval $(call BuildPackage,python))