1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
8 EGO_PN=github.com/google/mtail
9 EGIT_COMMIT=a780a6342bd70a8fb8ffe187ef988d5417d43a96
10 SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz
11 https://github.com/spf13/afero/archive/06b7e5f50606ecd49148a01a6008942d9b669217.tar.gz -> afero-06b7e5f50606ecd49148a01a6008942d9b669217.tar.gz
12 https://github.com/golang/glog/archive/23def4e6c14b4da8ac2ed8007337bc5eb5007998.tar.gz -> go-glog-23def4e6c14b4da8ac2ed8007337bc5eb5007998.tar.gz
13 https://github.com/fsnotify/fsnotify/archive/v1.4.2.tar.gz -> go-fsnotify-1.4.2.tar.gz
14 https://github.com/golang/tools/archive/76b6c242fbd3fa734fbfe26a653f14fd495cb03a.tar.gz -> go-tools-76b6c242fbd3fa734fbfe26a653f14fd495cb03a.tar.gz
15 https://github.com/golang/sys/archive/30237cf4eefd639b184d1f2cb77a581ea0be8947.tar.gz -> go-sys-30237cf4eefd639b184d1f2cb77a581ea0be8947.tar.gz
16 https://github.com/golang/text/archive/b01949dc0793a9af5e4cb3fce4d42999e76e8ca1.tar.gz -> go-text-b01949dc0793a9af5e4cb3fce4d42999e76e8ca1.tar.gz
18 https://github.com/kylelemons/godebug/archive/d99083b96f422f8fd5a93bc02040acec769e178f.tar.gz -> godebug-d99083b96f422f8fd5a93bc02040acec769e178f.tar.gz
20 DESCRIPTION="A tool for extracting metrics from application logs"
21 HOMEPAGE="https://${EGO_PN}/"
25 DEPEND=">=dev-lang/go-1.6:="
28 get_archive_go_package() {
29 local archive=${1} uri x
30 for x in ${SRC_URI}; do
31 if [[ ${x} == http* ]]; then
33 elif [[ ${x} == ${archive} ]]; then
40 github.com/fsnotify/fsnotify)
41 echo "gopkg.in/fsnotify.v1|fsnotify-*"
43 github.com/golang/glog)
44 echo "${uri}|${uri##*/}-*"
47 echo "golang.org/x/${uri##*/}|${uri##*/}-*"
50 echo "${uri}|${uri##*/}-*"
55 unpack_go_packages() {
57 # Unpack packages to appropriate locations for GOPATH
60 if [[ ${x} == *.tar.gz ]]; then
61 go_package=$(get_archive_go_package ${x})
63 go_package=${go_package%|*}
64 mkdir -p src/${go_package%/*}
65 mv ${x} src/${go_package} || die
78 sed '/^[[:space:]]*go get .*/d' -i "${S}/src/${EGO_PN}/Makefile" || die
83 go install -v -work -x ${EGO_BUILD_FLAGS} "golang.org/x/tools/cmd/goyacc" || die
84 PATH=${S}/bin:${PATH} emake -C "${S}/src/${EGO_PN}"
88 cd "${S}/src/${EGO_PN}" || die
94 dodoc "${S}/src/${EGO_PN}/"{CONTRIBUTING.md,README.md,TODO}