MODULES+=	encrypted-session

MODULE_SUMMARY_encrypted_session=	3rd-party encrypted session dynamic module

include $(CONTRIB)/src/ngx_devel_kit/version
include $(CONTRIB)/src/encrypted-session-nginx-module/version

MODULE_VERSION_encrypted_session=	$(ENCRYPTED_SESSION_NGINX_MODULE_VERSION)
MODULE_RELEASE_encrypted_session=	1

MODULE_VERSION_PREFIX_encrypted_session=$(MODULE_TARGET_PREFIX)

MODULE_SOURCES_encrypted_session= 	ngx_devel_kit-$(NGX_DEVEL_KIT_VERSION).tar.gz \
					encrypted-session-nginx-module-$(ENCRYPTED_SESSION_NGINX_MODULE_VERSION).tar.gz

MODULE_CONFARGS_encrypted_session=	--add-dynamic-module=$(MODSRC_PREFIX)ngx_devel_kit-$(NGX_DEVEL_KIT_VERSION) \
					--add-dynamic-module=$(MODSRC_PREFIX)encrypted-session-nginx-module-$(ENCRYPTED_SESSION_NGINX_MODULE_VERSION)

.deps-module-encrypted-session:
	cd $(CONTRIB) && make \
		.sum-ngx_devel_kit \
		.sum-encrypted-session-nginx-module
	touch $@

prerequisites-for-module-encrypted-session: module-ndk

MODULE_DEPENDS_encrypted_session=$(NDK_DEPENDENCY_TAG)

define MODULE_PREINSTALL_encrypted_session
	rm -f objs/ndk_http_module-debug.so
	rm -f objs/ndk_http_module.so
endef
export MODULE_PREINSTALL_encrypted_session

define MODULE_POST_encrypted_session
cat <<BANNER
----------------------------------------------------------------------

The $(MODULE_SUMMARY_encrypted_session) for $(MODULE_SUMMARY_PREFIX) has been installed.
To enable this module, add the following to /etc/nginx/nginx.conf
and reload nginx:

    load_module modules/ndk_http_module.so;
    load_module modules/ngx_http_encrypted_session_module.so;

Note that ndk_http_module.so must be placed first.

Please refer to the modules documentation for further details:
https://github.com/openresty/encrypted-session-nginx-module

----------------------------------------------------------------------
BANNER
endef
export MODULE_POST_encrypted_session
