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

# source: BLFS 8.1 / LFS 8.2 / LFS 11.3
TARBALL=libffi-$PKGVER.tar.gz
MD5SUM=0da1a5ed7786ac12dcbaf0d499d8a049
BUNDLE=fatdog-base-11.3.tar
SRC_URL=http://distro.ibiblio.org/fatdog/source/900/$BUNDLE

#MD5SUM=83b89587607e3eb65c70d361f13bab43
#SRC_URL=ftp://sourceware.org/pub/libffi/$TARBALL
#BUNDLE=

SLACKREQ=
SLACKDESC="libffi32: libffi $PKGVER (Foreign Function Interface library)  
libffi32:  
libffi32: The libffi library provides a portable, high level programming 
libffi32: interface to various calling conventions. This allows a programmer to 
libffi32: call any function specified by a call interface description at run 
libffi32: time.  
libffi32: 
libffi32: This is the 32-bit version of the library.
libffi32: 
libffi32: 
libffi32:
"

### 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 bin sbin usr/bin usr/sbin usr/include usr/share
}

### build
pkg_build() {
	cd /tmp/libffi*/ &&
	
	# BLFS 8.1: Install headers in /usr/include
	#sed -e '/^includesdir/ s/$(libdir).*$/$(includedir)/' \
	#	-i include/Makefile.in &&
	#
	#sed -e '/^includedir/ s/=.*$/=@includedir@/' \
	#	-e 's/^Cflags: -I${includedir}/Cflags:/' \
	#	-i libffi.pc.in        &&

	# note: LFS 11.2 disables exec-static-tramp because some BLFS 11.2 packages don't support it yet
	# In LFS 11.3 it is left enabled.
	#CONFFLAGS="$CONFFLAGS --disable-exec-static-tramp" &&
	
	pkg_build_autoconf && pkg_build_slackdesc
}


