Add ndk and lua 3rd party modules

tags/nginx-1.12.2-20.beta2
Daniel Berteaud 6 years ago
parent cd97d8e085
commit c0c9bf37f6
  1. 59
      nginx.spec

@ -1,6 +1,9 @@
%global _hardened_build 1 %global _hardened_build 1
%global nginx_user nginx %global nginx_user nginx
%define lua_version 0.10.3
%define ndk_version 0.3.0
# gperftools exist only on selected arches # gperftools exist only on selected arches
%ifnarch s390 s390x %ifnarch s390 s390x
%global with_gperftools 1 %global with_gperftools 1
@ -39,6 +42,9 @@ Source104: 50x.html
Source200: README.dynamic Source200: README.dynamic
Source210: UPGRADE-NOTES-1.6-to-1.10 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 # removes -Werror in upstream build scripts. -Werror conflicts with
# -D_FORTIFY_SOURCE=2 causing warnings to turn into errors. # -D_FORTIFY_SOURCE=2 causing warnings to turn into errors.
Patch0: nginx-auto-cc-gcc.patch Patch0: nginx-auto-cc-gcc.patch
@ -168,9 +174,37 @@ Requires: nginx
%description mod-stream %description mod-stream
%{summary}. %{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 %prep
%setup -q %setup -q
%setup -q -T -D %{Source300}
%setup -q -T -D %{Source301}
%patch0 -p0 %patch0 -p0
cp %{SOURCE200} . cp %{SOURCE200} .
@ -239,7 +273,9 @@ export DESTDIR=%{buildroot}
%endif %endif
--with-debug \ --with-debug \
--with-cc-opt="%{optflags} $(pcre-config --cflags)" \ --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} make %{?_smp_mflags}
@ -304,6 +340,10 @@ echo 'load_module "%{_libdir}/nginx/modules/ngx_mail_module.so";' \
> %{buildroot}%{_datadir}/nginx/modules/mod-mail.conf > %{buildroot}%{_datadir}/nginx/modules/mod-mail.conf
echo 'load_module "%{_libdir}/nginx/modules/ngx_stream_module.so";' \ echo 'load_module "%{_libdir}/nginx/modules/ngx_stream_module.so";' \
> %{buildroot}%{_datadir}/nginx/modules/mod-stream.conf > %{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 %pre filesystem
getent group %{nginx_user} > /dev/null || groupadd -r %{nginx_user} 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 || : /usr/bin/systemctl reload nginx.service >/dev/null 2>&1 || :
fi 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 %preun
%systemd_preun nginx.service %systemd_preun nginx.service
@ -429,6 +479,13 @@ fi
%{_datadir}/nginx/modules/mod-stream.conf %{_datadir}/nginx/modules/mod-stream.conf
%{_libdir}/nginx/modules/ngx_stream_module.so %{_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 %changelog
* Tue Nov 06 2018 Daniel Berteaud <daniel@firewall-services.com> 1.12.2-20.beta1 * Tue Nov 06 2018 Daniel Berteaud <daniel@firewall-services.com> 1.12.2-20.beta1

Loading…
Cancel
Save