]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
travis: setup build env
authorMarek Vavruša <marek.vavrusa@nic.cz>
Wed, 28 Jan 2015 16:31:08 +0000 (17:31 +0100)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Wed, 28 Jan 2015 16:31:08 +0000 (17:31 +0100)
.travis.yml
scripts/bootstrap-depend.sh [new file with mode: 0755]

index a495d32f9697a59f8aa126259ec4155d50b6d477..db93cd40b8c2a20a224b9b73600cc8deb8b92955 100644 (file)
@@ -1,33 +1,18 @@
 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
diff --git a/scripts/bootstrap-depend.sh b/scripts/bootstrap-depend.sh
new file mode 100755 (executable)
index 0000000..0e00468
--- /dev/null
@@ -0,0 +1,57 @@
+#!/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