about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDomen Kožar <domen@dev.si>2015-09-23 19:04:13 +0200
committerDomen Kožar <domen@dev.si>2015-09-23 19:04:13 +0200
commit272cd6f7821ed3421cb7642d1967b55372f6e10e (patch)
treee32d879a6843d0ec20ee873998f5383d85d337ec
parente9f2dc883074fbba612f4e57a7bff06a8a6420e7 (diff)
parentffe94847a350d15ee72eb95bbe1777e6cc6815ae (diff)
downloadnixlib-272cd6f7821ed3421cb7642d1967b55372f6e10e.tar
nixlib-272cd6f7821ed3421cb7642d1967b55372f6e10e.tar.gz
nixlib-272cd6f7821ed3421cb7642d1967b55372f6e10e.tar.bz2
nixlib-272cd6f7821ed3421cb7642d1967b55372f6e10e.tar.lz
nixlib-272cd6f7821ed3421cb7642d1967b55372f6e10e.tar.xz
nixlib-272cd6f7821ed3421cb7642d1967b55372f6e10e.tar.zst
nixlib-272cd6f7821ed3421cb7642d1967b55372f6e10e.zip
Merge pull request #10017 from nckx/update-sshuttle
sshuttle: 0.61 -> 0.71
-rw-r--r--pkgs/tools/security/sshuttle/default.nix46
1 files changed, 29 insertions, 17 deletions
diff --git a/pkgs/tools/security/sshuttle/default.nix b/pkgs/tools/security/sshuttle/default.nix
index 61ba63862afa..18997abb6788 100644
--- a/pkgs/tools/security/sshuttle/default.nix
+++ b/pkgs/tools/security/sshuttle/default.nix
@@ -1,34 +1,46 @@
-{ stdenv, fetchurl, iptables, python, pythonPackages }:
+{ stdenv, fetchFromGitHub, makeWrapper, pandoc
+, coreutils, iptables, nettools, openssh, procps,  python }:
   
+let version = "0.71"; in
 stdenv.mkDerivation rec {
   name = "sshuttle-${version}";
-  version = "0.61";
 
-  src = fetchurl {
-    url = "https://github.com/apenwarr/sshuttle/archive/sshuttle-0.61.tar.gz";
-    sha256 = "1v2v1kbwnmx6ygzhbgqcmyafx914s2p7vjp7l0pf52sa7qkliy9b";
+  src = fetchFromGitHub {
+    sha256 = "0yr8nih97jg6azfj3k7064lfbh3g36l6vwyjlngl4ph6mgcki1cm";
+    rev = name;
+    repo = "sshuttle";
+    owner = "sshuttle";
   };
 
-  preBuild = ''
-   substituteInPlace Documentation/all.do --replace "/bin/ls" "$(type -tP ls)";
-   substituteInPlace Documentation/md2man.py --replace "/usr/bin/env python" "${python}/bin/python"
-  '';
+  nativeBuildInputs = [ makeWrapper pandoc ];
+  buildInputs = [ coreutils iptables nettools openssh procps python ];
 
-  phases = "unpackPhase installPhase";
+  preConfigure = ''
+    cd src
+  '';
 
   installPhase = ''
+    mkdir -p $out/share/sshuttle
+    cp -R sshuttle *.py compat $out/share/sshuttle
+
     mkdir -p $out/bin
-    cp -R . $out
-    ln -s $out/sshuttle $out/bin/sshuttle
+    ln -s $out/share/sshuttle/sshuttle $out/bin
+    wrapProgram $out/bin/sshuttle --prefix PATH : \
+      "${stdenv.lib.concatStringsSep ":" (map (x: "${x}/bin") buildInputs)}"
+
+    install -Dm644 sshuttle.8 $out/share/man/man8/sshuttle.8
   '';
   
-
-  buildInputs = [ iptables python pythonPackages.markdown pythonPackages.beautifulsoup ];
-
   meta = with stdenv.lib; {
-    homepage = https://github.com/apenwarr/sshuttle;
+    inherit version;
+    inherit (src.meta) homepage;
     description = "Transparent proxy server that works as a poor man's VPN";
-    maintainers = with maintainers; [ iElectric ];
+    longDescription = ''
+      Forward connections over SSH, without requiring administrator access to the
+      target network (though it does require Python 2 at both ends).
+      Works with Linux and Mac OS and supports DNS tunneling.
+    '';
+    maintainers = with maintainers; [ iElectric nckx ];
     platforms = platforms.unix;
   };
 }