#!/bin/sh

### travis-tool -- Continuous integration test for travis

# BSD Owl Scripts (https://github.com/michipili/bsdowl)
# This file is part of BSD Owl Scripts
#
# Copyright © 2015 Michael Grünewald
#
# This file must be used under the terms of the CeCILL-B.
# This source file is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt

TRAVIS_WITH_TEX=${TRAVIS_FULL}
TRAVIS_WITH_NOWEB=${TRAVIS_FULL}
TRAVIS_WITH_FINDLIB=${TRAVIS_FULL}
INSTALL_PREFIX="${HOME}/.bsdowl"

eval $(opam config env --switch ${TRAVIS_OCAML_VERSION:?})

install -d "${INSTALL_PREFIX}"
autoconf
./configure\
    --prefix="${INSTALL_PREFIX}"\
    --with-gpg\
    --with-gm\
    --with-ocaml\
    --with-tex=${TRAVIS_WITH_TEX}\
    --with-noweb=${TRAVIS_WITH_NOWEB}\
    --with-credentials=sudo\
    --enable-test-findlib=${TRAVIS_WITH_FINDLIB}\
    --enable-test-noweb=no\
    --enable-test-texmf=no\
    --disable-test-gpg
bmake build
bmake install
./Library/Ancillary/testtool -R "${TRAVIS_TEST_EXCLUDE:+-x }${TRAVIS_TEST_EXCLUDE}"
test -f "${INSTALL_PREFIX}/share/bsdowl/bps.bpsconfig.mk"

### End of file `travis-tool'
