# $Id: PKGBUILD 47703 2009-07-25 14:37:19Z giovanni $
# Maintainer: kevin <kevin@archlinux.org>
# TU: Kritoke <kritoke@gamebox.net>
# Contributor: Luca Roccia <little_rock@users.sourceforge.net>
# Contributor: Sven-Hendrik Haase <sh@lutzhaase.com>
 
pkgname=boost
pkgver=1.41.0
_boostver=${pkgver//./_}
pkgrel=1
pkgdesc="Boost provides free peer-reviewed portable C++ source libraries."
arch=(i686 x86_64)
url="http://www.boost.org/"
depends=('python>=2.5' 'bzip2' 'zlib')
source=(http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}_${_boostver}.tar.bz2)
license=('custom')
options=(!ccache)
md5sums=('8bb65e133907db727a2a825c5400d0a6')
 
build() {
  cd ${srcdir}/${pkgname}_${_boostver}
  #export CFLAGS="${CFLAGS} -fno-strict-aliasing"
  #export CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"

  # build bjam
  cd ${srcdir}/${pkgname}_${_boostver}/tools/jam/src
  ./build.sh cc || return 1

  _bindir="bin.linuxx86"
  [ "${CARCH}" = "x86_64" ] && _bindir="bin.linuxx86_64"

  install -m755 -d ${pkgdir}/usr/bin
  install -m755 ${_bindir}/bjam ${pkgdir}/usr/bin/bjam || return 1
 
  # build bcp
  cd ${srcdir}/${pkgname}_${_boostver}/tools/bcp
  ../jam/src/${_bindir}/bjam || return 1
  install -m755 ${srcdir}/${pkgname}_${_boostver}/dist/bin/bcp \
                ${pkgdir}/usr/bin/bcp || return 1

  # build libs
  cd ${srcdir}/${pkgname}_${_boostver}
  # default "minimal" install: "release link=shared,static
  #      runtime-link=shared threading=multi"
  # --layout=tagged will add the "-mt" suffix for multithreaded libraries
  # and installs includes in /usr/include/boost.
  # --layout=system no longer adds the -mt suffix for multi-threaded libs.
  ./tools/jam/src/${_bindir}/bjam \
            release debug-symbols=off threading=single,multi \
            runtime-link=shared link=shared,static \
            cflags=-fno-strict-aliasing \
            --prefix=${pkgdir}/usr \
            -sPYTHON_ROOT=/usr \
            -sPYTHON_VERSION=2.6 \
            -sTOOLS=gcc \
            --layout=tagged \
            install || return 1
#            --with-wave install || return 1
#            -d2 <- debug  cflags=-fno-strict-aliasing \

  # build pyste
  cd ${srcdir}/${pkgname}_${_boostver}/libs/python/pyste/install
  python setup.py install --root=${pkgdir} || return 1

  # license
  install -m755 -d ${pkgdir}/usr/share/licenses/${pkgname}
  install -m644 ${srcdir}/${pkgname}_${_boostver}/LICENSE_1_0.txt \
                ${pkgdir}/usr/share/licenses/${pkgname}/ || return 1
}

