# Copyright 2017-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

# Auto-Generated by cargo-ebuild 0.1.5

EAPI=6

CRATES="
aho-corasick-0.6.6
ansi_term-0.11.0
arrayref-0.3.4
arrayvec-0.4.7
atty-0.2.11
backtrace-0.3.9
backtrace-sys-0.1.23
base64-0.9.2
bitflags-0.4.0
bitflags-1.0.3
block-buffer-0.3.3
boxxy-0.7.0
bufstream-0.1.3
byte-tools-0.2.0
byteorder-1.2.4
bytes-0.4.9
caps-0.2.0
cc-1.0.18
cfg-if-0.1.4
clap-2.32.0
cookie-factory-0.2.4
crossbeam-deque-0.3.1
crossbeam-epoch-0.4.3
crossbeam-utils-0.3.2
ct-logs-0.4.0
dhcp4r-0.1.0
digest-0.7.5
dns-parser-0.8.0
dtoa-0.4.3
encode_unicode-0.1.3
enum_primitive-0.1.1
env_logger-0.5.12
errno-0.2.4
errno-dragonfly-0.1.1
error-chain-0.11.0
error-chain-0.12.0
fake-simd-0.1.2
fnv-1.0.6
fuchsia-zircon-0.3.3
fuchsia-zircon-sys-0.3.3
futures-0.1.23
futures-cpupool-0.1.8
gcc-0.3.54
generic-array-0.9.0
h2-0.1.11
http-0.1.10
httparse-1.3.2
humantime-1.1.1
hyper-0.12.7
hyper-rustls-0.14.0
idna-0.1.5
indexmap-1.0.1
iovec-0.1.2
itoa-0.4.2
kernel32-sys-0.2.2
lazy_static-1.1.0
lazycell-0.6.0
libc-0.2.43
log-0.4.3
matches-0.1.7
memchr-1.0.2
memchr-2.0.1
memoffset-0.2.1
mio-0.6.15
miow-0.2.1
net2-0.2.33
nix-0.11.0
nix-0.5.1
nodrop-0.1.12
nom-3.2.1
nom-4.0.0
num-traits-0.1.43
num-traits-0.2.5
num_cpus-1.8.0
pcap-0.7.0
percent-encoding-1.0.1
phf-0.7.22
phf_codegen-0.7.22
phf_generator-0.7.22
phf_shared-0.7.22
pktparse-0.3.0
pledge-0.3.1
proc-macro2-0.4.9
quick-error-1.2.2
quote-0.6.5
rand-0.3.22
rand-0.4.2
redox_syscall-0.1.40
redox_termios-0.1.1
reduce-0.1.1
regex-1.0.2
regex-syntax-0.6.2
ring-0.13.2
rust-crypto-0.2.36
rustc-demangle-0.1.9
rustc-serialize-0.3.24
rusticata-macros-0.3.3
rustls-0.13.0
rustyline-1.0.0
safemem-0.2.0
scoped-tls-0.1.2
scopeguard-0.3.3
sct-0.4.0
seccomp-sys-0.1.2
serde-1.0.71
serde_derive-1.0.71
serde_json-1.0.24
sha2-0.7.1
siphasher-0.2.3
slab-0.4.1
sniffglue-0.8.0
string-0.1.1
strsim-0.7.0
syn-0.14.7
syscallz-0.7.0
termcolor-1.0.1
termion-1.5.1
textwrap-0.10.0
thread_local-0.3.5
threadpool-1.7.1
time-0.1.40
tls-parser-0.5.0
tokio-0.1.7
tokio-codec-0.1.0
tokio-core-0.1.17
tokio-executor-0.1.3
tokio-fs-0.1.3
tokio-io-0.1.7
tokio-reactor-0.1.3
tokio-rustls-0.7.1
tokio-tcp-0.1.1
tokio-threadpool-0.1.5
tokio-timer-0.2.5
tokio-udp-0.1.1
toml-0.4.6
try-lock-0.2.2
typenum-1.10.0
ucd-util-0.1.1
unicode-bidi-0.3.4
unicode-normalization-0.1.7
unicode-width-0.1.5
unicode-xid-0.1.0
unreachable-1.0.0
untrusted-0.6.2
url-1.7.1
users-0.7.0
utf8-ranges-1.0.0
vec_map-0.8.1
version_check-0.1.4
void-1.0.2
want-0.0.6
webpki-0.18.1
webpki-roots-0.15.0
winapi-0.2.8
winapi-0.3.5
winapi-build-0.1.1
winapi-i686-pc-windows-gnu-0.4.0
winapi-x86_64-pc-windows-gnu-0.4.0
wincolor-1.0.0
ws2_32-sys-0.2.1
"

inherit cargo

DESCRIPTION="Secure multithreaded packet sniffer"
HOMEPAGE="https://github.com/kpcyrd/sniffglue"
SRC_URI="$(cargo_crate_uris ${CRATES})"
RESTRICT="mirror"
LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~x86"
IUSE=""

RDEPEND="net-libs/libpcap
		 sys-libs/libseccomp
"
DEPEND="${RDEPEND}
		 >=virtual/rust-1.26.0"

src_test() {
	cargo test || die "tests failed"
}

src_install() {
	cargo_src_install

	doman docs/sniffglue.1
	dodoc README.md

	insinto /etc
	newins "${FILESDIR}"/sniffglue.conf sniffglue.conf
}