go-etcd-0_p20141013-r1.ebuild 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils
  5. GO_PN=github.com/coreos/${PN}
  6. DESCRIPTION="Go client library for etcd"
  7. HOMEPAGE="https://${GO_PN}"
  8. EGIT_COMMIT="25e2c63be8e8ab405014a78879e0992ae5ff55e8"
  9. SRC_URI="https://${GO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
  10. SLOT="0"
  11. LICENSE="Apache-2.0"
  12. KEYWORDS="~amd64"
  13. IUSE=""
  14. DEPEND=">=dev-lang/go-1.4"
  15. RDEPEND=""
  16. S=${WORKDIR}
  17. src_unpack() {
  18. default_src_unpack
  19. mkdir -p src/${GO_PN%/*} || die
  20. mv ${PN}-${EGIT_COMMIT} src/${GO_PN} || die
  21. }
  22. src_compile() {
  23. # Create a filtered GOROOT tree out of symlinks,
  24. # excluding go-etcd, for bug #503324.
  25. cp -sR /usr/lib/go goroot || die
  26. rm -rf goroot/src/${GO_PN} || die
  27. rm -rf goroot/pkg/linux_${ARCH}/${GO_PN} || die
  28. GOROOT=${WORKDIR}/goroot GOPATH=${WORKDIR} \
  29. go install -x ${GO_PN}/etcd || die
  30. }
  31. src_install() {
  32. insopts -m0644 -p # preserve timestamps for bug 551486
  33. insinto /usr/lib/go
  34. doins -r pkg
  35. insinto /usr/lib/go/src
  36. egit_clean
  37. doins -r src/*
  38. }