nixpkgs-suyu/pkgs/tools/security/modsecurity/default.nix

55 lines
1.4 KiB
Nix
Raw Normal View History

2021-01-17 04:51:22 +01:00
{ stdenv, lib, fetchurl, pkg-config
, curl, apacheHttpd, pcre, apr, aprutil, libxml2
, luaSupport ? false, lua5
}:
2015-09-23 20:28:29 +02:00
with lib;
let luaValue = if luaSupport then lua5 else "no";
2021-01-15 10:19:50 +01:00
optional = lib.optional;
in
2015-09-23 20:28:29 +02:00
stdenv.mkDerivation rec {
pname = "modsecurity";
version = "2.9.3";
2015-09-23 20:28:29 +02:00
src = fetchurl {
url = "https://www.modsecurity.org/tarball/${version}/${pname}-${version}.tar.gz";
sha256 = "0611nskd2y6yagrciqafxdn4rxbdk2v4swf45kc1sgwx2sfh34j1";
2015-09-23 20:28:29 +02:00
};
2021-01-17 04:51:22 +01:00
nativeBuildInputs = [ pkg-config ];
buildInputs = [ curl apacheHttpd pcre apr aprutil libxml2 ] ++
optional luaSupport lua5;
configureFlags = [
"--enable-standalone-module"
"--enable-static"
"--with-curl=${curl.dev}"
"--with-apxs=${apacheHttpd.dev}/bin/apxs"
"--with-pcre=${pcre.dev}"
"--with-apr=${apr.dev}"
"--with-apu=${aprutil.dev}/bin/apu-1-config"
"--with-libxml=${libxml2.dev}"
"--with-lua=${luaValue}"
];
2015-09-23 20:28:29 +02:00
outputs = ["out" "nginx"];
# by default modsecurity's install script copies compiled output to httpd's modules folder
# this patch removes those lines
patches = [ ./Makefile.in.patch ];
2015-09-23 20:28:29 +02:00
postInstall = ''
mkdir -p $nginx
cp -R * $nginx
'';
meta = {
description = "Open source, cross-platform web application firewall (WAF)";
license = licenses.asl20;
homepage = "https://www.modsecurity.org/";
2015-09-23 20:28:29 +02:00
maintainers = with maintainers; [offline];
2021-01-15 14:21:58 +01:00
platforms = lib.platforms.linux ++ lib.platforms.darwin;
2015-09-23 20:28:29 +02:00
};
}