PKG_NAME:=nginx
PKG_VERSION:=1.25.4
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://nginx.org/download/
Support file for LuCI in nginx. Include custom nginx configuration, autostart script for uwsgi.
endef
+define Package/nginx-mod-luci/preinst
+#!/bin/sh
+grep -r -l ngx_http_ubus_module.so /etc/nginx/module.d | grep -v ngx_http_ubus.module | while read file; do
+ echo "Removing old LuCI module load file for 'ngx_http_ubus.so' in $$file."
+ rm -f $$file
+done
+exit 0
+endef
+
define Package/nginx-mod-luci/install
$(INSTALL_DIR) $(1)/etc/nginx/conf.d
$(INSTALL_CONF) ./files-luci-support/luci.locations $(1)/etc/nginx/conf.d/
define Package/nginx-mod-$(1)/install
$(INSTALL_DIR) $$(1)/usr/lib/nginx/modules
+ $(INSTALL_DIR) $$(1)/etc/nginx/module.d
$(foreach m,$(3),
- $(CP) $$(PKG_INSTALL_DIR)/usr/lib/nginx/modules/$(m)_module.so $$(1)/usr/lib/nginx/modules
+ $(CP) $$(PKG_INSTALL_DIR)/usr/lib/nginx/modules/$(m)_module.so $$(1)/usr/lib/nginx/modules && \
+ echo "load_module /usr/lib/nginx/modules/$(m)_module.so;" > $$(1)/etc/nginx/module.d/$(m).module
)
$(call Module/nginx-mod-$(1)/install,$$(1))
endef