-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx-mod-modsecurity.spec.in
64 lines (51 loc) · 1.69 KB
/
nginx-mod-modsecurity.spec.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Build against OpenSSL 3 on EL8
%if 0%{?rhel} == 8
%global openssl_pkgversion 3
%endif
Summary: ModSecurity v3 Nginx Connector (module for nginx)
Name: nginx-mod-modsecurity
Version: 1.0.3
Release: 1%{?dist}
Vendor: Artera
URL: https://github.com/SpiderLabs/ModSecurity-nginx
%define _modname modsecurity
%define _nginxver @NGINXVER@
%define nginx_config_dir %{_sysconfdir}/nginx
%define nginx_build_dir %{_builddir}/nginx-%{_nginxver}
Source0: https://nginx.org/download/nginx-%{_nginxver}.tar.gz
Source1: https://github.com/SpiderLabs/ModSecurity-nginx/releases/download/v%{version}/%{_modname}-nginx-v%{version}.tar.gz
Requires: nginx = 1:%{_nginxver}
Requires: libmodsecurity
BuildRequires: nginx
BuildRequires: libtool
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libmodsecurity-devel
BuildRequires: openssl%{?openssl_pkgversion}-devel
BuildRequires: pcre2-devel
BuildRequires: zlib-devel
BuildRequires: perl-devel
BuildRequires: gd-devel
BuildRequires: libxslt-devel
BuildRequires: perl-devel
BuildRequires: perl(ExtUtils::Embed)
License: GPL3
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%description
ModSecurity v3 Nginx Connector (module for nginx).
%prep
%setup -q -n nginx-%{_nginxver}
%setup -T -D -b 1 -n %{_modname}-nginx-v%{version}
%build
cd %{_builddir}/nginx-%{_nginxver}
./configure --with-compat --add-dynamic-module=../%{_modname}-nginx-v%{version}
make modules
%install
%{__rm} -rf %{buildroot}
%{__install} -Dm755 %{nginx_build_dir}/objs/ngx_http_modsecurity_module.so \
$RPM_BUILD_ROOT%{_libdir}/nginx/modules/ngx_http_modsecurity_module.so
%clean
%{__rm} -rf %{buildroot}
%files
%defattr(-,root,root)
%{_libdir}/nginx/modules/*.so