summaryrefslogtreecommitdiff
blob: 45a56747325f45a309119c0b1336c80135bf6700 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=5

inherit vcs-snapshot

COMMIT="c1bd9d82d750bf001d12a9cd41b9b24a3fd84f81"
DESCRIPTION="ssh via a chain of intermediary hosts"
HOMEPAGE="https://github.com/ryancdotorg/ssh-chain"
SRC_URI="https://github.com/ryancdotorg/ssh-chain/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""

DEPEND=""
RDEPEND="dev-lang/perl
	virtual/ssh"

src_install() {
	dobin "${PN}"
	dodoc README
	if [[ -f "${EROOT}"/etc/ssh/ssh_config ]] && ! grep -q "^Host \*^\*" "${EROOT}"/etc/ssh/ssh_config; then
		cp "${EROOT}"/etc/ssh/ssh_config "${T}/ssh_config"
		cat >> "${T}/ssh_config" <<EOF

#for ${PN}
Host *^*
	ProxyCommand ssh-chain %h %p

EOF
		insinto /etc/ssh
		doins "${T}/ssh_config"
	fi
}