From c0c9bf37f645901b6e0ba93e69118845521c141f Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Tue, 6 Nov 2018 18:20:48 +0100 Subject: [PATCH] Add ndk and lua 3rd party modules --- nginx.spec | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/nginx.spec b/nginx.spec index 88d452e..67d5546 100644 --- a/nginx.spec +++ b/nginx.spec @@ -1,6 +1,9 @@ %global _hardened_build 1 %global nginx_user nginx +%define lua_version 0.10.3 +%define ndk_version 0.3.0 + # gperftools exist only on selected arches %ifnarch s390 s390x %global with_gperftools 1 @@ -39,6 +42,9 @@ Source104: 50x.html Source200: README.dynamic Source210: UPGRADE-NOTES-1.6-to-1.10 +Source300: lua-nginx-module-%{lua_version}.tar.gz +Source301: ngx_devel_kit-%{ndk_version}.tar.gz + # removes -Werror in upstream build scripts. -Werror conflicts with # -D_FORTIFY_SOURCE=2 causing warnings to turn into errors. Patch0: nginx-auto-cc-gcc.patch @@ -168,9 +174,37 @@ Requires: nginx %description mod-stream %{summary}. +%package mod-http-lua +Summary: nginx lua dynamic modules +Version: %{version}.%{lua_version} +Release: %{release} +URL: https://github.com/openresty/lua-nginx-module +Group: System Environment/Daemons +License: BSD license +BuildRequires: luajit-devel +Requires: luajit +Requires: nginx-mod-ndk +Requires: nginx == %{?epoch:%{epoch}:}%{version} + +%description mod-http-lua +nginx lua dynamic modules. + +%package mod-ndk +Summary: nginx ndk dynamic modules +Version: %{version}.%{ndk_version} +Release: %{release} +URL: https://github.com/simpl/ngx_devel_kit +Group: System Environment/Daemons +License: The BSD 3-Clause License +Requires: nginx == %{?epoch:%{epoch}:}%{version} + +%description mod-ndk +nginx ndk dynamic modules. %prep %setup -q +%setup -q -T -D %{Source300} +%setup -q -T -D %{Source301} %patch0 -p0 cp %{SOURCE200} . @@ -239,7 +273,9 @@ export DESTDIR=%{buildroot} %endif --with-debug \ --with-cc-opt="%{optflags} $(pcre-config --cflags)" \ - --with-ld-opt="$RPM_LD_FLAGS -Wl,-E" # so the perl module finds its symbols + --with-ld-opt="$RPM_LD_FLAGS -Wl,-E" \ + --add-dynamic-module=lua-nginx-module-%{lua_version} \ + --add-dynamic-module=ngx_devel_kit-%{ndk_version} make %{?_smp_mflags} @@ -304,6 +340,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 +echo 'load_module "%{_libdir}/nginx/modules/ndk_http_module.so";' \ + > %{buildroot}%{_datadir}/nginx/modules/mod-ndk.conf +echo 'load_module "%{_libdir}/nginx/modules/ngx_http_lua_module.so";' \ + > %{buildroot}%{_datadir}/nginx/modules/mod-lua.conf %pre filesystem getent group %{nginx_user} > /dev/null || groupadd -r %{nginx_user} @@ -345,6 +385,16 @@ if [ $1 -eq 1 ]; then /usr/bin/systemctl reload nginx.service >/dev/null 2>&1 || : fi +%post mod-http-lua +if [ $1 -eq 1 ]; then + /usr/bin/systemctl reload nginx.service >/dev/null 2>&1 || : +fi + +%post mod-ndk +if [ $1 -eq 1 ]; then + /usr/bin/systemctl reload nginx.service >/dev/null 2>&1 || : +fi + %preun %systemd_preun nginx.service @@ -429,6 +479,13 @@ fi %{_datadir}/nginx/modules/mod-stream.conf %{_libdir}/nginx/modules/ngx_stream_module.so +%files mod-http-lua +%{_datadir}/nginx/modules/mod-lua.conf +%{_libdir}/nginx/modules/ngx_http_lua_module.so + +%files mod-ndk +%{_datadir}/nginx/modules/mod-ndk.conf +%{_libdir}/nginx/modules/ndk_http_module.so %changelog * Tue Nov 06 2018 Daniel Berteaud 1.12.2-20.beta1