### this file is sourced not run
PKGVER=2.1.1
PKGBUILD=1
PKGARCH=i686

# source: james
TARBALL=libgd-$PKGVER.tar.xz
MD5SUM=9076f3abd1f9815d106da36467ea15bc
SRC_URL=https://bitbucket.org/libgd/gd-libgd/downloads/$TARBALL
BUNDLE=

SLACKREQ='libpng32 freetype2_32 fontconfig32 libjpeg-turbo32 libXpm32 libvpx32 libtiff32' # 
SLACKDESC="libgd32: libgd32 $PKGVER (Graphics library)  
libgd32:  
libgd32: GD is an open source code library for the dynamic creation of images by 
libgd32: programmers. GD is written in C, and wrappers are available for Perl, 
libgd32: PHP and other languages. GD creates PNG, JPEG, GIF, WebP, XPM, BMP 
libgd32: images, among other formats. GD is commonly used to generate charts, 
libgd32: graphics, thumbnails, and most anything else, on the fly. While not 
libgd32: restricted to use on the web, the most common applications of GD 
libgd32: involve website development.  
libgd32: 
libgd32: This contains 32-bit version of the library.
"

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/libgd* &&
	patch -Np1 -i ../pkg/libvpx2.patch
}

### package - only collect the libraries
pkg_package() {
	rm -rf bin sbin usr/bin usr/sbin usr/include usr/share
	mkdir -p usr/bin &&
	mv -v tmp/*-config-32 usr/bin
}

### build
pkg_build() {
	CONFFLAGS="$CONFFLAGS --disable-static"
	pkg_build_autoconf &&
	pkg_build_slackdesc &&
	
	# multilib
	mv -v /usr/bin/gdlib-config /tmp/gdlib-config-32
}
