python-setuptools: add ability to install on host
[feed/packages.git] / lang / python-setuptools / Makefile
1 #
2 # Copyright (C) 2014 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:=python-setuptools
11 PKG_VERSION:=18.5
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=setuptools-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://pypi.python.org/packages/source/s/setuptools/
16 PKG_MD5SUM:=533c868f01169a3085177dffe5e768bb
17
18 HOST_BUILD_DEPENDS:=python/host
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/setuptools-$(PKG_VERSION)
21 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/setuptools-$(PKG_VERSION)
22
23 include $(INCLUDE_DIR)/host-build.mk
24 include $(INCLUDE_DIR)/package.mk
25 $(call include_mk, python-package.mk)
26 $(call include_mk, python-host.mk)
27
28 define Package/python-setuptools
29 SUBMENU:=Python
30 SECTION:=lang
31 CATEGORY:=Languages
32 TITLE:=Tool for installing Python packages.
33 URL:=https://bitbucket.org/pypa/setuptools
34 DEPENDS:=+python
35 MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
36 endef
37
38 define Package/python-setuptools/description
39 Easily download, build, install, upgrade, and uninstall Python packages
40 endef
41
42 define Build/Compile
43 $(call Build/Compile/PyMod,,\
44 install --root="$(PKG_INSTALL_DIR)" --prefix="/usr" \
45 --single-version-externally-managed \
46 )
47 endef
48
49 define Build/InstallDev
50 $(INSTALL_DIR) $(PYTHON_LIB_DIR)
51 $(CP) \
52 $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
53 $(PYTHON_LIB_DIR)
54 endef
55
56 define PyPackage/python-setuptools/install
57 $(INSTALL_DIR) $(1)/usr/bin
58 $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
59 endef
60
61 define Host/Compile
62 $(call Build/Compile/HostPyMod,,\
63 install --root="$(STAGING_DIR_HOST)" --prefix="" \
64 --single-version-externally-managed \
65 )
66 endef
67
68 define Host/Install
69 endef
70
71 $(eval $(call HostBuild))
72
73 $(eval $(call PyPackage,python-setuptools))
74 $(eval $(call BuildPackage,python-setuptools))
75