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

# File was automatically generated by automatic-ebuild-maker and edited
# https://github.com/BlueManCZ/automatic-ebuild-maker

EAPI=7
inherit desktop unpacker xdg

DESCRIPTION="Easy to use image editor "
HOMEPAGE="http://www.pixeluvo.com"
SRC_URI="http://www.pixeluvo.com/downloads/pixeluvo_1.6.0-2_amd64.deb -> ${P}.deb"

LICENSE="Trial"
SLOT="0"
KEYWORDS="-* ~amd64"
RESTRICT="bindist mirror"
IUSE="doc"

RDEPEND="dev-libs/openssl
	media-libs/libpng
	sys-libs/zlib"

QA_PREBUILT="*"

PATCHES=(
	"${FILESDIR}/${PN}-desktop-file.patch"
)

S=${WORKDIR}

src_prepare() {
	default

	if use doc ; then
		unpack "usr/share/doc/pixeluvo/changelog.gz" || die "unpack failed"
		rm -f "usr/share/doc/pixeluvo/changelog.gz" || die "rm failed"
		mv "changelog" "usr/share/doc/pixeluvo" || die "mv failed"
	fi

	rm -rf "opt/pixeluvo/libs64/libcrypto.so.1.0.0" || die "rm failed"
	rm -rf "opt/pixeluvo/libs64/libpng16.so.16" || die "rm failed"
	rm -rf "opt/pixeluvo/libs64/libssl.so.1.0.0" || die "rm failed"
	rm -rf "opt/pixeluvo/libs64/libz.so.1" || die "rm failed"
}

src_install() {
	cp -a . "${ED}" || die "cp failed"

	rm -r "${ED}/usr/share/doc/pixeluvo" || die "rm failed"

	rm "${ED}/opt/pixeluvo/pixeluvo.png" || die "rm failed"
	doicon "opt/pixeluvo/pixeluvo.png" || die "doicon failed"

	if use doc ; then
		dodoc -r "usr/share/doc/pixeluvo/"* || die "dodoc failed"
	fi
}