language: c
os:
    - linux
    - osx
compiler:
    - clang
notifications:
    email:
        on_success: change
        on_failure: change
    slack:
        rooms: cznic:xNJmvHU2xu2aGtN7Y2eqHKoD
        on_success: change
        on_failure: change
    webhooks:
        urls: https://webhooks.gitter.im/e/66485d8f591942052faa
        on_success: always
        on_failure: always
matrix:
    fast_finish: true
    allow_failures:
        - os: osx
env:
    global:
        - PKG_CONFIG_PATH="${HOME}/.local/lib/pkgconfig"
        - PATH="${HOME}/.local/bin:/usr/local/bin:${PATH}"
        - CFLAGS="${CFLAGS} -O0 -g -fPIC"
        - LD_LIBRARY_PATH="${HOME}/.local/lib"
        - DYLD_LIBRARY_PATH="${HOME}/.local/lib"
        - MAKEOPTS="-j2"
before_script:
    - ./scripts/bootstrap-depends.sh ${HOME}/.local
script:
    - make ${MAKEOPTS} install check COVERAGE=1 PREFIX=${HOME}/.local
after_success:
    - test $TRAVIS_OS_NAME = linux && coveralls -i lib -i daemon -x ".c" --gcov-options '\-lp'
sudo: false
cache:
    directories:
    - ${HOME}/.local
    - ${HOME}/.cache/pip
before_cache:
    - rm -f ${HOME}/.local/bin/kresd
    - rm -f ${HOME}/.local/lib/libkres.a
    - rm -rf ${HOME}/.local/include/libkres
    - rm -rf ${HOME}/.local/lib/kdns_modules
