Bug 1540726

Summary: Review request: bettercap - A complete, modular, portable and easily extensible MITM framework
Product: [Fedora] Fedora Reporter: Germano Massullo <germano.massullo>
Component: Package ReviewAssignee: Nobody's working on this, feel free to take it <nobody>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: mail, package-review, zebob.m
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-18 21:45:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 563471    

Description Germano Massullo 2018-01-31 21:43:51 UTC
Description:
bettercap is a complete, modular, portable and easily extensible MITM tool and framework with every kind of diagnostic and offensive feature you could need in order to perform a man in the middle attack.

spec file:
https://pagure.io/bettercap-spec_file/blob/master/f/bettercap.spec

Note:
- bettercap-ng was the original project name, that has been changed today into bettercap 2.0, more infos at https://github.com/evilsocket/bettercap-ng/issues/35
- I could not provide a SRPM file because it is my first Go package and I have not managed to create a fully working SRPM file

Comment 1 Robert-André Mauchin 🐧 2018-02-01 19:29:57 UTC
 - You should link directly to the RAW SPEC and provide a SRPM too

 - This SPEC file has an empty Source0 so I can't do anything with it.

 - LICENSE.md is not installed in %files, nor is README.md with %doc

 - %changelog is empty

 - It's "compiler(go-compiler)" with no "s" at compiler


You should try to build the package in mock first before posting a Review request with half-assed SPEC.

