2021-04-23 04:53:32 +00:00
|
|
|
#!/bin/sh
|
2020-08-05 17:00:52 +00:00
|
|
|
|
2021-09-29 09:30:59 +00:00
|
|
|
case "`./config.guess`" in
|
2021-01-08 03:26:32 +00:00
|
|
|
*-darwin*)
|
2021-01-12 08:22:47 +00:00
|
|
|
brew install automake
|
2021-01-08 03:26:32 +00:00
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2020-08-05 17:00:52 +00:00
|
|
|
TARGETS=$@
|
|
|
|
|
|
|
|
PACKAGES=""
|
|
|
|
INSTALL_FIDO_PPA="no"
|
2021-09-23 21:03:18 +00:00
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
2020-08-05 17:00:52 +00:00
|
|
|
|
|
|
|
#echo "Setting up for '$TARGETS'"
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
lsb_release -a
|
|
|
|
|
2021-02-17 07:41:30 +00:00
|
|
|
if [ "${TARGETS}" = "kitchensink" ]; then
|
|
|
|
TARGETS="kerberos5 libedit pam sk selinux"
|
|
|
|
fi
|
|
|
|
|
2020-08-05 17:00:52 +00:00
|
|
|
for TARGET in $TARGETS; do
|
|
|
|
case $TARGET in
|
2021-04-26 07:13:44 +00:00
|
|
|
default|without-openssl|without-zlib|c89)
|
2020-08-05 17:00:52 +00:00
|
|
|
# nothing to do
|
|
|
|
;;
|
2021-09-29 01:36:13 +00:00
|
|
|
clang-*|gcc-*)
|
|
|
|
PACKAGES="$PACKAGES $TARGET"
|
|
|
|
;;
|
2021-02-17 07:41:30 +00:00
|
|
|
kerberos5)
|
2020-08-05 17:00:52 +00:00
|
|
|
PACKAGES="$PACKAGES heimdal-dev"
|
|
|
|
#PACKAGES="$PACKAGES libkrb5-dev"
|
|
|
|
;;
|
2021-02-17 07:41:30 +00:00
|
|
|
libedit)
|
2020-08-05 17:00:52 +00:00
|
|
|
PACKAGES="$PACKAGES libedit-dev"
|
|
|
|
;;
|
2021-02-17 07:41:30 +00:00
|
|
|
*pam)
|
2020-08-05 17:00:52 +00:00
|
|
|
PACKAGES="$PACKAGES libpam0g-dev"
|
|
|
|
;;
|
2021-02-17 07:41:30 +00:00
|
|
|
sk)
|
2020-08-05 17:00:52 +00:00
|
|
|
INSTALL_FIDO_PPA="yes"
|
2021-04-05 13:46:42 +00:00
|
|
|
PACKAGES="$PACKAGES libfido2-dev libu2f-host-dev libcbor-dev"
|
2020-08-05 17:00:52 +00:00
|
|
|
;;
|
2021-02-17 07:41:30 +00:00
|
|
|
selinux)
|
2020-08-05 17:00:52 +00:00
|
|
|
PACKAGES="$PACKAGES libselinux1-dev selinux-policy-dev"
|
|
|
|
;;
|
2021-02-17 07:41:30 +00:00
|
|
|
hardenedmalloc)
|
2021-01-08 13:36:05 +00:00
|
|
|
INSTALL_HARDENED_MALLOC=yes
|
|
|
|
;;
|
2021-04-26 05:34:23 +00:00
|
|
|
openssl-noec)
|
|
|
|
INSTALL_OPENSSL=OpenSSL_1_1_1k
|
|
|
|
SSLCONFOPTS="no-ec"
|
|
|
|
;;
|
2021-04-26 04:02:03 +00:00
|
|
|
openssl-*)
|
|
|
|
INSTALL_OPENSSL=$(echo ${TARGET} | cut -f2 -d-)
|
|
|
|
case ${INSTALL_OPENSSL} in
|
2021-09-08 11:09:49 +00:00
|
|
|
1.1.1_stable) INSTALL_OPENSSL="OpenSSL_1_1_1-stable" ;;
|
2021-04-26 04:02:03 +00:00
|
|
|
1.*) INSTALL_OPENSSL="OpenSSL_$(echo ${INSTALL_OPENSSL} | tr . _)" ;;
|
|
|
|
3.*) INSTALL_OPENSSL="openssl-${INSTALL_OPENSSL}" ;;
|
|
|
|
esac
|
2021-04-26 04:29:03 +00:00
|
|
|
PACKAGES="${PACKAGES} putty-tools"
|
2021-01-28 03:31:01 +00:00
|
|
|
;;
|
2021-04-26 04:02:03 +00:00
|
|
|
libressl-*)
|
|
|
|
INSTALL_LIBRESSL=$(echo ${TARGET} | cut -f2 -d-)
|
|
|
|
case ${INSTALL_LIBRESSL} in
|
|
|
|
master) ;;
|
|
|
|
*) INSTALL_LIBRESSL="v$(echo ${TARGET} | cut -f2 -d-)" ;;
|
|
|
|
esac
|
2021-04-26 04:29:03 +00:00
|
|
|
PACKAGES="${PACKAGES} putty-tools"
|
2021-01-28 03:31:01 +00:00
|
|
|
;;
|
2021-02-21 21:09:27 +00:00
|
|
|
valgrind*)
|
2021-02-18 23:16:56 +00:00
|
|
|
PACKAGES="$PACKAGES valgrind"
|
|
|
|
;;
|
2021-01-08 13:36:05 +00:00
|
|
|
*) echo "Invalid option '${TARGET}'"
|
2020-08-05 17:00:52 +00:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2021-04-23 09:49:46 +00:00
|
|
|
if [ "yes" = "$INSTALL_FIDO_PPA" ]; then
|
2020-08-05 17:00:52 +00:00
|
|
|
sudo apt update -qq
|
2021-09-23 21:03:18 +00:00
|
|
|
sudo apt install -qy software-properties-common
|
|
|
|
sudo apt-add-repository -y ppa:yubico/stable
|
2020-08-05 17:00:52 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "x" != "x$PACKAGES" ]; then
|
|
|
|
sudo apt update -qq
|
|
|
|
sudo apt install -qy $PACKAGES
|
|
|
|
fi
|
2021-01-08 13:36:05 +00:00
|
|
|
|
|
|
|
if [ "${INSTALL_HARDENED_MALLOC}" = "yes" ]; then
|
|
|
|
(cd ${HOME} &&
|
|
|
|
git clone https://github.com/GrapheneOS/hardened_malloc.git &&
|
|
|
|
cd ${HOME}/hardened_malloc &&
|
2021-01-28 09:55:16 +00:00
|
|
|
make -j2 && sudo cp libhardened_malloc.so /usr/lib/)
|
2021-01-08 13:36:05 +00:00
|
|
|
fi
|
2021-01-28 03:31:01 +00:00
|
|
|
|
2021-04-26 04:02:03 +00:00
|
|
|
if [ ! -z "${INSTALL_OPENSSL}" ]; then
|
2021-01-28 03:31:01 +00:00
|
|
|
(cd ${HOME} &&
|
|
|
|
git clone https://github.com/openssl/openssl.git &&
|
|
|
|
cd ${HOME}/openssl &&
|
2021-04-26 23:18:02 +00:00
|
|
|
git checkout ${INSTALL_OPENSSL} &&
|
2021-04-27 02:24:10 +00:00
|
|
|
./config no-threads shared ${SSLCONFOPTS} \
|
2021-04-26 23:18:02 +00:00
|
|
|
--prefix=/opt/openssl &&
|
|
|
|
make && sudo make install_sw)
|
2021-01-28 03:31:01 +00:00
|
|
|
fi
|
|
|
|
|
2021-04-26 04:02:03 +00:00
|
|
|
if [ ! -z "${INSTALL_LIBRESSL}" ]; then
|
2021-01-28 03:31:01 +00:00
|
|
|
(mkdir -p ${HOME}/libressl && cd ${HOME}/libressl &&
|
|
|
|
git clone https://github.com/libressl-portable/portable.git &&
|
2021-04-26 04:02:03 +00:00
|
|
|
cd ${HOME}/libressl/portable &&
|
|
|
|
git checkout ${INSTALL_LIBRESSL} &&
|
|
|
|
sh update.sh && sh autogen.sh &&
|
2021-04-26 23:18:02 +00:00
|
|
|
./configure --prefix=/opt/libressl &&
|
2021-04-26 04:02:03 +00:00
|
|
|
make -j2 && sudo make install)
|
2021-01-28 03:31:01 +00:00
|
|
|
fi
|