# Template file for 'kvpm'
pkgname=kvpm
version=0.9.10
revision=1
archs="i686 x86_64"
hostmakedepends="cmake extra-cmake-modules automoc4 kdoctools kdesignerplugin AppStream-qt"
makedepends="qt5-devel kdoctools-devel kcoreaddons-devel ki18n-devel kdelibs4support-devel liblvm2app-devel libparted-devel"
#depends="parted lvm2>=2.02.98 kdelibs4support hicolor-icon-theme"
depends="parted lvm2 kdelibs4support hicolor-icon-theme breeze-icons"
short_desc="Front end for Linux LVM and GNU Parted"
maintainer="reback00 <reback00@protonmail.com>"
license="GPL-3.0-or-later"
homepage="https://sourceforge.net/projects/kvpm/"
distfiles="${SOURCEFORGE_SITE}/project/${pkgname}/${pkgname}-${version}.tar.gz"
checksum=16c44cf8f7bfbe3ba1c203b7245bc43bd66da847eb138d4c2a82a706850cc41c
patch_args="-Np1"

pre_configure() {
	sed -i "s:bin/kvpm:bin/kvpm-pkexec:g" kvpm.desktop
}

do_build() {
	sed -i'' -e 's/SBIN/BIN/' kvpm/CMakeLists.txt
	mkdir -p build
	cd build
	cmake -DCMAKE_INSTALL_PREFIX=/usr \
			-DCMAKE_BUILD_TYPE=Release ..
	make ${makejobs} || return 1
}

do_install() {
	cd "${wrksrc}/build"
	make DESTDIR="${DESTDIR}" install
}

post_install() {
	vinstall ${FILESDIR}/org.void.pkexec.kvpm.policy 644 /usr/share/polkit-1/actions
	vbin ${FILESDIR}/kvpm-pkexec
}
