New echo module for nginx

This commit is contained in:
2021-02-18 11:16:14 +01:00
parent 3ac6129c4a
commit 2cb4a8b55e

View File

@@ -1,6 +1,8 @@
%global _hardened_build 1 %global _hardened_build 1
%global nginx_user nginx %global nginx_user nginx
%global with_ldap_module 1 %global with_ldap_module 1
%global with_echo_module 1
%define mod_echo_vers 0.62
%global with_modsecurity_module 0 %global with_modsecurity_module 0
%global with_vts_module 1 %global with_vts_module 1
%global with_header_more_module 1 %global with_header_more_module 1
@@ -45,6 +47,7 @@ Source14: nginx-upgrade.8
Source15: headers-more-nginx-module-%{headervers}.tar.gz Source15: headers-more-nginx-module-%{headervers}.tar.gz
Source16: set-misc-nginx-module.tar.gz Source16: set-misc-nginx-module.tar.gz
Source17: ngx_devel_kit.tar.gz Source17: ngx_devel_kit.tar.gz
Source18: echo-nginx-module-%{mod_echo_vers}.tar.gz
Source100: index.html Source100: index.html
Source101: poweredby.png Source101: poweredby.png
Source102: nginx-logo.png Source102: nginx-logo.png
@@ -110,6 +113,9 @@ Requires: %{name}-mod-vts = %{epoch}:%{version}-%{release}
%if 0%{?with_header_more_module} %if 0%{?with_header_more_module}
Requires: %{name}-mod-header-more = %{epoch}:%{version}-%{release} Requires: %{name}-mod-header-more = %{epoch}:%{version}-%{release}
%endif %endif
%if 0%{?with_echo_module}
Requires: %{name}-mod-echo = %{epoch}:%{version}-%{release}
%endif
%description all-modules %description all-modules
%{summary}. %{summary}.
@@ -252,6 +258,16 @@ Requires: nginx
Header more module for nginx Header more module for nginx
%endif %endif
%if 0%{?with_echo_module}
%package mod-echo
Group: System Environment/Daemons
Summary: Nginx echo more module
Requires: nginx
%description mod-echo
Echo module for nginx
%endif
%prep %prep
%if 0%{?with_vts_module} %if 0%{?with_vts_module}
%setup -q -b 6 -n nginx-module-vts-%{vtsversion} %setup -q -b 6 -n nginx-module-vts-%{vtsversion}
@@ -269,11 +285,11 @@ Header more module for nginx
%setup -q -b 16 -n set-misc-nginx-module-master %setup -q -b 16 -n set-misc-nginx-module-master
%setup -q -b 17 -n ngx_devel_kit-master %setup -q -b 17 -n ngx_devel_kit-master
%endif %endif
%setup -q %if 0%{?with_echo_module}
%setup -q -b 18 -n echo-nginx-module-%{mod_echo_vers}
%endif
%setup -q -b 0 -n nginx-%{version}
%patch0 -p0 %patch0 -p0
#%if 0%{?fedora} > 27
#%patch1 -p1
#%endif
cp %{SOURCE200} %{SOURCE210} %{SOURCE10} %{SOURCE12} . cp %{SOURCE200} %{SOURCE210} %{SOURCE10} %{SOURCE12} .
%if 0%{?rhel} > 0 && 0%{?rhel} < 8 %if 0%{?rhel} > 0 && 0%{?rhel} < 8
@@ -346,6 +362,9 @@ export DESTDIR=%{buildroot}
%if 0%{?with_header_more_module} %if 0%{?with_header_more_module}
--add-dynamic-module=%{_builddir}/headers-more-nginx-module-%{headervers} \ --add-dynamic-module=%{_builddir}/headers-more-nginx-module-%{headervers} \
%endif %endif
%if 0%{?with_set_misc_module}
--add-dynamic-module=%{_builddir}/echo-nginx-module-%{mod_echo_vers} \
%endif
%if 0%{?with_modsecurity_module} %if 0%{?with_modsecurity_module}
--add-dynamic-module=%{_builddir}/modsecurity-nginx-%{modsecver} \ --add-dynamic-module=%{_builddir}/modsecurity-nginx-%{modsecver} \
--with-compat \ --with-compat \
@@ -451,6 +470,10 @@ echo 'load_module "%{_libdir}/nginx/modules/ngx_http_modsecurity_module.so";' \
echo 'load_module "%{_libdir}/nginx/modules/ngx_http_headers_more_filter_module.so";' \ echo 'load_module "%{_libdir}/nginx/modules/ngx_http_headers_more_filter_module.so";' \
> %{buildroot}%{_datadir}/nginx/modules/mod-header-more.conf > %{buildroot}%{_datadir}/nginx/modules/mod-header-more.conf
%endif %endif
%if 0%{?with_echo_module}
echo 'load_module "%{_libdir}/nginx/modules/ngx_http_echo_module.so";' \
> %{buildroot}%{_datadir}/nginx/modules/mod-echo.conf
%endif
%if 0%{?with_set_misc_module} %if 0%{?with_set_misc_module}
echo 'load_module "%{_libdir}/nginx/modules/ndk_http_module.so";' \ echo 'load_module "%{_libdir}/nginx/modules/ndk_http_module.so";' \
> %{buildroot}%{_datadir}/nginx/modules/mod-set-misc.conf > %{buildroot}%{_datadir}/nginx/modules/mod-set-misc.conf
@@ -526,6 +549,13 @@ if [ $1 -eq 1 ]; then
fi fi
%endif %endif
%if 0%{?with_echo_module}
%post mod-echo
if [ $1 -eq 1 ]; then
/usr/bin/systemctl reload nginx.service >/dev/null 2>&1 || :
fi
%endif
%if 0%{?with_set_misc_module} %if 0%{?with_set_misc_module}
%post mod-set-misc %post mod-set-misc
if [ $1 -eq 1 ]; then if [ $1 -eq 1 ]; then
@@ -636,6 +666,12 @@ fi
%{_libdir}/nginx/modules/ngx_http_headers_more_filter_module.so %{_libdir}/nginx/modules/ngx_http_headers_more_filter_module.so
%endif %endif
%if 0%{?with_echo_module}
%files mod-echo
%{_datadir}/nginx/modules/mod-echo.conf
%{_libdir}/nginx/modules/ngx_http_echo_module.so
%endif
%if 0%{?with_set_misc_module} %if 0%{?with_set_misc_module}
%files mod-set-misc %files mod-set-misc
%{_datadir}/nginx/modules/mod-set-misc.conf %{_datadir}/nginx/modules/mod-set-misc.conf
@@ -658,8 +694,11 @@ fi
[ "%{_builddir}" != "/" ] && [ -d "%{_builddir}" ] && rm -rf %{_builddir}/* [ "%{_builddir}" != "/" ] && [ -d "%{_builddir}" ] && rm -rf %{_builddir}/*
%changelog %changelog
* Thu Feb 18 2021 Daniel Steiner <daniel.steiner@threema.ch>
- New ngx_echo_module added.
* Tue Feb 9 2021 Daniel Steiner <daniel.steiner@threema.ch> * Tue Feb 9 2021 Daniel Steiner <daniel.steiner@threema.ch>
- Upadate to version 1.19.6 on CentOS 8. - Upadate to version 1.19.6 on CentOS 8 (nginx:mainline module!)
- New ngx_http_set_misc_module added. - New ngx_http_set_misc_module added.
* Thu Jan 16 2020 Daniel Steiner <daniel.steiner@threema.ch> * Thu Jan 16 2020 Daniel Steiner <daniel.steiner@threema.ch>