Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-misc/openssh: ChangeLog openssh-5.7_p1-r1.ebuild
Date: Tue, 25 Jan 2011 06:40:30
Message-Id: 20110125064021.294D120057@flycatcher.gentoo.org
1 vapier 11/01/25 06:40:21
2
3 Modified: ChangeLog
4 Added: openssh-5.7_p1-r1.ebuild
5 Log:
6 Add x509/ldap/hpn support back in. Auto-remove ecdsa support from init.d if openssl lacks support #352645 by William Throwe.
7
8 (Portage version: 2.2.0_alpha19/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.402 net-misc/openssh/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/openssh/ChangeLog?rev=1.402&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/openssh/ChangeLog?rev=1.402&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/openssh/ChangeLog?r1=1.401&r2=1.402
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/net-misc/openssh/ChangeLog,v
20 retrieving revision 1.401
21 retrieving revision 1.402
22 diff -u -r1.401 -r1.402
23 --- ChangeLog 24 Jan 2011 02:55:47 -0000 1.401
24 +++ ChangeLog 25 Jan 2011 06:40:20 -0000 1.402
25 @@ -1,6 +1,13 @@
26 # ChangeLog for net-misc/openssh
27 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/ChangeLog,v 1.401 2011/01/24 02:55:47 vapier Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/ChangeLog,v 1.402 2011/01/25 06:40:20 vapier Exp $
30 +
31 +*openssh-5.7_p1-r1 (25 Jan 2011)
32 +
33 + 25 Jan 2011; Mike Frysinger <vapier@g.o> +openssh-5.7_p1-r1.ebuild,
34 + +files/openssh-5.7_p1-x509-hpn-glue.patch:
35 + Add x509/ldap/hpn support back in. Auto-remove ecdsa support from init.d if
36 + openssl lacks support #352645 by William Throwe.
37
38 *openssh-5.7_p1 (24 Jan 2011)
39
40
41
42
43 1.1 net-misc/openssh/openssh-5.7_p1-r1.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/openssh/openssh-5.7_p1-r1.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/openssh/openssh-5.7_p1-r1.ebuild?rev=1.1&content-type=text/plain
47
48 Index: openssh-5.7_p1-r1.ebuild
49 ===================================================================
50 # Copyright 1999-2011 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/openssh-5.7_p1-r1.ebuild,v 1.1 2011/01/25 06:40:21 vapier Exp $
53
54 EAPI="2"
55 inherit eutils flag-o-matic multilib autotools pam
56
57 # Make it more portable between straight releases
58 # and _p? releases.
59 PARCH=${P/_/}
60
61 HPN_PATCH="${PARCH}-hpn13v10.diff.bz2"
62 LDAP_PATCH="${PARCH/-/-lpk-}-0.3.13.patch.gz"
63 X509_VER="6.2.4" X509_PATCH="${PARCH}+x509-${X509_VER}.diff.gz"
64
65 DESCRIPTION="Port of OpenBSD's free SSH release"
66 HOMEPAGE="http://www.openssh.org/"
67 SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
68 ${HPN_PATCH:+hpn? ( http://www.psc.edu/networking/projects/hpn-ssh/${HPN_PATCH} mirror://gentoo/${HPN_PATCH} )}
69 ${LDAP_PATCH:+ldap? ( mirror://gentoo/${LDAP_PATCH} )}
70 ${X509_PATCH:+X509? ( http://roumenpetrov.info/openssh/x509-${X509_VER}/${X509_PATCH} )}
71 "
72
73 LICENSE="as-is"
74 SLOT="0"
75 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
76 IUSE="hpn kerberos ldap libedit pam selinux skey static tcpd X X509"
77
78 RDEPEND="pam? ( virtual/pam )
79 kerberos? ( virtual/krb5 )
80 selinux? ( >=sys-libs/libselinux-1.28 )
81 skey? ( >=sys-auth/skey-1.1.5-r1 )
82 ldap? ( net-nds/openldap )
83 libedit? ( dev-libs/libedit )
84 >=dev-libs/openssl-0.9.6d
85 >=sys-libs/zlib-1.2.3
86 tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
87 X? ( x11-apps/xauth )
88 userland_GNU? ( sys-apps/shadow )"
89 DEPEND="${RDEPEND}
90 dev-util/pkgconfig
91 virtual/os-headers
92 sys-devel/autoconf"
93 RDEPEND="${RDEPEND}
94 pam? ( >=sys-auth/pambase-20081028 )"
95 PROVIDE="virtual/ssh"
96
97 S=${WORKDIR}/${PARCH}
98
99 pkg_setup() {
100 # this sucks, but i'd rather have people unable to `emerge -u openssh`
101 # than not be able to log in to their server any more
102 maybe_fail() { [[ -z ${!2} ]] && echo ${1} ; }
103 local fail="
104 $(use X509 && maybe_fail X509 X509_PATCH)
105 $(use ldap && maybe_fail ldap LDAP_PATCH)
106 $(use hpn && maybe_fail hpn HPN_PATCH)
107 "
108 fail=$(echo ${fail})
109 if [[ -n ${fail} ]] ; then
110 eerror "Sorry, but this version does not yet support features"
111 eerror "that you requested: ${fail}"
112 eerror "Please mask ${PF} for now and check back later:"
113 eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
114 die "booooo"
115 fi
116 }
117
118 src_prepare() {
119 sed -i \
120 -e '/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:/usr/bin/xauth:' \
121 pathnames.h || die
122 # keep this as we need it to avoid the conflict between LPK and HPN changing
123 # this file.
124 cp version.h version.h.pristine
125
126 if use X509 ; then
127 epatch "${DISTDIR}"/${X509_PATCH}
128 epatch "${FILESDIR}"/${PN}-5.7_p1-x509-hpn-glue.patch
129 fi
130 if ! use X509 ; then
131 if [[ -n ${LDAP_PATCH} ]] && use ldap ; then
132 epatch "${DISTDIR}"/${LDAP_PATCH}
133 epatch "${FILESDIR}"/${PN}-5.2p1-ldap-stdargs.diff #266654
134 # version.h patch conflict avoidence
135 mv version.h version.h.lpk
136 cp -f version.h.pristine version.h
137 fi
138 else
139 use ldap && ewarn "Sorry, X509 and LDAP conflict internally, disabling LDAP"
140 fi
141 epatch "${FILESDIR}"/${PN}-5.4_p1-openssl.patch
142 epatch "${FILESDIR}"/${PN}-4.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
143 if [[ -n ${HPN_PATCH} ]] && use hpn; then
144 epatch "${DISTDIR}"/${HPN_PATCH}
145 epatch "${FILESDIR}"/${PN}-5.6_p1-hpn-progressmeter.patch
146 # version.h patch conflict avoidence
147 mv version.h version.h.hpn
148 cp -f version.h.pristine version.h
149 fi
150 epatch "${FILESDIR}"/${PN}-5.2_p1-autoconf.patch
151
152 sed -i "s:-lcrypto:$(pkg-config --libs openssl):" configure{,.ac} || die
153
154 # Disable PATH reset, trust what portage gives us. bug 254615
155 sed -i -e 's:^PATH=/:#PATH=/:' configure || die
156
157 # Now we can build a sane merged version.h
158 (
159 sed '/^#define SSH_RELEASE/d' version.h.* | sort -u
160 printf '#define SSH_RELEASE SSH_VERSION SSH_PORTABLE %s %s\n' \
161 "$([ -e version.h.hpn ] && echo SSH_HPN)" \
162 "$([ -e version.h.lpk ] && echo SSH_LPK)"
163 ) > version.h
164
165 eautoreconf
166 }
167
168 static_use_with() {
169 local flag=$1
170 if use static && use ${flag} ; then
171 ewarn "Disabling '${flag}' support because of USE='static'"
172 # rebuild args so that we invert the first one (USE flag)
173 # but otherwise leave everything else working so we can
174 # just leverage use_with
175 shift
176 [[ -z $1 ]] && flag="${flag} ${flag}"
177 set -- !${flag} "$@"
178 fi
179 use_with "$@"
180 }
181
182 src_configure() {
183 addwrite /dev/ptmx
184 addpredict /etc/skey/skeykeys #skey configure code triggers this
185
186 use static && append-ldflags -static
187
188 econf \
189 --with-ldflags="${LDFLAGS}" \
190 --disable-strip \
191 --sysconfdir=/etc/ssh \
192 --libexecdir=/usr/$(get_libdir)/misc \
193 --datadir=/usr/share/openssh \
194 --with-privsep-path=/var/empty \
195 --with-privsep-user=sshd \
196 --with-md5-passwords \
197 --with-ssl-engine \
198 $(static_use_with pam) \
199 $(static_use_with kerberos kerberos5 /usr) \
200 ${LDAP_PATCH:+$(use X509 || ( use ldap && use_with ldap ))} \
201 $(use_with libedit) \
202 $(use_with selinux) \
203 $(use_with skey) \
204 $(use_with tcpd tcp-wrappers)
205 }
206
207 src_install() {
208 emake install-nokeys DESTDIR="${D}" || die
209 fperms 600 /etc/ssh/sshd_config
210 dobin contrib/ssh-copy-id || die
211 newinitd "${FILESDIR}"/sshd.rc6.2 sshd
212 newconfd "${FILESDIR}"/sshd.confd sshd
213 keepdir /var/empty
214
215 # not all openssl installs support ecc, or are functional #352645
216 if ! grep -q '#define OPENSSL_HAS_ECC 1' config.h ; then
217 dosed 's:&& gen_key ecdsa::' /etc/init.d/sshd || die
218 fi
219
220 newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
221 if use pam ; then
222 sed -i \
223 -e "/^#UsePAM /s:.*:UsePAM yes:" \
224 -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
225 -e "/^#PrintMotd /s:.*:PrintMotd no:" \
226 -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
227 "${D}"/etc/ssh/sshd_config || die "sed of configuration file failed"
228 fi
229
230 # This instruction is from the HPN webpage,
231 # Used for the server logging functionality
232 if [[ -n ${HPN_PATCH} ]] && use hpn ; then
233 keepdir /var/empty/dev
234 fi
235
236 doman contrib/ssh-copy-id.1
237 dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
238
239 diropts -m 0700
240 dodir /etc/skel/.ssh
241 }
242
243 src_test() {
244 local t tests skipped failed passed shell
245 tests="interop-tests compat-tests"
246 skipped=""
247 shell=$(getent passwd ${UID} | cut -d: -f7)
248 if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
249 elog "Running the full OpenSSH testsuite"
250 elog "requires a usable shell for the 'portage'"
251 elog "user, so we will run a subset only."
252 skipped="${skipped} tests"
253 else
254 tests="${tests} tests"
255 fi
256 for t in ${tests} ; do
257 # Some tests read from stdin ...
258 emake -k -j1 ${t} </dev/null \
259 && passed="${passed}${t} " \
260 || failed="${failed}${t} "
261 done
262 einfo "Passed tests: ${passed}"
263 ewarn "Skipped tests: ${skipped}"
264 if [[ -n ${failed} ]] ; then
265 ewarn "Failed tests: ${failed}"
266 die "Some tests failed: ${failed}"
267 else
268 einfo "Failed tests: ${failed}"
269 return 0
270 fi
271 }
272
273 pkg_postinst() {
274 enewgroup sshd 22
275 enewuser sshd 22 -1 /var/empty sshd
276
277 ewarn "Remember to merge your config files in /etc/ssh/ and then"
278 ewarn "reload sshd: '/etc/init.d/sshd reload'."
279 if use pam ; then
280 echo
281 ewarn "Please be aware users need a valid shell in /etc/passwd"
282 ewarn "in order to be allowed to login."
283 fi
284 # This instruction is from the HPN webpage,
285 # Used for the server logging functionality
286 if [[ -n ${HPN_PATCH} ]] && use hpn ; then
287 echo
288 einfo "For the HPN server logging patch, you must ensure that"
289 einfo "your syslog application also listens at /var/empty/dev/log."
290 fi
291 }