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

# source: BLFS 7.5 updated to to latest
TARBALL=curl-$PKGVER.tar.bz2
MD5SUM=9ea3123449439bbd960cd25cf98796fb
SRC_URL=http://curl.haxx.se/download/$TARBALL
BUNDLE=

SLACKREQ='openssl32 libssh2_32 librtmp32' # libc-ares (build-time only)
SLACKDESC="curl32: curl32 $PKGVER (Versatile file transfer)  
curl32:  
curl32: The cURL package contains an utility and a library used for transferring 
curl32: files both download and *upload* with URL syntax to any of the following 
curl32: protocols: DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS POP3 POP3S 
curl32: RTSP SCP SFTP SMTP SMTPS TELNET TFTP.  
curl32: 
curl32: This contains the 32-bit version of the library
curl32: 
curl32: 
curl32: 
"

### default pkg_download
### default pkg_prepare
### package - only collect the libraries
pkg_package() {
	rm -rf bin sbin usr/bin usr/sbin usr/include usr/share etc
	mkdir -p usr/bin usr/include/curl &&
	mv -v tmp/curl-config-32 usr/bin &&
	mv -v tmp/curlbuild-32.h usr/include/curl
}

### build
pkg_build() {
	LIBDIR=lib
	#CONFFLAGS="$CONFFLAGS --disable-static --enable-threaded-resolver --disable-smb \
	#--with-ca-path=/etc/ssl/certs"
	CONFFLAGS="$CONFFLAGS --disable-static --disable-smb --enable-ares \
	--with-ca-path=/etc/ssl/certs"	
	
	pkg_build_autoconf && 
	ln -sf /usr/$LIBDIR/libcurl.so.4.4.0 /usr/$LIBDIR/libcurl.so.3 && # Some games link to the older curl.
	
	pkg_build_slackdesc &&
	
	# CBLFS multilib patch
	mv -v /usr/bin/curl-config /tmp/curl-config-32 &&
	mv -v /usr/include/curl/curlbuild.h /tmp/curlbuild-32.h
}


