1{ stdenv, lib, fetchurl
2, curl, apacheHttpd, pcre, apr, aprutil, libxml2 }:
3
4with lib;
5
6stdenv.mkDerivation rec {
7 name = "modsecurity-${version}";
8 version = "2.9.0";
9
10 src = fetchurl {
11 url = "https://www.modsecurity.org/tarball/${version}/${name}.tar.gz";
12 sha256 = "e2bbf789966c1f80094d88d9085a81bde082b2054f8e38e0db571ca49208f434";
13 };
14
15 buildInputs = [ curl apacheHttpd pcre apr aprutil libxml2 ];
16 configureFlags = [
17 "--enable-standalone-module"
18 "--enable-static"
19 "--with-curl=${curl}"
20 "--with-apxs=${apacheHttpd}/bin/apxs"
21 "--with-pcre=${pcre}"
22 "--with-apr=${apr}"
23 "--with-apu=${aprutil}/bin/apu-1-config"
24 "--with-libxml=${libxml2}"
25 ];
26
27 outputs = ["out" "nginx"];
28
29 preBuild = ''
30 substituteInPlace apache2/Makefile.in --replace "install -D " "# install -D"
31 '';
32
33 postInstall = ''
34 mkdir -p $nginx
35 cp -R * $nginx
36 '';
37
38 meta = {
39 description = "Open source, cross-platform web application firewall (WAF)";
40 license = licenses.asl20;
41 homepage = https://www.modsecurity.org/;
42 maintainers = with maintainers; [offline];
43 platforms = with platforms; linux;
44 };
45}