a5fbc59ba9a00fc2ce79c72a8045f5cf3e64f424
[feed/packages.git] / net / uwsgi / Makefile
1 include $(TOPDIR)/rules.mk
2
3 PKG_NAME:=uwsgi
4 PKG_VERSION:=2.0.25.1
5 PKG_RELEASE:=1
6
7 PYPI_NAME:=uWSGI
8 PYPI_SOURCE_NAME:=uwsgi
9 PKG_HASH:=d653d2d804c194c8cbe2585fa56efa2650313ae75c686a9d7931374d4dfbfc6e
10
11 PKG_LICENSE:=GPL-2.0-or-later
12 PKG_LICENSE_FILES:=LICENSE
13 PKG_MAINTAINER:=Ansuel Smith <ansuelsmth@gmail.com>
14
15 PKG_BUILD_DEPENDS:=python3/host
16 PYTHON3_PKG_BUILD:=0
17
18 PKG_CONFIG_DEPENDS:= \
19 CONFIG_PACKAGE_uwsgi-logfile-plugin \
20 CONFIG_PACKAGE_uwsgi-syslog-plugin \
21 CONFIG_PACKAGE_uwsgi-cgi-plugin \
22 CONFIG_PACKAGE_uwsgi-python3-plugin \
23 CONFIG_PACKAGE_uwsgi-luci-support
24
25 include ../../lang/python/pypi.mk
26 include $(INCLUDE_DIR)/package.mk
27 include ../../lang/python/python3-package.mk
28 #for LINUX_UNAME_VERSION:
29 include $(INCLUDE_DIR)/kernel.mk
30
31 define Package/uwsgi
32 SECTION:=net
33 CATEGORY:=Network
34 SUBMENU:=Web Servers/Proxies
35 TITLE:=The uWSGI server
36 URL:=https://uwsgi-docs.readthedocs.io/en/latest/
37 DEPENDS:=+libpcre2 +libcap +libuuid
38 endef
39
40 define Package/uwsgi-logfile-plugin
41 SECTION:=net
42 CATEGORY:=Network
43 SUBMENU:=Web Servers/Proxies
44 TITLE:=The Logfile plugin for the uWSGI server
45 DEPENDS:=uwsgi
46 endef
47
48 define Package/uwsgi-syslog-plugin
49 SECTION:=net
50 CATEGORY:=Network
51 SUBMENU:=Web Servers/Proxies
52 TITLE:=The Syslog plugin for the uWSGI server
53 DEPENDS:=uwsgi
54 endef
55
56 define Package/uwsgi-cgi-plugin
57 SECTION:=net
58 CATEGORY:=Network
59 SUBMENU:=Web Servers/Proxies
60 TITLE:=The CGI plugin for the uWSGI server
61 DEPENDS:=uwsgi
62 endef
63
64 define Package/uwsgi-python3-plugin
65 SECTION:=net
66 CATEGORY:=Network
67 SUBMENU:=Web Servers/Proxies
68 TITLE:=The Python3 plugin for the uWSGI server
69 DEPENDS:=uwsgi +python3-light
70 endef
71
72 define Package/uwsgi-luci-support
73 SECTION:=net
74 CATEGORY:=Network
75 SUBMENU:=Web Servers/Proxies
76 TITLE:=Support files for LuCI on Nginx
77 DEPENDS:=uwsgi +uwsgi-syslog-plugin +uwsgi-cgi-plugin
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 LINUX_UNAME_VERSION=$(LINUX_UNAME_VERSION)
107
108 MAKE_FLAGS+= PROFILE=openwrt
109
110 define Build/Compile
111 $(call Build/Compile/Default)
112
113 ifneq ($(CONFIG_PACKAGE_uwsgi-logfile-plugin),)
114 $(call Build/Compile/Default,plugin.logfile)
115 endif
116
117 ifneq ($(CONFIG_PACKAGE_uwsgi-syslog-plugin),)
118 $(call Build/Compile/Default,plugin.syslog)
119 endif
120
121 ifneq ($(CONFIG_PACKAGE_uwsgi-cgi-plugin),)
122 $(call Build/Compile/Default,plugin.cgi)
123 endif
124
125 ifneq ($(CONFIG_PACKAGE_uwsgi-python3-plugin),)
126 $(call Python3/Run, \
127 $(PKG_BUILD_DIR), \
128 uwsgiconfig.py --plugin plugins/python openwrt, \
129 $(MAKE_VARS) \
130 CFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON3_INC_DIR) $(TARGET_CFLAGS)" \
131 )
132 endif
133 endef
134
135 define Package/uwsgi/install
136 $(INSTALL_DIR) $(1)/usr/sbin
137 $(INSTALL_BIN) $(PKG_BUILD_DIR)/uwsgi $(1)/usr/sbin/
138
139 $(INSTALL_DIR) $(1)/etc/init.d
140 $(INSTALL_BIN) ./files/uwsgi.init $(1)/etc/init.d/uwsgi
141
142 $(INSTALL_DIR) $(1)/etc/uwsgi
143 $(INSTALL_CONF) ./files/emperor.ini $(1)/etc/uwsgi/emperor.ini
144
145 $(INSTALL_DIR) $(1)/etc/uwsgi/vassals
146 endef
147
148 define Package/uwsgi/conffiles
149 /etc/uwsgi/emperor.ini
150 endef
151
152 define Package/uwsgi-logfile-plugin/install
153 $(INSTALL_DIR) $(1)/usr/lib/uwsgi
154 $(CP) $(PKG_BUILD_DIR)/logfile_plugin.so $(1)/usr/lib/uwsgi/
155 endef
156
157 define Package/uwsgi-syslog-plugin/install
158 $(INSTALL_DIR) $(1)/usr/lib/uwsgi
159 $(CP) $(PKG_BUILD_DIR)/syslog_plugin.so $(1)/usr/lib/uwsgi/
160 endef
161
162 define Package/uwsgi-cgi-plugin/install
163 $(INSTALL_DIR) $(1)/usr/lib/uwsgi
164 $(CP) $(PKG_BUILD_DIR)/cgi_plugin.so $(1)/usr/lib/uwsgi/
165 endef
166
167 define Package/uwsgi-python3-plugin/install
168 $(INSTALL_DIR) $(1)/usr/lib/uwsgi
169 $(INSTALL_BIN) $(PKG_BUILD_DIR)/python_plugin.so $(1)/usr/lib/uwsgi/
170 endef
171
172 define Package/uwsgi-luci-support/install
173 $(INSTALL_DIR) $(1)/etc/uwsgi/vassals
174 $(INSTALL_DATA) ./files-luci-support/luci-webui.ini $(1)/etc/uwsgi/vassals/luci-webui.ini
175 $(INSTALL_DATA) ./files-luci-support/luci-cgi_io.ini $(1)/etc/uwsgi/vassals/luci-cgi_io.ini
176 endef
177
178 $(eval $(call BuildPackage,uwsgi))
179 $(eval $(call BuildPackage,uwsgi-logfile-plugin))
180 $(eval $(call BuildPackage,uwsgi-syslog-plugin))
181 $(eval $(call BuildPackage,uwsgi-cgi-plugin))
182 $(eval $(call BuildPackage,uwsgi-python3-plugin))
183 $(eval $(call BuildPackage,uwsgi-luci-support))