# Maintainer: Natanael Copa pkgname=giflib pkgver=4.2.1 pkgrel=0 pkgdesc="A library for reading and writing gif images" url="http://sourceforge.net/projects/giflib/" arch="all" license="MIT" subpackages="$pkgname-dev $pkgname-doc $pkgname-utils" depends= makedepends="libx11-dev libsm-dev util-linux-dev xmlto" source="http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.bz2" build () { cd "$srcdir"/$pkgname-$pkgver ./configure --prefix=/usr || return 1 make || return 1 MAJOR=`echo $pkgver | sed 's/\([0-9]\+\)\..*/\1/'` gcc -shared -Wl,-soname,libungif.so.${MAJOR} -Llib/.libs -lgif -o libungif.so.$pkgver || return 1 } package() { cd "$srcdir"/$pkgname-$pkgver make DESTDIR="$pkgdir" install || return 1 rm "$pkgdir"/usr/lib/*.la || return 1 install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING \ || return 1 install -m755 libungif.so.$pkgver "$pkgdir"/usr/lib/ || return 1 ln -sf libungif.so.$pkgver "$pkgdir"/usr/lib/libungif.so.4 || return 1 ln -sf libungif.so.4 "$pkgdir"/usr/lib/libungif.so || return 1 } utils() { pkgdesc="Programs for manipulating GIF format image files" mkdir -p "$subpkgdir"/usr mv "$pkgdir"/usr/bin "$subpkgdir"/usr/ } md5sums="bbd3324af24156d5d7e66ab1cee8508d giflib-4.2.1.tar.bz2" sha256sums="3f6c9dea12e41d00e253f7465d714d09248a8bcbed3415c25fd9ce50a1cdded6 giflib-4.2.1.tar.bz2" sha512sums="21e0db2db15ce65f27acd4e2b6f9aaf72a95781bbf20150a869a25c1d722d731ae20a396c973d325ae4eba22fa64d19c485382cc202f5ad8e3172482dffb8d73 giflib-4.2.1.tar.bz2"