Make downloading work on a stock buster installation

Previously it was relying on an old version of libssl being installed.

Change-Id: I9d2bb58dc96d0e7a403c7602ab7e8e034e65de91
diff --git a/debian/ssh.BUILD b/debian/ssh.BUILD
index fb7f120..f26d19a 100644
--- a/debian/ssh.BUILD
+++ b/debian/ssh.BUILD
@@ -1,11 +1,31 @@
-filegroup(
-    name = "ssh",
-    srcs = ["usr/bin/ssh"],
+_tools = [
+    "ssh",
+    "scp",
+]
+
+[genrule(
+    name = "copy_%s_wrapper" % tool,
+    srcs = ["@//debian:ssh_wrapper.sh"],
+    outs = ["%s_wrapper.sh" % tool],
+    cmd = "cat $< | sed 's,%%(TOOL),usr/bin/%s,g' > $@" % tool,
+) for tool in _tools]
+
+[sh_binary(
+    name = tool,
+    srcs = [
+        "%s_wrapper.sh" % tool,
+    ],
+    data = [
+        "usr/bin/%s" % tool,
+        ":libs",
+        "@bazel_tools//tools/bash/runfiles",
+    ],
     visibility = ["//visibility:public"],
-)
+) for tool in _tools]
 
 filegroup(
-    name = "scp",
-    srcs = ["usr/bin/scp"],
-    visibility = ["//visibility:public"],
+    name = "libs",
+    srcs = glob([
+        "usr/lib/x86_64-linux-gnu/**",
+    ]),
 )