language: c
compiler:
- gcc
+env:
+ global:
+ - PKG_CONFIG_PATH="${HOME}/fakeroot/lib/pkgconfig"
+ - LDFLAGS="-L${HOME}/fakeroot/lib"
before_script:
- - sudo apt-get update -q -y
- - sudo apt-get install -q -y
- git-core
- pkg-config
- flex
- bison
- libssl-dev
- liburcu-dev
- liblmdb-dev
- libcmocka-dev
- - git clone -b resolver_improvements https://github.com/CZNIC-Labs/knot.git
- - cd knot
- - autoreconf -if
- - ./configure
- - make
- - sudo make install
- - cd ..
- - git clone https://github.com/libuv/libuv.git
- - cd libuv
- - sh autogen.sh
- - ./configure
- - make
- - sudo make install
- - sudo ldconfig
+ - ./scripts/bootstrap-depends.sh ${HOME}/fakeroot
script:
- - autoreconf -if
+ - autoreconf -i
- ./configure
- make
- make check
+sudo: false
+cache:
+ directories:
+ - ${HOME}/fakeroot
--- /dev/null
+#!/bin/sh
+set -e
+
+PKG_CONFIG_PATH="${1}/lib/pkgconfig"
+
+if [ -z ${1} ]; then
+ echo "$0 <fakeroot>"
+ exit 1
+fi
+
+install -d ${1}
+
+# lmdb
+if [ ! -e ${1}/include/lmdb.h ]; then
+ git clone https://gitorious.org/mdb/mdb.git || true
+ cd mdb/libraries/liblmdb
+ make
+ install -d ${1}/lib ${1}/include
+ install -t ${1}/lib liblmdb.so
+ install -t ${1}/include lmdb.h
+ cd ../../..
+fi
+
+# liburcu
+if [ ! -e ${1}/include/urcu.h ]; then
+ git clone git://git.urcu.so/userspace-rcu.git || true
+ cd userspace-rcu
+ ./bootstrap
+ ./configure --prefix=${1}
+ make
+ make install
+ cd ..
+fi
+
+# libknot
+if [ ! -e ${1}/include/libknot ]; then
+ git clone https://github.com/CZNIC-Labs/knot.git || true
+ cd knot
+ git checkout resolver_improvements
+ autoreconf -i
+ ./configure --prefix=${1}
+ make
+ make install
+ cd ..
+fi
+
+# libuv
+if [ ! -e ${1}/include/uv.h ]; then
+ git clone https://github.com/libuv/libuv.git || true
+ cd libuv
+ sh autogen.sh
+ ./configure --prefix=${1}
+ make
+ make install
+fi
+
+ldconfig || true