xref: /freebsd/crypto/openssh/.github/install_dropbear.sh (revision bb5c77e9d281d6def6835d48249898764bc6a5fe)
1*bb5c77e9SEd Maste#!/bin/sh
2*bb5c77e9SEd Maste#
3*bb5c77e9SEd Maste# Install specified Dropbear version into /usr/local.
4*bb5c77e9SEd Maste#
5*bb5c77e9SEd Maste
6*bb5c77e9SEd Mastever="$1"
7*bb5c77e9SEd Maste
8*bb5c77e9SEd Masteecho
9*bb5c77e9SEd Masteecho ---------------------------------------------
10*bb5c77e9SEd Masteecho Installing dropbear version: ${ver}
11*bb5c77e9SEd Masteecho ---------------------------------------------
12*bb5c77e9SEd Maste
13*bb5c77e9SEd Masteset -e
14*bb5c77e9SEd Maste
15*bb5c77e9SEd Mastecd /tmp
16*bb5c77e9SEd Maste
17*bb5c77e9SEd Masteif [ ! -d dropbear-clean ]; then
18*bb5c77e9SEd Maste	git clone https://github.com/mkj/dropbear.git dropbear-clean
19*bb5c77e9SEd Maste	(cd dropbear-clean && git config --global advice.detachedHead false)
20*bb5c77e9SEd Mastefi
21*bb5c77e9SEd Maste
22*bb5c77e9SEd Masterm -rf dropbear
23*bb5c77e9SEd Mastecp -a dropbear-clean dropbear
24*bb5c77e9SEd Mastecd dropbear
25*bb5c77e9SEd Mastegit checkout "$ver"
26*bb5c77e9SEd Mastegit status
27*bb5c77e9SEd Masteecho "Building Dropbear version '$ver'"
28*bb5c77e9SEd Maste(
29*bb5c77e9SEd Maste	autoreconf 2>&1 &&
30*bb5c77e9SEd Maste	./configure 2>&1 &&
31*bb5c77e9SEd Maste	make clean 2>&1 &&
32*bb5c77e9SEd Maste	make 2>&1 &&
33*bb5c77e9SEd Maste	sudo make install 2>&1) >/tmp/db-build.log 2>&1 || cat /tmp/db-build.log
34*bb5c77e9SEd Maste
35*bb5c77e9SEd Masteecho "Installed dropbear version: '$(/usr/local/bin/dbclient -V 2>&1)'"
36