# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=giflib
pkgver=5.2.1
pkgrel=0
pkgdesc="Library for reading and writing GIF images"
url="https://sourceforge.net/projects/giflib/"
arch="all"
license="MIT"
depends=""
makedepends="libsm-dev libx11-dev util-linux-dev xmlto"
checkdepends="coreutils"
subpackages="$pkgname-dev $pkgname-doc $pkgname-utils"
source="https://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz"

build() {
	sed -i '/^PREFIX =/d
		/^OFLAGS/d' \
		Makefile
	make PREFIX=/usr OFLAGS="$CFLAGS"
}

check() {
	make check
}

package() {
	make PREFIX=/usr DESTDIR="$pkgdir" install
	install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
}

utils() {
	pkgdesc="Programs for manipulating GIF images"
	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
}

sha512sums="4550e53c21cb1191a4581e363fc9d0610da53f7898ca8320f0d3ef6711e76bdda2609c2df15dc94c45e28bff8de441f1227ec2da7ea827cb3c0405af4faa4736  giflib-5.2.1.tar.gz"