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

# source: post BLFS 7.8 updated 6-12-2018
TARBALL=serf-$PKGVER.tar.bz2
MD5SUM=370a6340ff20366ab088012cd13f2b57
SRC_URL=https://archive.apache.org/dist/serf/$TARBALL
BUNDLE=

SLACKREQ='libapr-util openssl' # require scons to build
SLACKDESC="libserf: libserf $PKGVER (HTTP client library)  
libserf:  
libserf: The Serf package contains a C-based HTTP client library built upon 
libserf: the Apache Portable Runtime (APR) library. It multiplexes 
libserf: connections, running the read/write communication asynchronously. 
libserf: Memory copies and transformations are kept to a minimum to provide 
libserf: high performance operation.  
libserf: 
libserf: 
libserf: 
libserf:
"

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	! [ -e /usr/bin/env ] && ln -s /tools/bin/env /usr/bin/env
	! [ -e /usr/bin/sed ] && ln -s /tools/bin/sed /usr/bin/sed
	cd /tmp/serf*

	# BLFS 11.3 - support openssl 3.x
	patch -Np1 -i ../pkg/serf-1.3.9-openssl3_fixes-1.patch &&

	# BLFS 11.3 patches
	sed -i "/Append/s:RPATH=libdir,::" SConstruct &&          # remove rpath from shared lib
	sed -i "/Default/s:lib_static,::" SConstruct &&           # disable static lib
	sed -i "/Alias/s:install_static,::" SConstruct &&         # disable static lib
	sed -i "/  print/{s/print/print(/; s/$/)/}" SConstruct && # support scons 3.x
	sed -i "/get_contents()/s/,/.decode()&/"    SConstruct && # support python3

	scons PREFIX=/usr LIBDIR=/usr/$LIBDIR &&
	scons PREFIX=/usr LIBDIR=/usr/$LIBDIR install &&

	pkg_build_slackdesc &&	
	rm -f /usr/bin/env /usr/bin/sed
}


