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

TARBALL=gmp-$PKGVER.tar.xz
MD5SUM=f58fa8001d60c4c77595fbbb62b63c1d
BUNDLE=fatdog-base-8.2.tar
SRC_URL=http://distro.ibiblio.org/fatdog/source/800/$BUNDLE

SLACKREQ=
SLACKDESC="libgmp32: libgmp $PKGVER (multiprecision arithmetic library)  
libgmp32:  
libgmp32: The GMP package contains math libraries. These have useful functions for 
libgmp32: arbitrary precision arithmetic. This package is also needed by GCC (the 
libgmp32: GNU C Compiler).  
libgmp32: 
libgmp32: This is the 32-bit version of libgmp.
libgmp32: 
libgmp32: 
libgmp32: 
libgmp32:
"

### override download for LFS sources bundle
# $1-src-dir $2-tarball 
pkg_download() {
	echo downloading $BUNDLE for $TARBALL
	wget -P $1 $SRC_URL
	tar -xf $1/$BUNDLE --strip-components=1 -C $1 
	rm $1/$BUNDLE
}

### default pkg_prepare

### package - only collect the libraries
pkg_package() {
	rm -rf usr/share
}

### build
pkg_build() {
	cd /tmp/gmp*

	# don't optimise only for build-machine
	mv -v config{fsf,}.guess &&
	mv -v config{fsf,}.sub	&&

	CC="gcc -isystem /usr/include ${BUILD32}" \
	CXX="g++ -isystem /usr/include ${BUILD32}" \
	LDFLAGS="-Wl,-rpath-link,/usr/lib:/lib ${BUILD32}" \
	  ABI=32 ./configure --prefix=/usr --enable-cxx	 &&
	  
	make $MAKEFLAGS && make install &&
	
	mv -v /usr/include/gmp{,-32}.h &&
	pkg_build_slackdesc
}
