NingSun | 0c89b3c | 2018-02-08 08:34:03 -0800 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | source `dirname "$0"`/lib.sh && init || exit 1 |
| 3 | |
| 4 | BOTAN="Botan-2.4.0" |
| 5 | BOTAN_URL="https://botan.randombit.net/releases/$BOTAN.tgz" |
| 6 | BOTAN_FILENAME="$BOTAN.tgz" |
| 7 | BOTAN_HASH_TYPE="sha1" |
| 8 | BOTAN_HASH="212587ae2458d51052c496fbcc79dc4162d33349" |
| 9 | |
| 10 | check_if_built botan && exit 0 |
| 11 | start_build botan |
| 12 | |
| 13 | BOTAN_SRC=`fetch_src "$BOTAN_URL" "$BOTAN_FILENAME" "$BOTAN_HASH_TYPE" "$BOTAN_HASH"` |
| 14 | |
| 15 | build_ok=0 |
| 16 | case "$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 | ;; |
| 76 | esac |
| 77 | |
| 78 | finish |
| 79 | |
| 80 | if [ "$build_ok" -eq 1 ]; then |
| 81 | set_build_ok botan || exit 1 |
| 82 | exit 0 |
| 83 | fi |
| 84 | |
| 85 | exit 1 |