@@ -1,34 +1,57 @@
1−{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config
2−, doxygen, perl, valgrind
3−, curl, geoip, libxml2, lmdb, lua, pcre, yajl }:
1+{ lib, stdenv, fetchFromGitHub
2+, autoreconfHook, bison, flex, pkg-config
3+, curl, geoip, libmaxminddb, libxml2, lmdb, lua, pcre
4+, ssdeep, valgrind, yajl
5+}:
46
57stdenv.mkDerivation rec {
68 pname = "libmodsecurity";
7− version = "3.0.4";
9+ version = "3.0.6";
810
911 src = fetchFromGitHub {
1012 owner = "SpiderLabs";
1113 repo = "ModSecurity";
12− fetchSubmodules = true;
1314 rev = "v${version}";
14− sha256 = "07vry10cdll94sp652hwapn0ppjv3mb7n2s781yhy7hssap6f2vp";
15+ sha256 = "sha256-V+NBT2YN8qO3Px8zEzSA2ZsjSf1pv8+VlLxYlrpqfGg=";
16+ fetchSubmodules = true;
1517 };
1618
17− nativeBuildInputs = [ autoreconfHook pkg-config doxygen ];
19+ nativeBuildInputs = [ autoreconfHook bison flex pkg-config ];
20+ buildInputs = [ curl geoip libmaxminddb libxml2 lmdb lua pcre ssdeep valgrind yajl ];
1821
19− buildInputs = [ perl valgrind curl geoip libxml2 lmdb lua pcre yajl ];
22+ outputs = [ "out" "dev" ];
2023
2124 configureFlags = [
22− "--enable-static"
25+ "--enable-parser-generation"
2326 "--with-curl=${curl.dev}"
2427 "--with-libxml=${libxml2.dev}"
28+ "--with-lmdb=${lmdb.out}"
29+ "--with-maxmind=${libmaxminddb}"
2530 "--with-pcre=${pcre.dev}"
26− "--with-yajl=${yajl}"
31+ "--with-ssdeep=${ssdeep}"
2732 ];
2833
34+ postPatch = ''
35+ substituteInPlace build/lmdb.m4 \
36+ --replace "\''${path}/include/lmdb.h" "${lmdb.dev}/include/lmdb.h" \
37+ --replace "lmdb_inc_path=\"\''${path}/include\"" "lmdb_inc_path=\"${lmdb.dev}/include\""
38+ substituteInPlace build/ssdeep.m4 \
39+ --replace "/usr/local/libfuzzy" "${ssdeep}/lib" \
40+ --replace "\''${path}/include/fuzzy.h" "${ssdeep}/include/fuzzy.h" \
41+ --replace "ssdeep_inc_path=\"\''${path}/include\"" "ssdeep_inc_path=\"${ssdeep}/include\""
42+ substituteInPlace modsecurity.conf-recommended \
43+ --replace "SecUnicodeMapFile unicode.mapping 20127" "SecUnicodeMapFile $out/share/modsecurity/unicode.mapping 20127"
44+ '';
45+
46+ postInstall = ''
47+ mkdir -p $out/share/modsecurity
48+ cp ${src}/{AUTHORS,CHANGES,LICENSE,README.md,modsecurity.conf-recommended,unicode.mapping} $out/share/modsecurity
49+ '';
50+
2951 enableParallelBuilding = true;
3052
3153 meta = with lib; {
54+ homepage = "https://github.com/SpiderLabs/ModSecurity";
3255 description = ''
3356 ModSecurity v3 library component.
3457 '';
@@ -40,7 +63,6 @@ stdenv.mkDerivation rec {
4063 the ModSecurity SecRules format and apply them to HTTP content provided
4164 by your application via Connectors.
4265 '';
43− homepage = "https://modsecurity.org/";
4466 license = licenses.asl20;
4567 platforms = platforms.all;
4668 maintainers = with maintainers; [ izorkin ];