diff options
Diffstat (limited to 'dev-go/go-oauth2/go-oauth2-9999.ebuild')
-rw-r--r-- | dev-go/go-oauth2/go-oauth2-9999.ebuild | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/dev-go/go-oauth2/go-oauth2-9999.ebuild b/dev-go/go-oauth2/go-oauth2-9999.ebuild index c527f264df38..ef2f019ae133 100644 --- a/dev-go/go-oauth2/go-oauth2-9999.ebuild +++ b/dev-go/go-oauth2/go-oauth2-9999.ebuild @@ -1,11 +1,19 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-go/go-oauth2/go-oauth2-9999.ebuild,v 1.2 2015/06/29 14:25:31 williamh Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-go/go-oauth2/go-oauth2-9999.ebuild,v 1.3 2015/06/29 15:59:38 williamh Exp $ EAPI=5 -inherit golang-build golang-vcs EGO_PN=golang.org/x/oauth2 +if [[ ${PV} = *9999* ]]; then + inherit golang-vcs +else + KEYWORDS="~amd64" + EGIT_COMMIT="b5adcc2dcdf009d0391547edc6ecbaff889f5bb9" + SRC_URI="https://github.com/golang/oauth2/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz" +fi +inherit golang-build + DESCRIPTION="Go client implementation for OAuth 2.0 spec" HOMEPAGE="https://godoc.org/golang.org/x/oauth2" LICENSE="BSD" @@ -13,3 +21,32 @@ SLOT="0" IUSE="" DEPEND="dev-go/go-net" RDEPEND="" + +if [[ ${PV} != *9999* ]]; then +src_unpack() { + local f + + for f in ${A} + do + case "${f}" in + *.tar|*.tar.gz|*.tar.bz2|*.tar.xz) + local destdir=${WORKDIR}/${P}/src/${EGO_SRC} + + debug-print "${FUNCNAME}: unpacking ${f} to ${destdir}" + + # XXX: check whether the directory structure inside is + # fine? i.e. if the tarball has actually a parent dir. + mkdir -p "${destdir}" || die + tar -C "${destdir}" -x --strip-components 1 \ + -f "${DISTDIR}/${f}" || die + ;; + *) + debug-print "${FUNCNAME}: falling back to unpack for ${f}" + + # fall back to the default method + unpack "${f}" + ;; + esac + done +} +fi |