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.

72 lines
2.0 KiB

  1. #
  2. # Copyright (C) 2007-2017 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-chardet
  9. PKG_VERSION:=3.0.4
  10. PKG_RELEASE:=2
  11. PKG_LICENSE:=LGPL-2.1
  12. PKG_SOURCE:=chardet-$(PKG_VERSION).tar.gz
  13. PKG_SOURCE_URL:=https://pypi.python.org/packages/fc/bb/a5768c230f9ddb03acc9ef3f0d4a3cf93462473795d18e9535498c8f929d/
  14. PKG_HASH:=84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-chardet-$(PKG_VERSION)
  16. include $(INCLUDE_DIR)/package.mk
  17. include ../python-package.mk
  18. include ../python3-package.mk
  19. PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
  20. define Package/python-chardet/Default
  21. SUBMENU:=Python
  22. SECTION:=lang
  23. CATEGORY:=Languages
  24. MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
  25. URL:=https://github.com/chardet/chardet
  26. endef
  27. define Package/python-chardet
  28. $(call Package/python-chardet/Default)
  29. TITLE:=Universal encoding detector for Python 2
  30. DEPENDS:=+PACKAGE_python-chardet:python
  31. VARIANT:=python
  32. endef
  33. define Package/python3-chardet
  34. $(call Package/python-chardet/Default)
  35. TITLE:=Universal encoding detector for Python3
  36. DEPENDS:=+PACKAGE_python3-chardet:python3-light
  37. VARIANT:=python3
  38. endef
  39. define Package/python-chardet/description
  40. Universal encoding detector for Python 2 and 3
  41. endef
  42. define Package/python3-chardet/description
  43. $(call Package/python-chardet/description)
  44. .
  45. (Variant for Python3)
  46. endef
  47. define Py3Package/python3-chardet/install
  48. $(INSTALL_DIR) $(1)/usr/bin
  49. $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  50. for bin in $(1)/usr/bin/*; do \
  51. mv $$$$bin $$$${bin}3 ; \
  52. done
  53. endef
  54. $(eval $(call PyPackage,python-chardet))
  55. $(eval $(call BuildPackage,python-chardet))
  56. $(eval $(call BuildPackage,python-chardet-src))
  57. $(eval $(call Py3Package,python3-chardet))
  58. $(eval $(call BuildPackage,python3-chardet))
  59. $(eval $(call BuildPackage,python3-chardet-src))