# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libmng
pkgver=2.0.3
pkgrel=1
pkgdesc="A collection of routines used to create and manipulate MNG format graphics files"
url="http://www.libmng.com/"
arch="all"
license="custom"
depends=""
depends_dev="libjpeg-turbo-dev"
makedepends="$depends_dev zlib-dev lcms2-dev autoconf automake libtool"
subpackages="$pkgname-dev $pkgname-doc"
source="http://downloads.sourceforge.net/sourceforge/libmng/libmng-$pkgver.tar.gz"

_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	cd "$_builddir"
	autoreconf --force --install
}

build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--enable-shared \
		--disable-static \
		--with-zlib \
		--with-jpeg \
		--with-lcms2 \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

md5sums="7e9a12ba2a99dff7e736902ea07383d4  libmng-2.0.3.tar.gz"
sha256sums="cf112a1fb02f5b1c0fce5cab11ea8243852c139e669c44014125874b14b7dfaa  libmng-2.0.3.tar.gz"
sha512sums="dc4035132fb85bee87785a4047c6727943fcbc10403bb24f674a600901ca7a57f589e7c8c41c7df153e3eeab85d032865126dd433a5fa990272ac8b6daf9314c  libmng-2.0.3.tar.gz"
