summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2016-03-18 03:27:49 -0700
committerZac Medico <zmedico@gentoo.org>2016-03-18 03:29:37 -0700
commit5315adfdd1fc67bbea2296e33d707f83fe6adffd (patch)
tree2244d14457c0714ec95e96e09ed7b41d8e35ae88 /sys-cluster/zookeepercli/zookeepercli-1.0.10.ebuild
parentdev-java/xsom: Clean up old. (diff)
downloadgentoo-5315adfdd1fc67bbea2296e33d707f83fe6adffd.tar.gz
gentoo-5315adfdd1fc67bbea2296e33d707f83fe6adffd.tar.bz2
gentoo-5315adfdd1fc67bbea2296e33d707f83fe6adffd.zip
sys-cluster/zookeepercli: new package
Package-Manager: portage-2.2.28
Diffstat (limited to 'sys-cluster/zookeepercli/zookeepercli-1.0.10.ebuild')
-rw-r--r--sys-cluster/zookeepercli/zookeepercli-1.0.10.ebuild65
1 files changed, 65 insertions, 0 deletions
diff --git a/sys-cluster/zookeepercli/zookeepercli-1.0.10.ebuild b/sys-cluster/zookeepercli/zookeepercli-1.0.10.ebuild
new file mode 100644
index 000000000000..d86f03b1d162
--- /dev/null
+++ b/sys-cluster/zookeepercli/zookeepercli-1.0.10.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit golang-build
+
+KEYWORDS="~amd64"
+EGO_PN="github.com/outbrain/zookeepercli/..."
+EGIT_COMMIT="v${PV}"
+SRC_URI="https://${EGO_PN%/*}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz
+https://github.com/outbrain/golib/archive/2418949ac30d9933e7412ccce41f1aa2ae8d5ae8.tar.gz -> golib-2418949ac30d9933e7412ccce41f1aa2ae8d5ae8.tar.gz
+https://github.com/samuel/go-zookeeper/archive/218e9c81c0dd8b3b18172b2bbfad92cc7d6db55f.tar.gz -> go-zookeeper-218e9c81c0dd8b3b18172b2bbfad92cc7d6db55f.tar.gz"
+DESCRIPTION="Simple, lightweight, dependable CLI for ZooKeeper"
+HOMEPAGE="https://${EGO_PN%/*}"
+LICENSE="Apache-2.0"
+SLOT="0/${PVR}"
+IUSE=""
+
+get_archive_go_package() {
+ local archive=${1} uri x
+ for x in ${SRC_URI}; do
+ if [[ ${x} == http* ]]; then
+ uri=${x}
+ elif [[ ${x} == ${archive} ]]; then
+ break
+ fi
+ done
+ uri=${uri#https://}
+ echo ${uri%/archive/*}
+}
+
+unpack_go_packages() {
+ local go_package x
+ # Unpack packages to appropriate locations for GOPATH
+ for x in ${A}; do
+ unpack ${x}
+ if [[ ${x} == *.tar.gz ]]; then
+ go_package=$(get_archive_go_package ${x})
+ mkdir -p "${S}/src/${go_package%/*}"
+ for x in ${go_package##*/}-*; do
+ [[ ${x} -ef ${S} ]] && continue
+ mv "${x}" "${S}/src/${go_package}" || die
+ done
+ fi
+ done
+}
+
+src_unpack() {
+ unpack_go_packages
+}
+
+src_compile() {
+ GOPATH="${WORKDIR}/${P}" \
+ go install -v -work -x ${EGO_BUILD_FLAGS} "${EGO_PN}" || die
+}
+
+golang_install_pkgs() {
+ insopts -m0644 -p # preserve timestamps for bug 551486
+ dobin "${S}/bin/zookeepercli"
+ insinto "$(dirname "${EPREFIX}$(get_golibdir)/pkg/$(go env GOOS)_$(go env GOARCH)/${EGO_PN%/*}")"
+ doins -r "${S}"/pkg/$(go env GOOS)_$(go env GOARCH)/${EGO_PN%/*}
+ insinto "$(dirname "${EPREFIX}$(get_golibdir)/src/${EGO_PN%/*}")"
+ doins -r "${S}"/src/${EGO_PN%/*}
+}