# Contributor: Andrew Domaszek <brimston3@hg0.us>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=ebook-tools
pkgver=0.2.2
pkgrel=5
pkgdesc="Tools for accessing and converting various ebook file formats."
url="https://sourceforge.net/projects/ebook-tools/"
# ppc64le, s390x, riscv64 and loongarch64 blocked by texlive
arch="all !s390x !riscv64 !ppc64le !loongarch64"
license="MIT"
depends_dev="
	libxml2-dev
	libzip-dev
	"
makedepends="
	$depends_dev
	cmake
	doxygen
	graphviz
	samurai
	texlive
	texlive-dvi
	"
subpackages="$pkgname-dev $pkgname-doc"
source="https://downloads.sourceforge.net/ebook-tools/ebook-tools-$pkgver.tar.gz
	10-cmake_libzip_zipconf_path.patch
	"
options="!check"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build
	cmake --build build --target doc
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	mkdir -p "$pkgdir"/usr/share/doc/ebook-tools
	cp -r build/doc/html "$pkgdir"/usr/share/doc/ebook-tools/
}

sha512sums="
b4518249835ed7cc672392bf2f8b1c62bc218e41c53663bb26ab34c9e43a99b6b7ae794babdb4bd775e467bb17918703a66ee57c8cf94cb7afc4ba2a7f74816a  ebook-tools-0.2.2.tar.gz
5fadd9346232192ae618993c5f48ab84fac84d32dce3be55e4485d756f5a364569298488960bd21c0783d5e160a186f6f335d92194c5f63fc619218335f117ed  10-cmake_libzip_zipconf_path.patch
"
