# Installation

## Go Get

Installation via go get:

```
$ go get -u github.com/dreadl0ck/netcap/...
```

## Development Build

To install the command-line tool:

```
$ go build -o $(go env GOPATH)/bin/netcap -i github.com/dreadl0ck/netcap/cmd
```

## Cross Compilation

To cross compile for other architectures, set the *GOARCH* and *GOOS* environment variables. For example to cross compile a binary for *linux amd64*:

```
$ GOARCH=amd64 GOOS=linux go build -o netcap -i github.com/dreadl0ck/netcap/cmd
```

## Homebrew

Install the *netcap* command-line tool with Homebrew:

```
$ brew tap dreadl0ck/formulas
$ brew install netcap
```

## Buildsystem

*Netcap* uses the [zeus](https://github.com/dreadl0ck/zeus) buildsystem, it can be found on github along with installation instructions.

However, the project can easily be installed without zeus. All shell scripts needed for installation can be found in the *zeus/generated* directory as standalone versions:

```
zeus/generated/install-netcap.sh
zeus/generated/install-netlabel.sh
zeus/generated/install-sensor.sh
zeus/generated/install-server.sh
```

To install the *Netcap* and *Netlabel* command-line tool and the library with zeus, run:

```
$ zeus install
```

## Tests

To execute the unit tests, run the following from the project root:

```
$ go test -v -bench=. ./...
```
