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

EAPI=7

inherit desktop

KEYWORDS="amd64"

SRC_URI="https://www.linphone.org/releases/linux/app/Linphone-4.3.2.AppImage"
DESCRIPTION="Linphone bin"
SLOT="1"
src_unpack() {
	../distdir/Linphone-4.3.2.AppImage --appimage-extract
	mv "${WORKDIR}/squashfs-root" "${WORKDIR}/linphone-desktop-bin-${PV}"
}

src_install() {
	mkdir "${D}/opt/"
	mkdir "${D}/opt/bin/"
	mv "${WORKDIR}/linphone-desktop-bin-${PV}/usr/" "${D}/opt/linphone/"
	ln -s /opt/linphone/bin/linphone "${D}/opt/bin/"
	chmod +x "${D}/opt/linphone/bin/linphone"
}
