Name: nginx-mod-coraza Version: 0.11.4 Release: %autorelease Summary: Coraza NGINX experimental connector License: Apache-2.0 URL: https://github.com/corazawaf/coraza-nginx Source: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz BuildRequires: gcc BuildRequires: libcoraza-devel BuildRequires: nginx-mod-devel BuildRequires: patch BuildRequires: pcre2-devel Requires: libcoraza%{?_isa} Requires: nginx-filesystem %description The coraza-nginx connector is the connection point between nginx and libcoraza. The module simply serves as a layer of communication between nginx and Coraza. %prep %autosetup -n coraza-nginx-%{version} # Fedora runtime packages provide the SONAME link, not the unversioned # linker-only libcoraza.so symlink from libcoraza-devel. patch -p1 < debian/patches/soname-dlopen.patch grep -q '#define DYNLIB_EXT ".so.1"' src/dynlib.h %build %nginx_modconfigure --with-http_v2_module --with-http_v3_module %nginx_modbuild grep -a -q 'libcoraza.so.1' %{_vpath_builddir}/ngx_http_coraza_module.so %install pushd %{_vpath_builddir} install -dm 0755 %{buildroot}%{nginx_moddir} install -pm 0755 ngx_http_coraza_module.so %{buildroot}%{nginx_moddir} install -dm 0755 %{buildroot}%{nginx_modconfdir} echo 'load_module "%{nginx_moddir}/ngx_http_coraza_module.so";' \ > %{buildroot}%{nginx_modconfdir}/mod-coraza.conf popd install -dm 0755 %{buildroot}%{_sysconfdir}/nginx/conf.d/ install -pm 0644 coraza.conf %{buildroot}%{_sysconfdir}/nginx/coraza.conf %files %license LICENSE %doc README.md %{nginx_moddir}/ngx_http_coraza_module.so %{nginx_modconfdir}/mod-coraza.conf %config(noreplace) %{_sysconfdir}/nginx/coraza.conf %changelog %autochangelog