You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
1.9 KiB

  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=python-pip
  9. PKG_VERSION:=1.5.6
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=pip-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://pypi.python.org/packages/source/p/pip/
  13. PKG_MD5SUM:=01026f87978932060cc86c1dc527903e
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/pip-$(PKG_VERSION)
  15. PKG_USE_MIPS16:=0
  16. include $(INCLUDE_DIR)/package.mk
  17. $(call include_mk, python-package.mk)
  18. define Package/python-pip
  19. SUBMENU:=Python
  20. SECTION:=lang
  21. CATEGORY:=Languages
  22. TITLE:=Tool for installing Python packages.
  23. URL:=https://pip.pypa.io
  24. DEPENDS:=+python +python-setuptools
  25. endef
  26. define Package/python-pip/description
  27. A tool for installing and managing Python packages.
  28. endef
  29. define Build/Compile
  30. $(call Build/Compile/PyMod,,\
  31. install --prefix="$(PKG_INSTALL_DIR)/usr" \
  32. )
  33. endef
  34. PYTHON_PIP_PKG_DIR:=$(PYTHON_PKG_DIR)/pip-$(PKG_VERSION)-py$(PYTHON_VERSION).egg/pip
  35. define PyPackage/python-pip/filespec
  36. +|$(PYTHON_PKG_DIR)
  37. -|$(PYTHON_PIP_PKG_DIR)/_vendor/distlib/*.exe
  38. endef
  39. # Backup these files, so that they do not clash with python-setuptools
  40. # If we install python-pip python-setuptools, we want these to be replaced,
  41. # since python-pip replaces python-setuptools (when installed)
  42. define Package/python-pip/preinst
  43. #!/bin/sh
  44. cd "$${IPKG_INSTROOT}$(PYTHON_PKG_DIR)"
  45. mv -f easy-install.pth easy-install.pth.old
  46. mv -f site.py site.py.old
  47. exit 0
  48. endef
  49. # And put them back on remove
  50. define Package/python-pip/postrm
  51. #!/bin/sh
  52. cd "$${IPKG_INSTROOT}$(PYTHON_PKG_DIR)"
  53. mv -f easy-install.pth.old easy-install.pth
  54. mv -f site.py.old site.py
  55. exit 0
  56. endef
  57. define PyPackage/python-pip/install
  58. $(INSTALL_DIR) $(1)/usr/bin
  59. $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
  60. endef
  61. $(eval $(call PyPackage,python-pip))
  62. $(eval $(call BuildPackage,python-pip))