summaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-04-25 17:21:38 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-04-25 17:21:38 +0200
commitc46113823e5bde62ef5a1ff53ec26d954b3ff53e (patch)
treed0cb8ca3fb43c3d97abbb0cfa2451ea92263bd1c /dist
parent6753ffb46d7eeda1d4d6939257397ce9306e4946 (diff)
downloadcssh-c46113823e5bde62ef5a1ff53ec26d954b3ff53e.tar.gz
cssh-c46113823e5bde62ef5a1ff53ec26d954b3ff53e.tar.bz2
added CI on Travis
Diffstat (limited to 'dist')
-rw-r--r--dist/travis/before_script.sh30
-rw-r--r--dist/travis/script.sh41
2 files changed, 71 insertions, 0 deletions
diff --git a/dist/travis/before_script.sh b/dist/travis/before_script.sh
new file mode 100644
index 0000000..7538bb5
--- /dev/null
+++ b/dist/travis/before_script.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+set -e
+
+OS=$(uname -s)
+
+case $OS in
+ Linux)
+ sudo apt-get update -qq
+ sudo apt-get install -y \
+ cmake \
+ libssh-dev
+ ;;
+
+ Darwin)
+ brew update
+ brew install \
+ cmake \
+ libssh \
+ gettext \
+ || true
+ # make sure cmake finds the brew version of gettext
+ brew link --force gettext || true
+ ;;
+
+ *)
+ echo "ERROR: unknown operating system '$OS'."
+ ;;
+esac
+
diff --git a/dist/travis/script.sh b/dist/travis/script.sh
new file mode 100644
index 0000000..55c6890
--- /dev/null
+++ b/dist/travis/script.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+set -e
+
+OS=$(uname -s)
+
+case $OS in
+ Linux)
+ mkdir build
+ cd build
+ cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release \
+ -DLIB_INSTALL_DIR=lib -DCMAKE_CXX_FLAGS=-g \
+ ..
+ make VERBOSE=1
+ make VERBOSE=1 test
+ sudo make VERBOSE=1 install
+ cd ..
+ ;;
+
+ Darwin)
+ # forcing brew versions (of gettext) over Mac versions
+ export CFLAGS=-I/usr/local
+ export CXXFLAGS=-I/usr/local
+ export LDFLAGS=-L/usr/local/lib
+ mkdir build
+ cd build
+ cmake \
+ -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_CXX_FLAGS=-g -G Xcode \
+ ..
+ xcodebuild -configuration Release -target ALL_BUILD
+ xcodebuild -configuration Release -target RUN_TESTS
+ sudo xcodebuild -configuration Release -target install
+ cd ..
+ ;;
+
+ *)
+ echo "ERROR: unknown operating system '$OS'."
+ ;;
+esac
+