# Copyright 2019-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

DESCRIPTION="A pure bash session or application launcher. Inspired by cdm, tdm and krunner"
HOMEPAGE="https://loh-tar.github.io/tbsm/"

if [[ ${PV} == 9999 ]]; then
	inherit git-r3
	EGIT_REPO_URI="https://github.com/loh-tar/${PN}.git"
else
	SRC_URI="https://github.com/loh-tar/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
	KEYWORDS="~amd64 ~arm64 ~x86"
fi

LICENSE="GPL-2"
SLOT="0"

DEPEND="app-shells/bash:0"
RDEPEND="${DEPEND}"

src_prepare() {
	default

	# follow Gentoo policy paths - /usr/share/doc/${PF} - bug #801082
	sed -i -e "s|doc/\${MyName}|doc/${PF}|g" Makefile || die "makefile fix broke!"
	sed -i -e "s|doc/tbsm|doc/${PF}|g" src/tbsm || die "tbsm fix broke!"
}