From 7b48e1beb98119cb8e1c1e9ef59e1a5a36eb82f6 Mon Sep 17 00:00:00 2001 From: Daniel Steiner Date: Fri, 25 Oct 2019 14:24:27 +0200 Subject: [PATCH] New vhost traffic module added (vts) --- fedora/SPECS/nginx.spec | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/fedora/SPECS/nginx.spec b/fedora/SPECS/nginx.spec index ef1c13f..d83d5c7 100644 --- a/fedora/SPECS/nginx.spec +++ b/fedora/SPECS/nginx.spec @@ -2,7 +2,9 @@ %global nginx_user nginx %global with_ldap_module 1 %global with_modsecurity_module 1 +%global with_vts_module 1 %global modsecver 3.0.2 +%global vtsversion 0.1.18 # gperftools exist only on selected arches %ifnarch s390 s390x @@ -33,6 +35,7 @@ Source2: modsecurity-nginx-%{modsecver}.tar.gz Source3: modsecurity.conf Source4: main.conf Source5: rules.conf +Source6: nginx-module-vts-%{vtsversion}.tar.gz Source10: nginx.service Source11: nginx.logrotate Source12: nginx.conf @@ -96,6 +99,7 @@ Requires: nginx-mod-mail = %{epoch}:%{version}-%{release} Requires: nginx-mod-stream = %{epoch}:%{version}-%{release} Requires: nginx-mod-auth-ldap = %{epoch}:%{version}-%{release} Requires: nginx-mod-modsecurity = %{epoch}:%{version}-%{release} +Requires: nginx-modules-vts = %{epoch}:%{version}-%{release} %description all-modules %{summary}. @@ -178,6 +182,16 @@ Requires: nginx %description mod-stream %{summary}. +%if 0%{?with_vts_module} +%package mod-vts +Group: System Environment/Daemons +Summary: Nginx VTS module +Requires: nginx + +%description mod-vts +Nginx virtual host traffic status module +%endif + %if 0%{?with_ldap_module} %package mod-auth-ldap Group: System Environment/Daemons @@ -201,8 +215,13 @@ Modsecurity module for nginx %endif %prep +%if 0%{?with_vts_module} +%setup -q -b 6 -n nginx-module-vts-%{vtsversion} +%endif %if 0%{?with_ldap_module} %setup -q -b 1 -n ngx_http_auth_ldap_module +%endif +%if 0%{?with_modsecurity_module} %setup -q -b 2 -n modsecurity-nginx-%{modsecver} %endif %setup -q @@ -270,6 +289,9 @@ export DESTDIR=%{buildroot} --with-pcre-jit \ --with-stream=dynamic \ --with-stream_ssl_module \ +%if 0%{?with_vts_module} + --add-dynamic-module=%{_builddir}/nginx-module-vts-%{vtsversion} \ +%endif %if 0%{?with_gperftools} --with-google_perftools_module \ %endif @@ -361,6 +383,10 @@ echo 'load_module "%{_libdir}/nginx/modules/ngx_mail_module.so";' \ > %{buildroot}%{_datadir}/nginx/modules/mod-mail.conf echo 'load_module "%{_libdir}/nginx/modules/ngx_stream_module.so";' \ > %{buildroot}%{_datadir}/nginx/modules/mod-stream.conf +%if 0%{?with_vts_module} +echo 'load_module "%{_libdir}/nginx/modules/ngx_http_vhost_traffic_status_module.so";' \ + > %{buildroot}%{_datadir}/nginx/modules/mod-vts.conf +%endif %if 0%{?with_ldap_module} echo 'load_module "%{_libdir}/nginx/modules/ngx_http_auth_ldap_module.so";' \ > %{buildroot}%{_datadir}/nginx/modules/mod-http_auth-ldap.conf @@ -410,6 +436,13 @@ if [ $1 -eq 1 ]; then /usr/bin/systemctl reload nginx.service >/dev/null 2>&1 || : fi +%if 0%{?with_vts_module} +%post mod-vts +if [ $1 -eq 1 ]; then + /usr/bin/systemctl reload nginx.service >/dev/null 2>&1 || : +fi +%endif + %if 0%{?with_ldap_module} %post mod-auth-ldap if [ $1 -eq 1 ]; then @@ -508,6 +541,12 @@ fi %{_datadir}/nginx/modules/mod-stream.conf %{_libdir}/nginx/modules/ngx_stream_module.so +%if 0%{?with_vts_module} +%files mod-vts +%{_datadir}/nginx/modules/mod-vts.conf +%{_libdir}/nginx/modules/ngx_http_vhost_traffic_status_module.so +%endif + %if 0%{?with_ldap_module} %files mod-auth-ldap %{_datadir}/nginx/modules/mod-http_auth-ldap.conf