blob: fc312173f8a3bda83f560658d1aa39a61c276e3e [file] [log] [blame]
NingSun0c89b3c2018-02-08 08:34:03 -08001#!/usr/bin/env bash
2source `dirname "$0"`/lib.sh && init || exit 1
3
4BOTAN="Botan-2.4.0"
5BOTAN_URL="https://botan.randombit.net/releases/$BOTAN.tgz"
6BOTAN_FILENAME="$BOTAN.tgz"
7BOTAN_HASH_TYPE="sha1"
8BOTAN_HASH="212587ae2458d51052c496fbcc79dc4162d33349"
9
10check_if_built botan && exit 0
11start_build botan
12
13BOTAN_SRC=`fetch_src "$BOTAN_URL" "$BOTAN_FILENAME" "$BOTAN_HASH_TYPE" "$BOTAN_HASH"`
14
15build_ok=0
16case "$DISTRIBUTION" in
17 centos | \
18 redhat | \
19 fedora | \
20 sl | \
21 slackware | \
22 ubuntu | \
23 debian | \
24 opensuse | \
25 suse )
26 (
27 gunzip -c "$BOTAN_SRC" | tar xf - &&
28 cd "$BOTAN" &&
29 ./configure.py --prefix="$INSTALL_ROOT" &&
30 $MAKE &&
31 $MAKE install
32 ) &&
33 build_ok=1
34 ;;
35 freebsd | \
36 netbsd | \
37 openbsd )
38 opt=""
39 if uname -a 2>/dev/null | grep -q "FreeBSD 10" 2>/dev/null; then
40 opt="--cc=clang"
41 fi
42 (
43 gunzip -c "$BOTAN_SRC" | tar xf - &&
44 cd "$BOTAN" &&
45 python2.7 ./configure.py --prefix="$INSTALL_ROOT" $opt &&
46 $MAKE &&
47 $MAKE install
48 ) &&
49 build_ok=1
50 ;;
51 sunos )
52 platform=`uname -p`
53 opt=""
54 case "$platform" in
55 i386)
56 opt="--cpu=i686"
57 ;;
58
59 sparc)
60 opt="--cpu=sparc64"
61 ;;
62
63 *)
64 exit 1
65 ;;
66 esac
67 (
68 gunzip -c "$BOTAN_SRC" | tar xf - &&
69 cd "$BOTAN" &&
70 ./configure.py --prefix="$INSTALL_ROOT" $opt &&
71 $MAKE &&
72 $MAKE install
73 ) &&
74 build_ok=1
75 ;;
76esac
77
78finish
79
80if [ "$build_ok" -eq 1 ]; then
81 set_build_ok botan || exit 1
82 exit 0
83fi
84
85exit 1