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.

168 lines
4.4 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=uwsgi
  3. PKG_VERSION:=2.0.18
  4. PKG_RELEASE:=2
  5. PYPI_NAME:=$(PKG_NAME)
  6. PKG_HASH:=4972ac538800fb2d421027f49b4a1869b66048839507ccf0aa2fda792d99f583
  7. PKG_BUILD_DEPENDS:=python3/host
  8. PYTHON3_PKG_BUILD:=0
  9. PKG_LICENSE:=GPL-2.0-or-later
  10. PKG_LICENSE_FILES:=LICENSE
  11. PKG_MAINTAINER:=Ansuel Smith <ansuelsmth@gmail.com>
  12. include ../../lang/python/pypi.mk
  13. include $(INCLUDE_DIR)/package.mk
  14. include ../../lang/python/python3-package.mk
  15. #for LINUX_UNAME_VERSION:
  16. include $(INCLUDE_DIR)/kernel.mk
  17. define Package/uwsgi
  18. SECTION:=net
  19. CATEGORY:=Network
  20. SUBMENU:=Web Servers/Proxies
  21. TITLE:=The uWSGI server
  22. URL:=https://uwsgi-docs.readthedocs.io/en/latest/
  23. DEPENDS:=+libpcre +libcap +libuuid
  24. MENU:=1
  25. endef
  26. define Package/uwsgi-logfile-plugin
  27. SECTION:=net
  28. CATEGORY:=Network
  29. SUBMENU:=Web Servers/Proxies
  30. TITLE:=The Logfile plugin for the uWSGI server
  31. DEPENDS:=uwsgi
  32. MDEPENDS:=uwsgi
  33. endef
  34. define Package/uwsgi-syslog-plugin
  35. SECTION:=net
  36. CATEGORY:=Network
  37. SUBMENU:=Web Servers/Proxies
  38. TITLE:=The Syslog plugin for the uWSGI server
  39. DEPENDS:=uwsgi
  40. MDEPENDS:=uwsgi
  41. endef
  42. define Package/uwsgi-cgi-plugin
  43. SECTION:=net
  44. CATEGORY:=Network
  45. SUBMENU:=Web Servers/Proxies
  46. TITLE:=The CGI plugin for the uWSGI server
  47. DEPENDS:=uwsgi
  48. MDEPENDS:=uwsgi
  49. endef
  50. define Package/uwsgi-python3-plugin
  51. SECTION:=net
  52. CATEGORY:=Network
  53. SUBMENU:=Web Servers/Proxies
  54. TITLE:=The Python3 plugin for the uWSGI server
  55. DEPENDS:=uwsgi +python3-light
  56. MDEPENDS:=uwsgi
  57. endef
  58. define Package/uwsgi-luci-support
  59. SECTION:=net
  60. CATEGORY:=Network
  61. SUBMENU:=Web Servers/Proxies
  62. TITLE:=Support files for LuCI on Nginx
  63. DEPENDS:=uwsgi +uwsgi-syslog-plugin +uwsgi-cgi-plugin
  64. MDEPENDS:=uwsgi
  65. endef
  66. define Package/uwsgi/description
  67. The uWSGI project (to be used together with nginx or nginx-ssl).
  68. endef
  69. define Package/uwsgi-logfile-plugin/description
  70. The Logfile plugin for the uWSGI project.
  71. endef
  72. define Package/uwsgi-syslog-plugin/description
  73. The Syslog plugin for the uWSGI project.
  74. endef
  75. define Package/uwsgi-cgi-plugin/description
  76. The CGI plugin for the uWSGI project.
  77. endef
  78. define Package/uwsgi-python3-plugin/description
  79. The Python3 plugin for the uWSGI project.
  80. endef
  81. define Package/uwsgi-luci-support/description
  82. Support files for LuCI on Nginx
  83. endef
  84. MAKE_VARS+=\
  85. CPP=$(TARGET_CROSS)cpp \
  86. PYTHON=$(STAGING_DIR_HOSTPKG)/bin/python3 \
  87. LINUX_UNAME_VERSION=$(LINUX_UNAME_VERSION)
  88. define Build/Compile
  89. $(call Build/Compile/Default,PROFILE=openwrt)
  90. $(call Build/Compile/Default,plugin.logfile PROFILE=openwrt)
  91. $(call Build/Compile/Default,plugin.syslog PROFILE=openwrt)
  92. $(call Build/Compile/Default,plugin.cgi PROFILE=openwrt)
  93. $(call Python3/Run, \
  94. $(PKG_BUILD_DIR), \
  95. uwsgiconfig.py --plugin plugins/python openwrt, \
  96. CPP="$(TARGET_CROSS)cpp" \
  97. LINUX_UNAME_VERSION=$(LINUX_UNAME_VERSION) \
  98. CFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON3_INC_DIR) $(TARGET_CFLAGS)" \
  99. )
  100. endef
  101. define Package/uwsgi/install
  102. $(INSTALL_DIR) $(1)/usr/sbin
  103. $(INSTALL_BIN) $(PKG_BUILD_DIR)/uwsgi $(1)/usr/sbin/
  104. $(INSTALL_DIR) $(1)/etc/init.d
  105. $(INSTALL_BIN) ./files/uwsgi.init $(1)/etc/init.d/uwsgi
  106. $(INSTALL_DIR) $(1)/etc/uwsgi
  107. $(INSTALL_CONF) ./files/emperor.ini $(1)/etc/uwsgi/emperor.ini
  108. $(INSTALL_DIR) $(1)/etc/uwsgi/vassals
  109. endef
  110. define Package/uwsgi/conffiles
  111. /etc/uwsgi/emperor.ini
  112. endef
  113. define Package/uwsgi-logfile-plugin/install
  114. $(INSTALL_DIR) $(1)/usr/lib/uwsgi
  115. $(CP) $(PKG_BUILD_DIR)/logfile_plugin.so $(1)/usr/lib/uwsgi/
  116. endef
  117. define Package/uwsgi-syslog-plugin/install
  118. $(INSTALL_DIR) $(1)/usr/lib/uwsgi
  119. $(CP) $(PKG_BUILD_DIR)/syslog_plugin.so $(1)/usr/lib/uwsgi/
  120. endef
  121. define Package/uwsgi-cgi-plugin/install
  122. $(INSTALL_DIR) $(1)/usr/lib/uwsgi
  123. $(CP) $(PKG_BUILD_DIR)/cgi_plugin.so $(1)/usr/lib/uwsgi/
  124. endef
  125. define Package/uwsgi-python3-plugin/install
  126. $(INSTALL_DIR) $(1)/usr/lib/uwsgi
  127. $(INSTALL_BIN) $(PKG_BUILD_DIR)/python_plugin.so $(1)/usr/lib/uwsgi/
  128. endef
  129. define Package/uwsgi-luci-support/install
  130. $(INSTALL_DIR) $(1)/etc/uwsgi/vassals
  131. $(INSTALL_DATA) ./files-luci-support/luci-webui.ini $(1)/etc/uwsgi/vassals/luci-webui.ini
  132. $(INSTALL_DATA) ./files-luci-support/luci-cgi_io.ini $(1)/etc/uwsgi/vassals/luci-cgi_io.ini
  133. endef
  134. $(eval $(call BuildPackage,uwsgi))
  135. $(eval $(call BuildPackage,uwsgi-logfile-plugin))
  136. $(eval $(call BuildPackage,uwsgi-syslog-plugin))
  137. $(eval $(call BuildPackage,uwsgi-cgi-plugin))
  138. $(eval $(call BuildPackage,uwsgi-python3-plugin))
  139. $(eval $(call BuildPackage,uwsgi-luci-support))