aboutsummaryrefslogtreecommitdiff
path: root/pkgs/tools/security/nmap
diff options
context:
space:
mode:
authorSergey Mironov <grrwlf@gmail.com>2013-06-06 11:13:08 +0400
committerSergey Mironov <grrwlf@gmail.com>2013-06-06 12:09:19 +0400
commitea82f6d0e9dc4f1465d03c9e7c8671732e55afcd (patch)
tree9ac3579aa5af724eadf87694522164e6107b9550 /pkgs/tools/security/nmap
parent80bd0dda5341c84b84326593ccf40f66bc72042d (diff)
nmap: help zenmap to find it's templates in nix-store
Zenamp wrapper confuses python so it thinks that zenmap is launched as a script and not as an executable. This leads to incorrect /share path and missing templates. ./zenmap.patch cures that (a bit hacky as usual).
Diffstat (limited to 'pkgs/tools/security/nmap')
-rw-r--r--pkgs/tools/security/nmap/default.nix4
-rw-r--r--pkgs/tools/security/nmap/zenmap.patch15
2 files changed, 18 insertions, 1 deletions
diff --git a/pkgs/tools/security/nmap/default.nix b/pkgs/tools/security/nmap/default.nix
index 143c75285c4a..2280ff3cfbed 100644
--- a/pkgs/tools/security/nmap/default.nix
+++ b/pkgs/tools/security/nmap/default.nix
@@ -2,7 +2,7 @@
, openssl, python, pygtk, makeWrapper, pygobject
, pycairo, pysqlite
}:
-
+
stdenv.mkDerivation rec {
name = "nmap-5.50";
@@ -11,6 +11,8 @@ stdenv.mkDerivation rec {
sha256 = "aa044113caa47e172c154daed73afc70ffa18d359eb47c22a9ea85ffcb14ffb8";
};
+ patches = [ ./zenmap.patch ];
+
postInstall =
''
wrapProgram $out/bin/zenmap --prefix PYTHONPATH : "$(toPythonPath $out)" --prefix PYTHONPATH : "$PYTHONPATH" --prefix PYTHONPATH : $(toPythonPath ${pygtk})/gtk-2.0 --prefix PYTHONPATH : $(toPythonPath ${pygobject})/gtk-2.0 --prefix PYTHONPATH : $(toPythonPath ${pycairo})/gtk-2.0
diff --git a/pkgs/tools/security/nmap/zenmap.patch b/pkgs/tools/security/nmap/zenmap.patch
new file mode 100644
index 000000000000..3cd39750c881
--- /dev/null
+++ b/pkgs/tools/security/nmap/zenmap.patch
@@ -0,0 +1,15 @@
+diff -ruN nmap-5.50.orig/zenmap/zenmapCore/Paths.py nmap-5.50/zenmap/zenmapCore/Paths.py
+--- nmap-5.50.orig/zenmap/zenmapCore/Paths.py 2013-06-06 05:52:10.723087428 +0000
++++ nmap-5.50/zenmap/zenmapCore/Paths.py 2013-06-06 07:07:25.481261761 +0000
+@@ -115,7 +115,10 @@
+ else:
+ # Normal script execution. Look in the current directory to allow
+ # running from the distribution.
+- return os.path.abspath(os.path.dirname(fs_dec(sys.argv[0])))
++ #
++ # Grrwlf: No,no,dear. That's not a script, thats Nixos wrapper. Go add
++ # those '..' to substract /bin part.
++ return os.path.abspath(os.path.join(os.path.dirname(fs_dec(sys.argv[0])), ".."))
+
+ prefix = get_prefix()
+