# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

EGO_SRC="github.com/jopadan/xmcd2cue"
EGO_PN="${EGO_SRC}/..."

if [[ ${PV} == 9999 ]] ; then
	inherit golang-vcs
else
	EGIT_COMMIT="v${PV}"
	SRC_URI="https://github.com/jopadan/xmcd2cue/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
	inherit golang-vcs-snapshot
fi

inherit golang-build

KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux ~ppc-macos"
DESCRIPTION="Utility to convert xmcd to cue files"
HOMEPAGE="https://github.com/jopadan/xmcd2cue"
LICENSE="MIT"

SLOT="0/${PVR}"
IUSE=""

src_compile() {
	cd "${WORKDIR}/${P}/src/${EGO_SRC}/"
	go build xmcd2cue.go
}

src_install() {
	cd "${WORKDIR}/${P}/src/${EGO_SRC}/"
	dobin ${PN}
	dodoc LICENSE.md README.md 
}