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

EAPI=8

inherit desktop xdg

if [[ ${PV} != 9999 ]]; then
	SRC_URI="https://github.com/paoloap/zaread/archive/refs/tags/v${PV}.tar.gz  -> ${P}.gh.tar.gz"
else
	inherit git-r3
	EGIT_REPO_URI="https://github.com/paoloap/zaread.git"
fi

DESCRIPTION="A lightweight document reader"
HOMEPAGE="https://github.com/paoloap/zaread"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"

IUSE="zathura"

#libreoffice + optionally zathura
DEPEND="
	virtual/ooo
	zathura? ( app-text/zathura )
"
RDEPEND="${DEPEND}"

DOCS=( README.md LICENSE )

src_compile() {
	true
}

src_install() {
	exeinto /usr/bin
	doexe ${PN}
	domenu ${PN}.desktop
	dodoc ${DOCS}
}

pkg_postinst() {
	xdg_desktop_database_update
}