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

### dummy template: collect commonly used boost shared libraries
TARBALL=libboost-common-$PKGVER-$PKGARCH-$PKGBUILD.txz
MD5SUM=
SRC_URL=libboost-$PKGVER-$PKGARCH-$PKGBUILD.txz
BUNDLE=

SLACKREQ=''
SLACKDESC="libboost-common: libboost-common $PKGVER (Common subset of libboost)  
libboost-common:  
libboost-common: This package contains a run-time subset of the full Boost 
libboost-common: library (libboost); it contains the boost library for system, 
libboost-common: filesystem, serialization (enough for encfs to run), thread, 
libboost-common: signals, date_time, graph and random. Note: it only contains 
libboost-common: the shared libraries - there is no static libraries and no 
libboost-common: header files here; use the full libboost if you need them.  
libboost-common: 
libboost-common: 
libboost-common:
"

# libs to retain
LIBS='system|[^w]serialization|date_time|random|regex|iostream|program_options'

PKG_NOMAKEPKG=yes
PKG_NOBUILD=yes

pkg_prepare() {
	: do nothing
}

pkg_download() {
	: do nothing
}

pkg_package() {
	if  [ -e $OUTPUT_DIR/$SRC_URL ] ; then
		echo extracting $SRC_URL
		mkdir tmp/libboost
		tar -xf $OUTPUT_DIR/$SRC_URL -C tmp/libboost
		
		# clean up unnecessary stuff
		cd tmp/libboost
		rm -rf install usr/include 2> /dev/null
		rm -rf usr/lib*/gcc 2> /dev/null
		find . \! -type d -a \! -name '*so*' -delete
		find . \! -type d | grep -vE $LIBS | xargs rm
		
		# build the package
		pkg_package_dir .
	else
		return 1
	fi
}

PKG_NOBUILD=yes
pkg_build() { 
	: do nothing
}
