summaryrefslogtreecommitdiff
blob: 7e38ddf0d7a7d6f2b265a5f095f60c9877e91937 (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
38
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5

inherit vcs-snapshot

COMMIT="c1bd9d82d750bf001d12a9cd41b9b24a3fd84f81"
DESCRIPTION="ssh via a chain of intermediary hosts"
HOMEPAGE="https://github.com/ryancdotorg/ssh-chain"
SRC_URI="${HOMEPAGE}/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
}