[packages] distribute: make the host build depend on python to ensure that python...
[packages.git] / lang / distribute / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=distribute
11 PKG_VERSION:=0.6.21
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://pypi.python.org/packages/source/d/$(PKG_NAME)/
16 PKG_MD5SUM:=f783444754861f9b33e9f4083bd97b60
17 PKG_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)/
18
19 HOST_BUILD_DEPENDS:=python
20
21 include $(INCLUDE_DIR)/host-build.mk
22 include $(INCLUDE_DIR)/package.mk
23 $(call include_mk, python-package.mk)
24
25 PYTHON:=$(HOST_PYTHON_BIN)
26
27 define Package/distribute
28   SUBMENU:=Python
29   SECTION:=lang
30   CATEGORY:=Languages
31   TITLE:=Distribute
32   URL:=http://pypi.python.org/pypi/distribute
33   DEPENDS:=+python
34   PROVIDES:=setuptools
35 endef
36
37 define Package/distribute/description
38   Distribute (fork of Setuptools) is a collection of extensions to Distutils
39 endef
40
41 define Host/Compile
42         $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
43 endef
44
45 define Host/Install
46         $(INSTALL_DIR) $(STAGING_DIR)$(PYTHON_PKG_DIR)
47         $(CP) \
48             $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
49             $(STAGING_DIR)$(PYTHON_PKG_DIR)/
50 endef
51
52 define Build/Compile
53         $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
54 endef
55
56 define Package/distribute/install
57         $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
58         $(CP) \
59             $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
60             $(1)$(PYTHON_PKG_DIR)/
61         $(INSTALL_DIR) $(1)/usr/bin
62         $(INSTALL_BIN) \
63             $(PKG_INSTALL_DIR)/usr/bin/easy_install \
64             $(1)/usr/bin/
65         $(SED) '1s/#\!.*/#\!\/usr\/bin\/python/' $(1)/usr/bin/easy_install
66 endef
67
68 $(eval $(call HostBuild))
69 $(eval $(call BuildPackage,distribute))