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 | require botan |
| 5 | |
| 6 | check_if_built softhsm2 && exit 0 |
| 7 | start_build softhsm2 |
| 8 | |
| 9 | build_ok=0 |
| 10 | case "$DISTRIBUTION" in |
| 11 | openbsd ) |
| 12 | export AUTOCONF_VERSION="2.68" |
| 13 | export AUTOMAKE_VERSION="1.11" |
| 14 | append_ldflags "-L/usr/local/lib" |
| 15 | ;; |
| 16 | esac |
| 17 | case "$DISTRIBUTION" in |
| 18 | centos | \ |
| 19 | redhat | \ |
| 20 | fedora | \ |
| 21 | sl | \ |
| 22 | slackware | \ |
| 23 | debian | \ |
| 24 | ubuntu | \ |
| 25 | opensuse ) |
| 26 | ( |
| 27 | sh autogen.sh && |
| 28 | mkdir -p build && |
| 29 | cd build && |
| 30 | ../configure --prefix="$INSTALL_ROOT" \ |
| 31 | --disable-non-paged-memory \ |
| 32 | --with-p11-kit="$INSTALL_ROOT/usr/local/share/p11-kit/modules" \ |
| 33 | --with-migrate \ |
| 34 | --with-crypto-backend=botan \ |
| 35 | --with-botan="$INSTALL_ROOT" && |
| 36 | $MAKE && |
| 37 | $MAKE check && |
| 38 | $MAKE install && |
| 39 | cp "src/lib/common/softhsm2.conf" "$INSTALL_ROOT/etc/softhsm2.conf.build" |
| 40 | ) && |
| 41 | build_ok=1 |
| 42 | ;; |
| 43 | netbsd ) |
| 44 | ( |
| 45 | sh autogen.sh && |
| 46 | mkdir -p build && |
| 47 | cd build && |
| 48 | ../configure --prefix="$INSTALL_ROOT" \ |
| 49 | --disable-non-paged-memory \ |
| 50 | --with-p11-kit="$INSTALL_ROOT/usr/local/share/p11-kit/modules" \ |
| 51 | --with-migrate \ |
| 52 | --with-crypto-backend=botan \ |
| 53 | --with-botan="$INSTALL_ROOT" \ |
| 54 | --with-sqlite3=/usr/pkg && |
| 55 | $MAKE && |
| 56 | $MAKE check && |
| 57 | $MAKE install && |
| 58 | cp "src/lib/common/softhsm2.conf" "$INSTALL_ROOT/etc/softhsm2.conf.build" |
| 59 | ) && |
| 60 | build_ok=1 |
| 61 | ;; |
| 62 | freebsd | \ |
| 63 | openbsd ) |
| 64 | ( |
| 65 | sh autogen.sh && |
| 66 | mkdir -p build && |
| 67 | cd build && |
| 68 | ../configure --prefix="$INSTALL_ROOT" \ |
| 69 | --disable-non-paged-memory \ |
| 70 | --with-p11-kit="$INSTALL_ROOT/usr/local/share/p11-kit/modules" \ |
| 71 | --with-migrate \ |
| 72 | --with-crypto-backend=botan \ |
| 73 | --with-botan="$INSTALL_ROOT" \ |
| 74 | --with-sqlite3=/usr/local && |
| 75 | $MAKE && |
| 76 | $MAKE check && |
| 77 | $MAKE install && |
| 78 | cp "src/lib/common/softhsm2.conf" "$INSTALL_ROOT/etc/softhsm2.conf.build" |
| 79 | ) && |
| 80 | build_ok=1 |
| 81 | ;; |
| 82 | sunos | \ |
| 83 | suse ) |
| 84 | ( |
| 85 | sh autogen.sh && |
| 86 | mkdir -p build && |
| 87 | cd build && |
| 88 | ../configure --prefix="$INSTALL_ROOT" \ |
| 89 | --disable-non-paged-memory \ |
| 90 | --with-p11-kit="$INSTALL_ROOT/usr/local/share/p11-kit/modules" \ |
| 91 | --with-migrate \ |
| 92 | --with-crypto-backend=botan \ |
| 93 | --with-botan="$INSTALL_ROOT" && |
| 94 | $MAKE && |
| 95 | $MAKE check && |
| 96 | $MAKE install && |
| 97 | cp "src/lib/common/softhsm2.conf" "$INSTALL_ROOT/etc/softhsm2.conf.build" |
| 98 | ) && |
| 99 | build_ok=1 |
| 100 | ;; |
| 101 | esac |
| 102 | |
| 103 | finish |
| 104 | |
| 105 | if [ "$build_ok" -eq 1 ]; then |
| 106 | set_build_ok softhsm2 || exit 1 |
| 107 | exit 0 |
| 108 | fi |
| 109 | |
| 110 | exit 1 |