From f7dca60f61a87a851197fa4109d7d3f023864850 Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Thu, 12 Sep 2019 07:06:16 +0200 Subject: [PATCH] bettercap: fix so that caplets can be installed correctly --- root-packages/bettercap/build.sh | 1 + root-packages/bettercap/fix-paths.patch | 26 ++++++++++++++++++++++++ root-packages/bettercap/fix-tmpdir.patch | 20 ++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 root-packages/bettercap/fix-paths.patch create mode 100644 root-packages/bettercap/fix-tmpdir.patch diff --git a/root-packages/bettercap/build.sh b/root-packages/bettercap/build.sh index e991c86de..d64b2443c 100644 --- a/root-packages/bettercap/build.sh +++ b/root-packages/bettercap/build.sh @@ -2,6 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.bettercap.org TERMUX_PKG_DESCRIPTION="The Swiss Army knife for 802.11, BLE and Ethernet networks reconnaissance and MITM attacks" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_VERSION=2.24.1 +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/bettercap/bettercap/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=590cef2b2b24fd9f67c57c8cb19ab8ff08b11d43bfc23b468013ddad907bb8b8 TERMUX_PKG_DEPENDS="libpcap, libusb" diff --git a/root-packages/bettercap/fix-paths.patch b/root-packages/bettercap/fix-paths.patch new file mode 100644 index 000000000..e149f7e00 --- /dev/null +++ b/root-packages/bettercap/fix-paths.patch @@ -0,0 +1,26 @@ +diff --git a/caplets/env.go b/caplets/env.go +index 4c803b6..eccfe7e 100644 +--- a/caplets/env.go ++++ b/caplets/env.go +@@ -11,7 +11,7 @@ const ( + EnvVarName = "CAPSPATH" + Suffix = ".cap" + InstallArchive = "https://github.com/bettercap/caplets/archive/master.zip" +- InstallBase = "/usr/local/share/bettercap/" ++ InstallBase = "@TERMUX_PREFIX@/local/share/bettercap/" + ) + + var ( +diff --git a/modules/ui/ui.go b/modules/ui/ui.go +index f5d6950..4059c6c 100644 +--- a/modules/ui/ui.go ++++ b/modules/ui/ui.go +@@ -36,7 +36,7 @@ func NewUIModule(s *session.Session) *UIModule { + } + + mod.AddParam(session.NewStringParameter("ui.basepath", +- "/usr/local/share/bettercap/", ++ "@TERMUX_PREFIX@/local/share/bettercap/", + "", + "UI base installation path.")) + diff --git a/root-packages/bettercap/fix-tmpdir.patch b/root-packages/bettercap/fix-tmpdir.patch new file mode 100644 index 000000000..9eec28c58 --- /dev/null +++ b/root-packages/bettercap/fix-tmpdir.patch @@ -0,0 +1,20 @@ +--- ../caplets.go.orig 2019-09-12 07:01:02.402741887 +0200 ++++ ./modules/caplets/caplets.go 2019-09-12 07:01:26.121229567 +0200 +@@ -120,7 +120,7 @@ + } + } + +- out, err := os.Create("/tmp/caplets.zip") ++ out, err := os.Create("@TERMUX_PREFIX@/tmp/caplets.zip") + if err != nil { + return err + } +@@ -140,7 +140,7 @@ + + mod.Info("installing caplets to %s ...", caplets.InstallPath) + +- if _, err = zip.Unzip("/tmp/caplets.zip", caplets.InstallBase); err != nil { ++ if _, err = zip.Unzip("@TERMUX_PREFIX@/tmp/caplets.zip", caplets.InstallBase); err != nil { + return err + } +