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

# 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="libffi: libffi $PKGVER (Foreign Function Interface library)  
libffi:  
libffi: The libffi library provides a portable, high level programming 
libffi: interface to various calling conventions. This allows a programmer to 
libffi: call any function specified by a call interface description at run 
libffi: time.  
libffi: 
libffi: 
libffi: 
libffi: 
libffi:
"

### 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
### default pkg_package
### 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
}


