# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit toolchain-funcs

if [[ ${PV} == "9999" ]]; then
	EGIT_REPO_URI="https://gitlab.com/heikkiorsila/${PN}.git"
	inherit git-r3
else
	SRC_URI="https://zakalwe.fi/~shd/foss/xdms/${P}.tar.bz2"
	KEYWORDS="amd64 ~hppa ppc x86"
fi

DESCRIPTION="xDMS - Amiga DMS disk image decompressor"
HOMEPAGE="https://zakalwe.fi/~shd/foss/xdms"

LICENSE="public-domain"
SLOT="0"
IUSE=""

pkg_setup() {
	tc-export CC
}

src_prepare() {
	default
	sed -i Makefile.in \
		-e "s:COPYING::" \
		-e "s:share/doc/xdms-{VERSION}:share/doc/xdms-${PF}:" || die
	sed -i -e "s:-O2::" src/Makefile.in || die
}

src_configure() {
	./configure --prefix=/usr --package-prefix="${D}" || die
}