# Maintainer: Michael Koloberdin <koloberdin@gmail.com>
pkgname=optipng
pkgver=0.7.7
pkgrel=0
pkgdesc="Compresses PNG files to a smaller size, without losing any information."
url="http://optipng.sourceforge.net/"
arch="all"
license="Zlib"
makedepends="libpng-dev"
subpackages="$pkgname-doc"
source="https://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz"

builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	./configure \
		--prefix=/usr \
		-with-system-libs
	make
}

check() {
	cd "$builddir"
	make test
}

package() {
	cd "$builddir"
	make prefix="$pkgdir/usr" mandir="$pkgdir/usr/share/man" install

	# install license
	install -Dm0644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

sha512sums="c33b7650143ab39944d2c066e07e10273c37024c5bfe7c00475bfb513af96afa081ff388164845d426d3bce624c0282dee574fa150e963f18d3683d821030280  optipng-0.7.7.tar.gz"
