aboutsummaryrefslogtreecommitdiffstats
path: root/SoftHSMv2/testing/build-botan.sh
diff options
context:
space:
mode:
Diffstat (limited to 'SoftHSMv2/testing/build-botan.sh')
-rw-r--r--SoftHSMv2/testing/build-botan.sh85
1 files changed, 85 insertions, 0 deletions
diff --git a/SoftHSMv2/testing/build-botan.sh b/SoftHSMv2/testing/build-botan.sh
new file mode 100644
index 0000000..fc31217
--- /dev/null
+++ b/SoftHSMv2/testing/build-botan.sh
@@ -0,0 +1,85 @@
+#!/usr/bin/env bash
+source `dirname "$0"`/lib.sh && init || exit 1
+
+BOTAN="Botan-2.4.0"
+BOTAN_URL="https://botan.randombit.net/releases/$BOTAN.tgz"
+BOTAN_FILENAME="$BOTAN.tgz"
+BOTAN_HASH_TYPE="sha1"
+BOTAN_HASH="212587ae2458d51052c496fbcc79dc4162d33349"
+
+check_if_built botan && exit 0
+start_build botan
+
+BOTAN_SRC=`fetch_src "$BOTAN_URL" "$BOTAN_FILENAME" "$BOTAN_HASH_TYPE" "$BOTAN_HASH"`
+
+build_ok=0
+case "$DISTRIBUTION" in
+ centos | \
+ redhat | \
+ fedora | \
+ sl | \
+ slackware | \
+ ubuntu | \
+ debian | \
+ opensuse | \
+ suse )
+ (
+ gunzip -c "$BOTAN_SRC" | tar xf - &&
+ cd "$BOTAN" &&
+ ./configure.py --prefix="$INSTALL_ROOT" &&
+ $MAKE &&
+ $MAKE install
+ ) &&
+ build_ok=1
+ ;;
+ freebsd | \
+ netbsd | \
+ openbsd )
+ opt=""
+ if uname -a 2>/dev/null | grep -q "FreeBSD 10" 2>/dev/null; then
+ opt="--cc=clang"
+ fi
+ (
+ gunzip -c "$BOTAN_SRC" | tar xf - &&
+ cd "$BOTAN" &&
+ python2.7 ./configure.py --prefix="$INSTALL_ROOT" $opt &&
+ $MAKE &&
+ $MAKE install
+ ) &&
+ build_ok=1
+ ;;
+ sunos )
+ platform=`uname -p`
+ opt=""
+ case "$platform" in
+ i386)
+ opt="--cpu=i686"
+ ;;
+
+ sparc)
+ opt="--cpu=sparc64"
+ ;;
+
+ *)
+ exit 1
+ ;;
+ esac
+ (
+ gunzip -c "$BOTAN_SRC" | tar xf - &&
+ cd "$BOTAN" &&
+ ./configure.py --prefix="$INSTALL_ROOT" $opt &&
+ $MAKE &&
+ $MAKE install
+ ) &&
+ build_ok=1
+ ;;
+esac
+
+finish
+
+if [ "$build_ok" -eq 1 ]; then
+ set_build_ok botan || exit 1
+ exit 0
+fi
+
+exit 1