# Template file for 'boost'
pkgname=boost
version=1.44.0
revision=3
_boostver="$(echo $version|sed 's|\.|_|g')"
wrksrc=${pkgname}_${_boostver}
distfiles="${SOURCEFORGE_SITE}/$pkgname/${pkgname}_${_boostver}.tar.bz2"
makedepends="zlib-devel icu-devel python-devel"
short_desc="Free peer-reviewed portable C++ source libraries"
maintainer="Juan RP <xtraeme@gmail.com>"
checksum=45c328029d97d1f1dc7ff8c9527cd0c5cc356636084a800bca2ee4bfab1978db
long_desc="
 boost is a library for applications dealing with netlink sockets.
 The library provides an interface for raw netlink messaging and various
 netlink family specific interfaces."

subpackages="boost-build boost-devel boost-jam boost-python"

do_build()
{
	cd ${wrksrc} && ./bootstrap.sh -prefix=${DESTDIR}/usr || return 1
	cd ${wrksrc} && ./bjam cflags=-fno-strict-aliasing ${makejobs} || return 1
}

do_install()
{
	# Install bjam
	_bindir="bin.linuxx86"
	[ "${XBPS_MACHINE}" = "x86_64" ] && _bindir="bin.linuxx86_64"
	install -m755 -d ${DESTDIR}/usr/bin
	install -m755 ${wrksrc}/tools/jam/src/${_bindir}/bjam \
		${DESTDIR}/usr/bin || return 1

	# Install headers/libs
	cd ${wrksrc} && ./bjam --prefix=${DESTDIR}/usr install || return 1

	# Install Boost.Build stuff.
	install -d ${DESTDIR}/usr/share/boost-build
	cd ${wrksrc}/tools/build/v2 && cp -a . ${DESTDIR}/usr/share/boost-build
	find ${DESTDIR}/usr/share/boost-build \
		-type f -name \*.orig -exec rm -f {} \;
	( echo '# System wide configuration file for Boost.Build.' ; \
	  echo ; \
	  echo 'using gcc ;' ; ) >${wrksrc}/site-config.jam
	install -m644 -D ${wrksrc}/site-config.jam \
		${DESTDIR}/etc/site-config.jam

	# license
	install -d ${DESTDIR}/usr/share/licenses/${pkgname}
	install -m644 ${wrksrc}/LICENSE_1_0.txt \
		${DESTDIR}/usr/share/licenses/${pkgname}/ || return 1
}