about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/networking/zap/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/networking/zap/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/networking/zap/default.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/networking/zap/default.nix b/nixpkgs/pkgs/tools/networking/zap/default.nix
new file mode 100644
index 000000000000..2d8902f69097
--- /dev/null
+++ b/nixpkgs/pkgs/tools/networking/zap/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchFromGitHub, jdk, ant, runtimeShell }:
+
+stdenv.mkDerivation rec {
+  pname = "zap";
+  version = "2.7.0";
+  src = fetchFromGitHub {
+    owner = "zaproxy";
+    repo = "zaproxy";
+    rev =version;
+    sha256 = "1bz4pgq66v6kxmgj99llacm1d85vj8z78jlgc2z9hv0ha5i57y32";
+  };
+
+  buildInputs = [ jdk ant ];
+
+  buildPhase = ''
+    cd build
+    echo -n "${version}" > version.txt
+    ant -f build.xml setup init  compile dist copy-source-to-build package-linux
+  '';
+
+  installPhase = ''
+    mkdir -p "$out/share"
+    tar xvf  "ZAP_${version}_Linux.tar.gz" -C "$out/share/"
+    mkdir -p "$out/bin"
+    echo "#!${runtimeShell}" > "$out/bin/zap"
+    echo \"$out/share/ZAP_${version}/zap.sh\" >> "$out/bin/zap"
+    chmod +x "$out/bin/zap"
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = "https://www.owasp.org/index.php/ZAP";
+    description = "Java application for web penetration testing";
+    maintainers = with maintainers; [ mog ];
+    platforms = platforms.linux;
+    license = licenses.asl20;
+  };
+}