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