# Contributor: k0r10n <k0r10n.dev@gmail.com>
# Maintainer:
pkgname=ebook-tools
pkgver=0.2.2
pkgrel=1
pkgdesc="Tools for accessing and converting various ebook file formats"
url="http://sourceforge.net/projects/ebook-tools/"
arch="x86 x86_64"
license="MIT"
depends=
depends_dev="libxml2-dev libzip-dev"
makedepends="$depends_dev cmake pkgconfig"
install=""
subpackages="$pkgname-dev"
source="http://downloads.sourceforge.net/project/ebook-tools/ebook-tools/${pkgver}/${pkgname}-${pkgver}.tar.gz"

_builddir="$srcdir"/${pkgname}-${pkgver}
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	mkdir -p "$_builddir"/build
}

build() {
	cd "$_builddir"/build
	cmake -DCMAKE_BUILD_TYPE=Release \
	      -DCMAKE_INSTALL_PREFIX=/usr \
	      ../ || return 1
	make || return 1
}

package() {
	cd "$_builddir"/build
	make DESTDIR="$pkgdir" install || return 1
}

md5sums="67bce67ceb72dcc3578d6a81ef92b29b  ebook-tools-0.2.2.tar.gz"
sha256sums="cbc35996e911144fa62925366ad6a6212d6af2588f1e39075954973bbee627ae  ebook-tools-0.2.2.tar.gz"
sha512sums="b4518249835ed7cc672392bf2f8b1c62bc218e41c53663bb26ab34c9e43a99b6b7ae794babdb4bd775e467bb17918703a66ee57c8cf94cb7afc4ba2a7f74816a  ebook-tools-0.2.2.tar.gz"