termshark: minor changes, add 9999 live ver

This commit is contained in:
Yury Martynov 2019-07-24 00:11:11 +03:00
parent 207d016de2
commit d5955c7328
No known key found for this signature in database
GPG key ID: EBE62DD0CCEAE19E
2 changed files with 60 additions and 4 deletions

View file

@ -2,8 +2,8 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EGO_PN="github.com/gcla/termshark"
EGO_BUILD_FLAGS="-ldflags=\"-X ${EGO_PN}.Version=${PV}\""
EGO_VENDOR=(
"github.com/BurntSushi/toml 3012a1d" # v0.3.1
"github.com/blang/semver 2ee8785" # v3.5.1
@ -56,11 +56,16 @@ DEPEND="${RDEPEND}
>=dev-lang/go-1.12"
src_compile() {
GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" \
go install -v -work -x "${EGO_BUILD_FLAGS}" ./... "${EGO_PN}"
GOPATH="${S}:$(get_golibdir_gopath)" \
GOCACHE="${T}/go-cache" \
go build -v -work -x -ldflags "-s -w -X ${EGO_PN}.Version=${PV}" ./... || die
}
src_install() {
GOPATH="${S}:$(get_golibdir_gopath)" \
GOCACHE="${T}/go-cache" \
go install -v -work -x -ldflags "-s -w -X ${MY_EGO_PN}.Version=${PV}" ./... || die
dobin bin/${PN}
dodoc src/"${EGO_PN}"/{README.md,docs/*}
}
@ -69,5 +74,5 @@ pkg_postinst() {
elog "\nSee documentation:"
elog " https://github.com/gcla/termshark/blob/master/docs/UserGuide.md"
elog " ~$ bzip2 -dc usr/share/doc/termshark-${PV}/UserGuide.md.bz2 | less"
elog " ~$ bzip2 -dc usr/share/doc/termshark-1.0.0/FAQ.md.bz2 | less\n"
elog " ~$ bzip2 -dc usr/share/doc/termshark-${PV}/FAQ.md.bz2 | less\n"
}

View file

@ -0,0 +1,51 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EGO_PN="github.com/gcla/termshark/cmd/termshark"
MY_EGO_PN="github.com/gcla/termshark"
inherit golang-vcs
DESCRIPTION="A terminal UI for tshark, inspired by Wireshark"
HOMEPAGE="https://termshark.io/ https://github.com/gcla/termshark"
LICENSE="MIT"
SLOT=0
RDEPEND="net-analyzer/wireshark[dumpcap,pcap,tshark]"
DEPEND="${RDEPEND}
!net-analyzer/termshark-bin"
S="${WORKDIR}/${P}"
src_unpack() {
golang-vcs_src_unpack
# `go get ...` can't structuring graph of available depends
cp -r "${EGO_STORE_DIR}/src/${MY_EGO_PN%/...}" \
"${WORKDIR}/${P}/src/${MY_EGO_PN%/...}/.." || die
}
src_compile() {
GOPATH="${S}:${EGO_STORE_DIR}:$(get_golibdir_gopath)" \
GOCACHE="${T}/go-cache" \
go build -v -work -x -ldflags "-s -w -X ${MY_EGO_PN}.Version=${PV}" ./... || die
}
src_install() {
GOPATH="${S}:${EGO_STORE_DIR}:$(get_golibdir_gopath)" \
GOCACHE="${T}/go-cache" \
go install -v -work -x -ldflags "-s -w -X ${MY_EGO_PN}.Version=${PV}" ./... || die
dobin bin/${PN}
dodoc src/"${MY_EGO_PN}"/{README.md,docs/*}
}
pkg_postinst() {
einfo "\nSee documentation:"
einfo " https://github.com/gcla/termshark/blob/master/docs/UserGuide.md"
einfo " ~$ bzip2 -dc usr/share/doc/termshark-${PV}/UserGuide.md.bz2 | less"
einfo " ~$ bzip2 -dc usr/share/doc/termshark-${PV}/FAQ.md.bz2 | less\n"
}