Comment 2 Germano Massullo 2018-02-01 23:53:57 UTC
(In reply to Robert-André Mauchin from comment #1)
>  - You should link directly to the RAW SPEC and provide a SRPM too

https://germano.fedorapeople.org/package_reviews/bettercap/bettercap.spec
https://germano.fedorapeople.org/package_reviews/bettercap/bettercap-2.0.0-0.1.fc27.src.rpm

>  - This SPEC file has an empty Source0 so I can't do anything with it.

Done

>  - LICENSE.md is not installed in %files, nor is README.md with %doc

LICENSE.md has been placed under %license
README.md has been placed under %doc

>  - %changelog is empty

Done 

>  - It's "compiler(go-compiler)" with no "s" at compiler

Thank you, it was a typo into https://fedoraproject.org/wiki/PackagingDrafts/Go#Go_Language_Architectures
which I just corrected

During mock process, I obtain error message
No matching package to install: 'golang(github.com/jteeuwen/go-bindata)'

Comment 3 Germano Massullo 2018-02-02 00:23:30 UTC
https://germano.fedorapeople.org/package_reviews/bettercap/rev1/bettercap.spec
https://germano.fedorapeople.org/package_reviews/bettercap/rev1/bettercap-2.0.0-0.1.fc27.src.rpm


I have changed

BuildRequires:  golang(github.com/jteeuwen/go-bindata)
to
BuildRequires:  go-bindata

and
%setup -q -n %{name}-%{gittag}
to
%setup -q -n bettercap-ng-%{commit}

now mock returns errors




main.go:7:2: cannot find package "github.com/evilsocket/bettercap-ng/core" in any of:
        /usr/lib/golang/src/github.com/evilsocket/bettercap-ng/core (from $GOROOT)
        /builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/evilsocket/bettercap-ng/core (from $GOPATH)
        /usr/share/gocode/src/github.com/evilsocket/bettercap-ng/core
main.go:8:2: cannot find package "github.com/evilsocket/bettercap-ng/log" in any of:
        /usr/lib/golang/src/github.com/evilsocket/bettercap-ng/log (from $GOROOT)
        /builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/evilsocket/bettercap-ng/log (from $GOPATH)
        /usr/share/gocode/src/github.com/evilsocket/bettercap-ng/log
main.go:9:2: cannot find package "github.com/evilsocket/bettercap-ng/modules" in any of:
        /usr/lib/golang/src/github.com/evilsocket/bettercap-ng/modules (from $GOROOT)
        /builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/evilsocket/bettercap-ng/modules (from $GOPATH)
        /usr/share/gocode/src/github.com/evilsocket/bettercap-ng/modules
main.go:10:2: cannot find package "github.com/evilsocket/bettercap-ng/session" in any of:
        /usr/lib/golang/src/github.com/evilsocket/bettercap-ng/session (from $GOROOT)
        /builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/evilsocket/bettercap-ng/session (from $GOPATH)
        /usr/share/gocode/src/github.com/evilsocket/bettercap-ng/session

Comment 4 Robert-André Mauchin 🐧 2018-02-02 00:40:52 UTC
 - go-bindata only provides a binary, not a library, and only the binary is needed for your package. See https://src.fedoraproject.org/rpms/go-bindata

   So just replace golang(github.com/jteeuwen/go-bindata) with "go-bindata"

   I'm not even sure you even need it since it's only used in the make script that you don't use anyway. It seems to be used only by the developer. It's safe to remove imho.

 - Where did you get your Version:        2.0.0 from?

According to https://github.com/evilsocket/bettercap-ng/blob/master/core/banner.go the latest version is 0.9.

You should ask upstream to tag its release, it would be easier for packaging.

 - This import path seems dubious:

 %global import_path     code.google.com/p/go.net

It's not needed for packaging a binary anyway.

 - This:

%doc
README.md

%license
LICENSE.md

   should be inline, they are not new sections of the SPEC:

%files
%doc README.md
%license LICENSE.md
%{_bindir}/%{name}

Comment 5 Robert-André Mauchin 🐧 2018-02-02 00:52:52 UTC
(In reply to Germano Massullo from comment #3)
> https://germano.fedorapeople.org/package_reviews/bettercap/rev1/bettercap.
> spec
> https://germano.fedorapeople.org/package_reviews/bettercap/rev1/bettercap-2.
> 0.0-0.1.fc27.src.rpm
> 
> 
> I have changed
> 
> BuildRequires:  golang(github.com/jteeuwen/go-bindata)
> to
> BuildRequires:  go-bindata
> 
> and
> %setup -q -n %{name}-%{gittag}
> to
> %setup -q -n bettercap-ng-%{commit}
> 
> now mock returns errors
> 
> 
> 
> 
> main.go:7:2: cannot find package "github.com/evilsocket/bettercap-ng/core"
> in any of:
>         /usr/lib/golang/src/github.com/evilsocket/bettercap-ng/core (from
> $GOROOT)
>        
> /builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/
> _build/src/github.com/evilsocket/bettercap-ng/core (from $GOPATH)
>         /usr/share/gocode/src/github.com/evilsocket/bettercap-ng/core
> main.go:8:2: cannot find package "github.com/evilsocket/bettercap-ng/log" in
> any of:
>         /usr/lib/golang/src/github.com/evilsocket/bettercap-ng/log (from
> $GOROOT)
>        
> /builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/
> _build/src/github.com/evilsocket/bettercap-ng/log (from $GOPATH)
>         /usr/share/gocode/src/github.com/evilsocket/bettercap-ng/log
> main.go:9:2: cannot find package
> "github.com/evilsocket/bettercap-ng/modules" in any of:
>         /usr/lib/golang/src/github.com/evilsocket/bettercap-ng/modules (from
> $GOROOT)
>        
> /builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/
> _build/src/github.com/evilsocket/bettercap-ng/modules (from $GOPATH)
>         /usr/share/gocode/src/github.com/evilsocket/bettercap-ng/modules
> main.go:10:2: cannot find package
> "github.com/evilsocket/bettercap-ng/session" in any of:
>         /usr/lib/golang/src/github.com/evilsocket/bettercap-ng/session (from
> $GOROOT)
>        
> /builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/
> _build/src/github.com/evilsocket/bettercap-ng/session (from $GOPATH)
>         /usr/share/gocode/src/github.com/evilsocket/bettercap-ng/session

Your Gopath is probably fcked up. Yes I see, fix your header:

%global provider        github
%global provider_tld    com
%global project      evilsocket
%global repo         bettercap-ng
%global provider_prefix %{provider}.%{provider_tld}/%{project}

   Then fix %build:

%build
mkdir -p ./_build/src/%{provider}.%{provider_tld}/%{project}
ln -s $(pwd) ./_build/src/%{provider}.%{provider_tld}/%{project}/%{repo}
export GOPATH=$(pwd)/_build:%{gopath}

%gobuild -o %{name} .

Comment 6 Germano Massullo 2018-02-02 08:36:14 UTC
https://germano.fedorapeople.org/package_reviews/bettercap/rev2/bettercap.spec
https://germano.fedorapeople.org/package_reviews/bettercap/rev2/bettercap-2.0.0-0.1.fc27.src.rpm

(In reply to Robert-André Mauchin from comment #4)
>  - go-bindata only provides a binary, not a library, and only the binary is
> needed for your package. See https://src.fedoraproject.org/rpms/go-bindata
> 
>    So just replace golang(github.com/jteeuwen/go-bindata) with "go-bindata"
> 
>    I'm not even sure you even need it since it's only used in the make
> script that you don't use anyway. It seems to be used only by the developer.
> It's safe to remove imho.

I am going to ask upstream

>  - Where did you get your Version:        2.0.0 from?
> 
> According to
> https://github.com/evilsocket/bettercap-ng/blob/master/core/banner.go the
> latest version is 0.9.

(In reply to Germano Massullo from comment #0)
> [...]
> Note:
> - bettercap-ng was the original project name, that has been changed today
> into bettercap 2.0, more infos at
> https://github.com/evilsocket/bettercap-ng/issues/35

> 
>  - This import path seems dubious:
> 
>  %global import_path     code.google.com/p/go.net
> 
> It's not needed for packaging a binary anyway.

Done

> 
>  - This:
> 
> %doc
> README.md
> 
> %license
> LICENSE.md
> 
>    should be inline, they are not new sections of the SPEC:
> 
> %files
> %doc README.md
> %license LICENSE.md
> %{_bindir}/%{name}

Done

>    Then fix %build:
> 
> %build
> mkdir -p ./_build/src/%{provider}.%{provider_tld}/%{project}
> ln -s $(pwd) ./_build/src/%{provider}.%{provider_tld}/%{project}/%{repo}
> export GOPATH=$(pwd)/_build:%{gopath}
> 
> %gobuild -o %{name} .

Done, but I still obtain some errors

main.go:7:2: cannot find package "github.com/evilsocket/bettercap-ng/core" in any of:
        /usr/lib/golang/src/github.com/evilsocket/bettercap-ng/core (from $GOROOT)
        /builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/evilsocket/bettercap-ng/core (from $GOPATH)
        /usr/share/gocode/src/github.com/evilsocket/bettercap-ng/core
main.go:8:2: cannot find package "github.com/evilsocket/bettercap-ng/log" in any of:
        /usr/lib/golang/src/github.com/evilsocket/bettercap-ng/log (from $GOROOT)
        /builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/evilsocket/bettercap-ng/log (from $GOPATH)
        /usr/share/gocode/src/github.com/evilsocket/bettercap-ng/log
main.go:9:2: cannot find package "github.com/evilsocket/bettercap-ng/modules" in any of:
        /usr/lib/golang/src/github.com/evilsocket/bettercap-ng/modules (from $GOROOT)
        /builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/evilsocket/bettercap-ng/modules (from $GOPATH)
        /usr/share/gocode/src/github.com/evilsocket/bettercap-ng/modules
main.go:10:2: cannot find package "github.com/evilsocket/bettercap-ng/session" in any of:
        /usr/lib/golang/src/github.com/evilsocket/bettercap-ng/session (from $GOROOT)
        /builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/evilsocket/bettercap-ng/session (from $GOPATH)
        /usr/share/gocode/src/github.com/evilsocket/bettercap-ng/session

Comment 7 Germano Massullo 2018-02-02 12:14:56 UTC
(In reply to Robert-André Mauchin from comment #4)
>  - go-bindata only provides a binary, not a library, and only the binary is
> needed for your package. See https://src.fedoraproject.org/rpms/go-bindata
> 
>    So just replace golang(github.com/jteeuwen/go-bindata) with "go-bindata"
> 
>    I'm not even sure you even need it since it's only used in the make
> script that you don't use anyway. It seems to be used only by the developer.
> It's safe to remove imho.

Upstream confirmed that go-bindata is not necessary

Comment 8 Robert-André Mauchin 🐧 2018-02-02 14:41:23 UTC
> bettercap-ng *will* be merged into the bettercap original repository, commits history preserved and this repo deleted, these are the steps to take in order to release it as version 2.0.0 of bettercap.

Emphasis on will. Thit isn't yet bettercap 2.0, it will be in the future. I also question the pertinence of packaging it right now instead of waiting for the merge with bettercap. When the merge happens, we will have two packages bettercap and bettercap-ng for the same thing, and we will have to provide an upgrade path for one to the other. It really depends if you need this now, it seems to still be in an alpha state.

Comment 9 Germano Massullo 2018-02-02 14:49:35 UTC
(In reply to Robert-André Mauchin from comment #8)
> Emphasis on will. Thit isn't yet bettercap 2.0, it will be in the future. I
> also question the pertinence of packaging it right now instead of waiting
> for the merge with bettercap.

For the moment we do the package review and start a master branch. When bettercap will be released I will make a bodhi release.

> When the merge happens, we will have two
> packages bettercap and bettercap-ng for the same thing

There will not be anything to upgrade since when bettercap will be released I will make a bodhi release.
The package name will be "bettercap" not "bettercap-ng", so there will be no problem

Comment 10 Germano Massullo 2018-02-05 21:58:26 UTC
bettercap 2.0.0 will be released on 28 February 2018
https://github.com/evilsocket/bettercap-ng/milestones

Comment 11 Robert-André Mauchin 🐧 2018-02-05 22:37:29 UTC
(In reply to Germano Massullo from comment #6)
> 
> Done, but I still obtain some errors
> 
> main.go:7:2: cannot find package "github.com/evilsocket/bettercap-ng/core"
> in any of:
>         /usr/lib/golang/src/github.com/evilsocket/bettercap-ng/core (from
> $GOROOT)
>        
> /builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/
> _build/src/github.com/evilsocket/bettercap-ng/core (from $GOPATH)
>         /usr/share/gocode/src/github.com/evilsocket/bettercap-ng/core
> main.go:8:2: cannot find package "github.com/evilsocket/bettercap-ng/log" in
> any of:
>         /usr/lib/golang/src/github.com/evilsocket/bettercap-ng/log (from
> $GOROOT)
>        
> /builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/
> _build/src/github.com/evilsocket/bettercap-ng/log (from $GOPATH)
>         /usr/share/gocode/src/github.com/evilsocket/bettercap-ng/log
> main.go:9:2: cannot find package
> "github.com/evilsocket/bettercap-ng/modules" in any of:
>         /usr/lib/golang/src/github.com/evilsocket/bettercap-ng/modules (from
> $GOROOT)
>        
> /builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/
> _build/src/github.com/evilsocket/bettercap-ng/modules (from $GOPATH)
>         /usr/share/gocode/src/github.com/evilsocket/bettercap-ng/modules
> main.go:10:2: cannot find package
> "github.com/evilsocket/bettercap-ng/session" in any of:
>         /usr/lib/golang/src/github.com/evilsocket/bettercap-ng/session (from
> $GOROOT)
>        
> /builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/
> _build/src/github.com/evilsocket/bettercap-ng/session (from $GOPATH)
>         /usr/share/gocode/src/github.com/evilsocket/bettercap-ng/session

You did not fix the header as I said so it doesn't work:

>Your Gopath is probably fcked up. Yes I see, fix your header:

%global provider        github
%global provider_tld    com
%global project      evilsocket
%global repo         bettercap-ng
%global provider_prefix %{provider}.%{provider_tld}/%{project}


Once you do that you'll see that you are missing plenty of dependencies because you haven't done your job beforehand:

+ go build -buildmode pie -compiler gc -tags=rpm_crashtraceback -ldflags ' -B 0x45265e550377a69ca63e577f452392918e5720c2 -extldflags '\''-Wl,-z,relro  -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '\''' -a -v -x -o bettercap .
WORK=/tmp/go-build248343626
_build/src/github.com/evilsocket/bettercap-ng/session/command_handler.go:4:2: cannot find package "github.com/chzyer/readline" in any of:
	/usr/lib/golang/src/github.com/chzyer/readline (from $GOROOT)
	/builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/chzyer/readline (from $GOPATH)
	/usr/share/gocode/src/github.com/chzyer/readline
_build/src/github.com/evilsocket/bettercap-ng/session/prompt.go:10:2: cannot find package "github.com/dustin/go-humanize" in any of:
	/usr/lib/golang/src/github.com/dustin/go-humanize (from $GOROOT)
	/builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/dustin/go-humanize (from $GOPATH)
	/usr/share/gocode/src/github.com/dustin/go-humanize
_build/src/github.com/evilsocket/bettercap-ng/modules/http_proxy_base.go:24:2: cannot find package "github.com/elazarl/goproxy" in any of:
	/usr/lib/golang/src/github.com/elazarl/goproxy (from $GOROOT)
	/builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/elazarl/goproxy (from $GOPATH)
	/usr/share/gocode/src/github.com/elazarl/goproxy
_build/src/github.com/evilsocket/bettercap-ng/modules/api_rest.go:14:2: cannot find package "github.com/gin-gonic/gin" in any of:
	/usr/lib/golang/src/github.com/gin-gonic/gin (from $GOROOT)
	/builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/gin-gonic/gin (from $GOPATH)
	/usr/share/gocode/src/github.com/gin-gonic/gin
_build/src/github.com/evilsocket/bettercap-ng/modules/api_rest_utils.go:8:2: cannot find package "github.com/gin-gonic/gin/binding" in any of:
	/usr/lib/golang/src/github.com/gin-gonic/gin/binding (from $GOROOT)
	/builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/gin-gonic/gin/binding (from $GOPATH)
	/usr/share/gocode/src/github.com/gin-gonic/gin/binding
_build/src/github.com/evilsocket/bettercap-ng/packets/dhcp6_layer.go:4:2: cannot find package "github.com/google/gopacket" in any of:
	/usr/lib/golang/src/github.com/google/gopacket (from $GOROOT)
	/builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/google/gopacket (from $GOPATH)
	/usr/share/gocode/src/github.com/google/gopacket
_build/src/github.com/evilsocket/bettercap-ng/packets/arp.go:6:2: cannot find package "github.com/google/gopacket/layers" in any of:
	/usr/lib/golang/src/github.com/google/gopacket/layers (from $GOROOT)
	/builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/google/gopacket/layers (from $GOPATH)
	/usr/share/gocode/src/github.com/google/gopacket/layers
_build/src/github.com/evilsocket/bettercap-ng/packets/queue.go:13:2: cannot find package "github.com/google/gopacket/pcap" in any of:
	/usr/lib/golang/src/github.com/google/gopacket/pcap (from $GOROOT)
	/builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/google/gopacket/pcap (from $GOPATH)
	/usr/share/gocode/src/github.com/google/gopacket/pcap
_build/src/github.com/evilsocket/bettercap-ng/modules/net_sniff_context.go:13:2: cannot find package "github.com/google/gopacket/pcapgo" in any of:
	/usr/lib/golang/src/github.com/google/gopacket/pcapgo (from $GOROOT)
	/builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/google/gopacket/pcapgo (from $GOPATH)
	/usr/share/gocode/src/github.com/google/gopacket/pcapgo
_build/src/github.com/evilsocket/bettercap-ng/modules/http_proxy_base.go:25:2: cannot find package "github.com/inconshreveable/go-vhost" in any of:
	/usr/lib/golang/src/github.com/inconshreveable/go-vhost (from $GOROOT)
	/builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/inconshreveable/go-vhost (from $GOPATH)
	/usr/share/gocode/src/github.com/inconshreveable/go-vhost
_build/src/github.com/evilsocket/bettercap-ng/modules/arp_spoof.go:13:2: cannot find package "github.com/malfunkt/iprange" in any of:
	/usr/lib/golang/src/github.com/malfunkt/iprange (from $GOROOT)
	/builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/malfunkt/iprange (from $GOPATH)
	/usr/share/gocode/src/github.com/malfunkt/iprange
_build/src/github.com/evilsocket/bettercap-ng/packets/dhcp6.go:7:2: cannot find package "github.com/mdlayher/dhcp6" in any of:
	/usr/lib/golang/src/github.com/mdlayher/dhcp6 (from $GOROOT)
	/builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/mdlayher/dhcp6 (from $GOPATH)
	/usr/share/gocode/src/github.com/mdlayher/dhcp6
_build/src/github.com/evilsocket/bettercap-ng/modules/dhcp6_spoof.go:23:2: cannot find package "github.com/mdlayher/dhcp6/dhcp6opts" in any of:
	/usr/lib/golang/src/github.com/mdlayher/dhcp6/dhcp6opts (from $GOROOT)
	/builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/mdlayher/dhcp6/dhcp6opts (from $GOPATH)
	/usr/share/gocode/src/github.com/mdlayher/dhcp6/dhcp6opts
_build/src/github.com/evilsocket/bettercap-ng/modules/net_recon_show.go:14:2: cannot find package "github.com/olekukonko/tablewriter" in any of:
	/usr/lib/golang/src/github.com/olekukonko/tablewriter (from $GOROOT)
	/builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/olekukonko/tablewriter (from $GOPATH)
	/usr/share/gocode/src/github.com/olekukonko/tablewriter
_build/src/github.com/evilsocket/bettercap-ng/modules/http_proxy_script.go:11:2: cannot find package "github.com/robertkrimen/otto" in any of:
	/usr/lib/golang/src/github.com/robertkrimen/otto (from $GOROOT)
	/builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/github.com/robertkrimen/otto (from $GOPATH)
	/usr/share/gocode/src/github.com/robertkrimen/otto
_build/src/github.com/evilsocket/bettercap-ng/modules/api_rest_security.go:10:2: cannot find package "gopkg.in/unrolled/secure.v1" in any of:
	/usr/lib/golang/src/gopkg.in/unrolled/secure.v1 (from $GOROOT)
	/builddir/build/BUILD/bettercap-ng-eb1a53efa3171aefed0ec9766d8c5047bd0df289/_build/src/gopkg.in/unrolled/secure.v1 (from $GOPATH)
	/usr/share/gocode/src/gopkg.in/unrolled/secure.v1


   Run the app through Gofed to get a list of the dependencies:

# gofed repo2spec --detect https://github.com/evilsocket/bettercap-ng

   You'll get in the SPEC:

BuildRequires: golang(github.com/chzyer/readline)
BuildRequires: golang(github.com/dustin/go-humanize)
BuildRequires: golang(github.com/elazarl/goproxy)
BuildRequires: golang(github.com/gin-gonic/gin)
BuildRequires: golang(github.com/gin-gonic/gin/binding)
BuildRequires: golang(github.com/google/gopacket)
BuildRequires: golang(github.com/google/gopacket/layers)
BuildRequires: golang(github.com/google/gopacket/pcap)
BuildRequires: golang(github.com/google/gopacket/pcapgo)
BuildRequires: golang(github.com/inconshreveable/go-vhost)
BuildRequires: golang(github.com/malfunkt/iprange)
BuildRequires: golang(github.com/mdlayher/dhcp6)
BuildRequires: golang(github.com/mdlayher/dhcp6/dhcp6opts)
BuildRequires: golang(github.com/olekukonko/tablewriter)
BuildRequires: golang(github.com/robertkrimen/otto)

   Add them to your SPEC.

   Now look what packages are already in Fedora and package those which are not. Look on Pagure (https://src.fedoraproject.org/), Gofed use the outdated Pkgdb so it's not reliable. 

   Package these missing libraries using Gofed. By default, it tries to do a snapshot of the GIT repo, you need to check if upstream has not actually tagged a release. If they did, use that release instead of the snapshot. If not keep the snapshot but add the commit date to the Release: tag (See https://fedoraproject.org/wiki/Packaging:Versioning#Snapshots).

Comment 12 Robert-André Mauchin 🐧 2018-02-05 22:46:47 UTC
Also note that these dependencies may have their own dependencies as well, in other words, lots of work ahead.

Comment 13 Germano Massullo 2018-02-06 10:37:36 UTC
I will submit review requests for missing libraries
github.com/elazarl/goproxy
github.com/gin-gonic/gin
github.com/gin-gonic/gin/binding
github.com/google/gopacket
github.com/google/gopacket/layers
github.com/google/gopacket/pcap
github.com/google/gopacket/pcapgo
github.com/inconshreveable/go-vhost
github.com/malfunkt/iprange
github.com/mdlayher/dhcp6
github.com/mdlayher/dhcp6/dhcp6opts

Comment 14 Germano Massullo 2018-11-18 21:45:20 UTC
It is not possible to package Bettercap due the amount of libraries that need to be packaged

Comment 15 Fabian Affolter 2020-04-04 16:55:20 UTC

*** This bug has been marked as a duplicate of bug 1820915 ***