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.

103 lines
3.0 KiB

  1. #
  2. # Copyright (C) 2006-2011, 2015-2018 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-twisted
  9. PKG_VERSION:=19.2.1
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=Twisted-$(PKG_VERSION).tar.bz2
  12. PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/source/T/Twisted
  13. PKG_HASH:=fa2c04c2d68a9be7fc3975ba4947f653a57a656776f24be58ff0fe4b9aaf3e52
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-twisted-$(PKG_VERSION)
  15. PKG_BUILD_DEPENDS:=libtirpc
  16. PKG_LICENSE:=MIT
  17. PKG_LICENSE_FILES:=LICENSE
  18. PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
  19. include $(INCLUDE_DIR)/package.mk
  20. include ../python-package.mk
  21. include ../python3-package.mk
  22. PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xjf $(DL_DIR)/$(PKG_SOURCE)
  23. define Package/python-twisted/Default
  24. SECTION:=lang
  25. CATEGORY:=Languages
  26. SUBMENU:=Python
  27. TITLE:=Asynchronous networking framework
  28. URL:=https://twistedmatrix.com/
  29. endef
  30. define Package/python-twisted
  31. $(call Package/python-twisted/Default)
  32. DEPENDS:= \
  33. +PACKAGE_python-twisted:python-light \
  34. +PACKAGE_python-twisted:python-attrs \
  35. +PACKAGE_python-twisted:python-automat \
  36. +PACKAGE_python-twisted:python-constantly \
  37. +PACKAGE_python-twisted:python-incremental \
  38. +PACKAGE_python-twisted:python-hyperlink \
  39. +PACKAGE_python-twisted:python-setuptools \
  40. +PACKAGE_python-twisted:python-zope-interface
  41. VARIANT:=python
  42. endef
  43. define Package/python3-twisted
  44. $(call Package/python-twisted/Default)
  45. DEPENDS:= \
  46. +PACKAGE_python3-twisted:python3-light \
  47. +PACKAGE_python3-twisted:python3-attrs \
  48. +PACKAGE_python3-twisted:python3-automat \
  49. +PACKAGE_python3-twisted:python3-constantly \
  50. +PACKAGE_python3-twisted:python3-incremental \
  51. +PACKAGE_python3-twisted:python3-hyperlink \
  52. +PACKAGE_python3-twisted:python3-setuptools \
  53. +PACKAGE_python3-twisted:python3-zope-interface
  54. VARIANT:=python3
  55. endef
  56. define Package/python-twisted/description
  57. Twisted is a networking engine written in Python, supporting numerous
  58. protocols. It contains a web server, numerous chat clients, chat servers,
  59. mail servers, and more.
  60. endef
  61. define Package/python3-twisted/description
  62. $(call Package/python-twisted/description)
  63. .
  64. (Variant for Python3)
  65. endef
  66. define PyPackage/python-twisted/filespec
  67. +|$(PYTHON_PKG_DIR)
  68. -|$(PYTHON_PKG_DIR)/twisted/conch/scripts/tkconch.py
  69. endef
  70. define Py3Package/python3-twisted/filespec
  71. +|$(PYTHON3_PKG_DIR)
  72. -|$(PYTHON3_PKG_DIR)/twisted/conch/scripts/tkconch.py
  73. endef
  74. define Py3Package/python3-twisted/install
  75. $(INSTALL_DIR) $(1)/usr/bin
  76. $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  77. for bin in $(1)/usr/bin/*; do \
  78. mv $$$$bin $$$${bin}3 ; \
  79. done
  80. endef
  81. $(eval $(call PyPackage,python-twisted))
  82. $(eval $(call BuildPackage,python-twisted))
  83. $(eval $(call BuildPackage,python-twisted-src))
  84. $(eval $(call Py3Package,python3-twisted))
  85. $(eval $(call BuildPackage,python3-twisted))
  86. $(eval $(call BuildPackage,python3-twisted-src))