1{ stdenv, lib, fetchurl, pkgconfig
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 nativeBuildInputs = [ pkgconfig ];
16 buildInputs = [ curl apacheHttpd pcre apr aprutil libxml2 ];
17 configureFlags = [
18 "--enable-standalone-module"
19 "--enable-static"
20 "--with-curl=${curl.dev}"
21 "--with-apxs=${apacheHttpd.dev}/bin/apxs"
22 "--with-pcre=${pcre.dev}"
23 "--with-apr=${apr.dev}"
24 "--with-apu=${aprutil.dev}/bin/apu-1-config"
25 "--with-libxml=${libxml2.dev}"
26 ];
27
28 outputs = ["out" "nginx"];
29
30 preBuild = ''
31 substituteInPlace apache2/Makefile.in --replace "install -D " "# install -D"
32 '';
33
34 postInstall = ''
35 mkdir -p $nginx
36 cp -R * $nginx
37 '';
38
39 meta = {
40 description = "Open source, cross-platform web application firewall (WAF)";
41 license = licenses.asl20;
42 homepage = https://www.modsecurity.org/;
43 maintainers = with maintainers; [offline];
44 platforms = platforms.linux;
45 };
46}