opentabletdriver: 0.6.5.0 -> 0.6.5.1 (#379384)
[NixPkgs.git] / pkgs / by-name / mo / modsecurity_standalone / package.nix
blob599d7e1195b0273f6e2d84b61494407f108ae948
2   stdenv,
3   lib,
4   fetchFromGitHub,
5   pkg-config,
6   autoreconfHook,
7   curl,
8   apacheHttpd,
9   pcre,
10   apr,
11   aprutil,
12   libxml2,
13   luaSupport ? false,
14   lua5,
15   perl,
18 let
19   luaValue = if luaSupport then lua5 else "no";
20   optional = lib.optional;
23 stdenv.mkDerivation rec {
24   pname = "modsecurity";
25   version = "2.9.7";
27   src = fetchFromGitHub {
28     owner = "owasp-modsecurity";
29     repo = pname;
30     rev = "v${version}";
31     sha256 = "sha256-hJ8wYeC83dl85bkUXGZKHpHzw9QRgtusj1/+Coxsx0k=";
32   };
34   nativeBuildInputs = [
35     pkg-config
36     autoreconfHook
37   ];
38   buildInputs = [
39     curl
40     apacheHttpd
41     pcre
42     apr
43     aprutil
44     libxml2
45   ] ++ optional luaSupport lua5;
47   configureFlags = [
48     "--enable-standalone-module"
49     "--enable-static"
50     "--with-curl=${curl.dev}"
51     "--with-apxs=${apacheHttpd.dev}/bin/apxs"
52     "--with-pcre=${pcre.dev}"
53     "--with-apr=${apr.dev}"
54     "--with-apu=${aprutil.dev}/bin/apu-1-config"
55     "--with-libxml=${libxml2.dev}"
56     "--with-lua=${luaValue}"
57   ];
59   outputs = [
60     "out"
61     "nginx"
62   ];
63   # by default modsecurity's install script copies compiled output to httpd's modules folder
64   # this patch removes those lines
65   patches = [ ./Makefile.am.patch ];
67   doCheck = true;
68   nativeCheckInputs = [ perl ];
70   postInstall = ''
71     mkdir -p $nginx
72     cp -R * $nginx
73   '';
75   meta = with lib; {
76     description = "Open source, cross-platform web application firewall (WAF)";
77     license = licenses.asl20;
78     homepage = "https://github.com/owasp-modsecurity/ModSecurity";
79     maintainers = with maintainers; [ offline ];
80     platforms = lib.platforms.linux ++ lib.platforms.darwin;
81   };