/[gentoo-x86]/net-misc/openssh/openssh-5.9_p1-r4.ebuild
Gentoo

Contents of /net-misc/openssh/openssh-5.9_p1-r4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.17 - (show annotations) (download)
Sun Mar 23 09:55:55 2014 UTC (5 years, 7 months ago) by ago
Branch: MAIN
CVS Tags: HEAD
Changes since 1.16: +1 -1 lines
FILE REMOVED
Remove old

(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 7194459F)

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/openssh-5.9_p1-r4.ebuild,v 1.16 2013/12/11 09:37:15 radhermit Exp $
4
5 EAPI="2"
6 inherit eutils user flag-o-matic multilib autotools pam systemd
7
8 # Make it more portable between straight releases
9 # and _p? releases.
10 PARCH=${P/_}
11
12 HPN_PATCH="${PARCH}-hpn13v11.diff.gz"
13 LDAP_PATCH="${PARCH/-/-lpk-}-0.3.14.patch.gz"
14 X509_VER="7.0" X509_PATCH="${PARCH}+x509-${X509_VER}.diff.gz"
15
16 DESCRIPTION="Port of OpenBSD's free SSH release"
17 HOMEPAGE="http://www.openssh.org/"
18 SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
19 ${HPN_PATCH:+hpn? ( http://www.psc.edu/networking/projects/hpn-ssh/${HPN_PATCH} mirror://gentoo/${HPN_PATCH} )}
20 ${LDAP_PATCH:+ldap? ( mirror://gentoo/${LDAP_PATCH} )}
21 ${X509_PATCH:+X509? ( http://roumenpetrov.info/openssh/x509-${X509_VER}/${X509_PATCH} )}
22 "
23
24 LICENSE="BSD GPL-2"
25 SLOT="0"
26 KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
27 IUSE="bindist ${HPN_PATCH:++}hpn kerberos ldap libedit pam selinux skey static tcpd X X509"
28
29 RDEPEND="pam? ( virtual/pam )
30 kerberos? ( virtual/krb5 )
31 selinux? ( >=sys-libs/libselinux-1.28 )
32 skey? ( >=sys-auth/skey-1.1.5-r1 )
33 ldap? ( net-nds/openldap )
34 libedit? ( dev-libs/libedit )
35 >=dev-libs/openssl-0.9.6d:0[bindist=]
36 >=sys-libs/zlib-1.2.3
37 tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
38 X? ( x11-apps/xauth )
39 userland_GNU? ( virtual/shadow )"
40 DEPEND="${RDEPEND}
41 virtual/pkgconfig
42 virtual/os-headers
43 sys-devel/autoconf"
44 RDEPEND="${RDEPEND}
45 pam? ( >=sys-auth/pambase-20081028 )"
46
47 S=${WORKDIR}/${PARCH}
48
49 pkg_setup() {
50 # this sucks, but i'd rather have people unable to `emerge -u openssh`
51 # than not be able to log in to their server any more
52 maybe_fail() { [[ -z ${!2} ]] && echo ${1} ; }
53 local fail="
54 $(use X509 && maybe_fail X509 X509_PATCH)
55 $(use ldap && maybe_fail ldap LDAP_PATCH)
56 $(use hpn && maybe_fail hpn HPN_PATCH)
57 "
58 fail=$(echo ${fail})
59 if [[ -n ${fail} ]] ; then
60 eerror "Sorry, but this version does not yet support features"
61 eerror "that you requested: ${fail}"
62 eerror "Please mask ${PF} for now and check back later:"
63 eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
64 die "booooo"
65 fi
66 }
67
68 src_prepare() {
69 sed -i \
70 -e '/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:/usr/bin/xauth:' \
71 pathnames.h || die
72 # keep this as we need it to avoid the conflict between LPK and HPN changing
73 # this file.
74 cp version.h version.h.pristine
75
76 # don't break .ssh/authorized_keys2 for fun
77 sed -i '/^AuthorizedKeysFile/s:^:#:' sshd_config || die
78
79 epatch "${FILESDIR}"/${PN}-5.9_p1-drop-openssl-check.patch
80 epatch "${FILESDIR}"/${PN}-5.9_p1-sshd-gssapi-multihomed.patch #378361
81 if use X509 ; then
82 pushd .. >/dev/null
83 epatch "${FILESDIR}"/${PN}-5.9_p1-x509-glue.patch
84 popd >/dev/null
85 epatch "${WORKDIR}"/${X509_PATCH%.*}
86 epatch "${FILESDIR}"/${PN}-5.8_p1-x509-hpn-glue.patch
87 fi
88 if ! use X509 ; then
89 if [[ -n ${LDAP_PATCH} ]] && use ldap ; then
90 epatch "${WORKDIR}"/${LDAP_PATCH%.*}
91 #epatch "${FILESDIR}"/${PN}-5.2p1-ldap-stdargs.diff #266654 - merged
92 # version.h patch conflict avoidence
93 mv version.h version.h.lpk
94 cp -f version.h.pristine version.h
95 fi
96 else
97 use ldap && ewarn "Sorry, X509 and LDAP conflict internally, disabling LDAP"
98 fi
99 epatch "${FILESDIR}"/${PN}-4.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
100 if [[ -n ${HPN_PATCH} ]] && use hpn; then
101 epatch "${WORKDIR}"/${HPN_PATCH%.*}
102 epatch "${FILESDIR}"/${PN}-5.6_p1-hpn-progressmeter.patch
103 # version.h patch conflict avoidence
104 mv version.h version.h.hpn
105 cp -f version.h.pristine version.h
106 # The AES-CTR multithreaded variant is broken, and causes random hangs
107 # when combined background threading and control sockets. To avoid
108 # this, we change the internal table to use the non-multithread version
109 # for the meantime. Do NOT remove this in new versions. See bug #354113
110 # comment #6 for testcase.
111 # Upstream reference: http://www.psc.edu/networking/projects/hpn-ssh/
112 ## Additionally, the MT-AES-CTR mode cipher replaces the default ST-AES-CTR mode
113 ## cipher. Be aware that if the client process is forked using the -f command line
114 ## option the process will hang as the parent thread gets 'divorced' from the key
115 ## generation threads. This issue will be resolved as soon as possible
116 sed -i \
117 -e '/aes...-ctr.*SSH_CIPHER_SSH2/s,evp_aes_ctr_mt,evp_aes_128_ctr,' \
118 cipher.c || die
119 fi
120
121 sed -i "s:-lcrypto:$(pkg-config --libs openssl):" configure{,.ac} || die
122
123 # Disable PATH reset, trust what portage gives us. bug 254615
124 sed -i -e 's:^PATH=/:#PATH=/:' configure || die
125
126 epatch_user #473004
127
128 # Now we can build a sane merged version.h
129 (
130 sed '/^#define SSH_RELEASE/d' version.h.* | sort -u
131 printf '#define SSH_RELEASE SSH_VERSION SSH_PORTABLE %s %s\n' \
132 "$([ -e version.h.hpn ] && echo SSH_HPN)" \
133 "$([ -e version.h.lpk ] && echo SSH_LPK)"
134 ) > version.h
135
136 eautoreconf
137 }
138
139 static_use_with() {
140 local flag=$1
141 if use static && use ${flag} ; then
142 ewarn "Disabling '${flag}' support because of USE='static'"
143 # rebuild args so that we invert the first one (USE flag)
144 # but otherwise leave everything else working so we can
145 # just leverage use_with
146 shift
147 [[ -z $1 ]] && flag="${flag} ${flag}"
148 set -- !${flag} "$@"
149 fi
150 use_with "$@"
151 }
152
153 src_configure() {
154 addwrite /dev/ptmx
155 addpredict /etc/skey/skeykeys #skey configure code triggers this
156
157 use static && append-ldflags -static
158
159 econf \
160 --with-ldflags="${LDFLAGS}" \
161 --disable-strip \
162 --sysconfdir=/etc/ssh \
163 --libexecdir=/usr/$(get_libdir)/misc \
164 --datadir=/usr/share/openssh \
165 --with-privsep-path=/var/empty \
166 --with-privsep-user=sshd \
167 --with-md5-passwords \
168 --with-ssl-engine \
169 $(static_use_with pam) \
170 $(static_use_with kerberos kerberos5 /usr) \
171 ${LDAP_PATCH:+$(use X509 || ( use ldap && use_with ldap ))} \
172 $(use_with libedit) \
173 $(use_with selinux) \
174 $(use_with skey) \
175 $(use_with tcpd tcp-wrappers)
176 }
177
178 src_install() {
179 emake install-nokeys DESTDIR="${D}" || die
180 fperms 600 /etc/ssh/sshd_config
181 dobin contrib/ssh-copy-id || die
182 newinitd "${FILESDIR}"/sshd.rc6.3 sshd
183 newconfd "${FILESDIR}"/sshd.confd sshd
184 keepdir /var/empty
185
186 # not all openssl installs support ecc, or are functional #352645
187 if ! grep -q '#define OPENSSL_HAS_ECC 1' config.h ; then
188 elog "dev-libs/openssl was built with 'bindist' - disabling ecdsa support"
189 dosed 's:&& gen_key ecdsa::' /etc/init.d/sshd || die
190 fi
191
192 newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
193 if use pam ; then
194 sed -i \
195 -e "/^#UsePAM /s:.*:UsePAM yes:" \
196 -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
197 -e "/^#PrintMotd /s:.*:PrintMotd no:" \
198 -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
199 "${D}"/etc/ssh/sshd_config || die "sed of configuration file failed"
200 fi
201
202 # This instruction is from the HPN webpage,
203 # Used for the server logging functionality
204 if [[ -n ${HPN_PATCH} ]] && use hpn ; then
205 keepdir /var/empty/dev
206 fi
207
208 if ! use X509 && [[ -n ${LDAP_PATCH} ]] && use ldap ; then
209 insinto /etc/openldap/schema/
210 newins openssh-lpk_openldap.schema openssh-lpk.schema
211 fi
212
213 doman contrib/ssh-copy-id.1
214 dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
215
216 diropts -m 0700
217 dodir /etc/skel/.ssh
218
219 systemd_dounit "${FILESDIR}"/sshd.{service,socket} || die
220 systemd_newunit "${FILESDIR}"/sshd_at.service 'sshd@.service' || die
221 }
222
223 src_test() {
224 local t tests skipped failed passed shell
225 tests="interop-tests compat-tests"
226 skipped=""
227 shell=$(egetshell ${UID})
228 if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
229 elog "Running the full OpenSSH testsuite"
230 elog "requires a usable shell for the 'portage'"
231 elog "user, so we will run a subset only."
232 skipped="${skipped} tests"
233 else
234 tests="${tests} tests"
235 fi
236 # It will also attempt to write to the homedir .ssh
237 local sshhome=${T}/homedir
238 mkdir -p "${sshhome}"/.ssh
239 for t in ${tests} ; do
240 # Some tests read from stdin ...
241 HOMEDIR="${sshhome}" \
242 emake -k -j1 ${t} </dev/null \
243 && passed="${passed}${t} " \
244 || failed="${failed}${t} "
245 done
246 einfo "Passed tests: ${passed}"
247 ewarn "Skipped tests: ${skipped}"
248 if [[ -n ${failed} ]] ; then
249 ewarn "Failed tests: ${failed}"
250 die "Some tests failed: ${failed}"
251 else
252 einfo "Failed tests: ${failed}"
253 return 0
254 fi
255 }
256
257 pkg_preinst() {
258 enewgroup sshd 22
259 enewuser sshd 22 -1 /var/empty sshd
260 }
261
262 pkg_postinst() {
263 elog "Starting with openssh-5.8p1, the server will default to a newer key"
264 elog "algorithm (ECDSA). You are encouraged to manually update your stored"
265 elog "keys list as servers update theirs. See ssh-keyscan(1) for more info."
266 echo
267 ewarn "Remember to merge your config files in /etc/ssh/ and then"
268 ewarn "reload sshd: '/etc/init.d/sshd reload'."
269 if use pam ; then
270 echo
271 ewarn "Please be aware users need a valid shell in /etc/passwd"
272 ewarn "in order to be allowed to login."
273 fi
274 # This instruction is from the HPN webpage,
275 # Used for the server logging functionality
276 if [[ -n ${HPN_PATCH} ]] && use hpn ; then
277 echo
278 einfo "For the HPN server logging patch, you must ensure that"
279 einfo "your syslog application also listens at /var/empty/dev/log."
280 fi
281 }

  ViewVC Help
Powered by ViewVC 1.1.20