Gentoo Archives: gentoo-commits

From: "Tim Harder (radhermit)" <radhermit@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-misc/openssh: openssh-6.4_p1-r1.ebuild ChangeLog
Date: Sat, 09 Nov 2013 23:04:14
Message-Id: 20131109230409.2E99E2004B@flycatcher.gentoo.org
1 radhermit 13/11/09 23:04:09
2
3 Modified: ChangeLog
4 Added: openssh-6.4_p1-r1.ebuild
5 Log:
6 Update x509 patch.
7
8 (Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key 4AB3E85B4F064CA3)
9
10 Revision Changes Path
11 1.487 net-misc/openssh/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/openssh/ChangeLog?rev=1.487&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/openssh/ChangeLog?rev=1.487&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/openssh/ChangeLog?r1=1.486&r2=1.487
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/net-misc/openssh/ChangeLog,v
20 retrieving revision 1.486
21 retrieving revision 1.487
22 diff -u -r1.486 -r1.487
23 --- ChangeLog 9 Nov 2013 01:26:56 -0000 1.486
24 +++ ChangeLog 9 Nov 2013 23:04:08 -0000 1.487
25 @@ -1,6 +1,12 @@
26 # ChangeLog for net-misc/openssh
27 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/ChangeLog,v 1.486 2013/11/09 01:26:56 robbat2 Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/ChangeLog,v 1.487 2013/11/09 23:04:08 radhermit Exp $
30 +
31 +*openssh-6.4_p1-r1 (09 Nov 2013)
32 +
33 + 09 Nov 2013; Tim Harder <radhermit@g.o> +openssh-6.4_p1-r1.ebuild,
34 + +files/openssh-6.4_p1-x509-glue.patch:
35 + Update x509 patch.
36
37 *openssh-6.4_p1 (09 Nov 2013)
38
39
40
41
42 1.1 net-misc/openssh/openssh-6.4_p1-r1.ebuild
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/openssh/openssh-6.4_p1-r1.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/openssh/openssh-6.4_p1-r1.ebuild?rev=1.1&content-type=text/plain
46
47 Index: openssh-6.4_p1-r1.ebuild
48 ===================================================================
49 # Copyright 1999-2013 Gentoo Foundation
50 # Distributed under the terms of the GNU General Public License v2
51 # $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/openssh-6.4_p1-r1.ebuild,v 1.1 2013/11/09 23:04:08 radhermit Exp $
52
53 EAPI="4"
54 inherit eutils user flag-o-matic multilib autotools pam systemd versionator
55
56 # Make it more portable between straight releases
57 # and _p? releases.
58 PARCH=${P/_}
59
60 HPN_PATCH="${PN}-6.3p1-hpnssh14v2.diff.gz"
61 LDAP_PATCH="${PN}-lpk-6.3p1-0.3.14.patch.gz"
62 X509_VER="7.7" X509_PATCH="${PARCH}+x509-${X509_VER}.diff.gz"
63
64 DESCRIPTION="Port of OpenBSD's free SSH release"
65 HOMEPAGE="http://www.openssh.org/"
66 SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
67 ${HPN_PATCH:+hpn? ( mirror://gentoo/${HPN_PATCH} )}
68 ${LDAP_PATCH:+ldap? ( mirror://gentoo/${LDAP_PATCH} )}
69 ${X509_PATCH:+X509? ( http://roumenpetrov.info/openssh/x509-${X509_VER}/${X509_PATCH} )}
70 "
71
72 LICENSE="BSD GPL-2"
73 SLOT="0"
74 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~arm-linux ~x86-linux"
75 IUSE="bindist ${HPN_PATCH:++}hpn kerberos ldap ldns libedit pam selinux skey static tcpd X X509"
76
77 LIB_DEPEND="selinux? ( >=sys-libs/libselinux-1.28[static-libs(+)] )
78 skey? ( >=sys-auth/skey-1.1.5-r1[static-libs(+)] )
79 libedit? ( dev-libs/libedit[static-libs(+)] )
80 >=dev-libs/openssl-0.9.6d:0[bindist=]
81 dev-libs/openssl[static-libs(+)]
82 >=sys-libs/zlib-1.2.3[static-libs(+)]
83 tcpd? ( >=sys-apps/tcp-wrappers-7.6[static-libs(+)] )"
84 RDEPEND="
85 !static? (
86 ${LIB_DEPEND//\[static-libs(+)]}
87 ldns? (
88 !bindist? ( net-libs/ldns[ecdsa,ssl] )
89 bindist? ( net-libs/ldns[-ecdsa,ssl] )
90 )
91 )
92 pam? ( virtual/pam )
93 kerberos? ( virtual/krb5 )
94 ldap? ( net-nds/openldap )"
95 DEPEND="${RDEPEND}
96 static? (
97 ${LIB_DEPEND}
98 ldns? (
99 !bindist? ( net-libs/ldns[ecdsa,ssl,static-libs(+)] )
100 bindist? ( net-libs/ldns[-ecdsa,ssl,static-libs(+)] )
101 )
102 )
103 virtual/pkgconfig
104 virtual/os-headers
105 sys-devel/autoconf"
106 RDEPEND="${RDEPEND}
107 pam? ( >=sys-auth/pambase-20081028 )
108 userland_GNU? ( virtual/shadow )
109 X? ( x11-apps/xauth )"
110
111 S=${WORKDIR}/${PARCH}
112
113 pkg_setup() {
114 # this sucks, but i'd rather have people unable to `emerge -u openssh`
115 # than not be able to log in to their server any more
116 maybe_fail() { [[ -z ${!2} ]] && echo "$1" ; }
117 local fail="
118 $(use X509 && maybe_fail X509 X509_PATCH)
119 $(use ldap && maybe_fail ldap LDAP_PATCH)
120 $(use hpn && maybe_fail hpn HPN_PATCH)
121 "
122 fail=$(echo ${fail})
123 if [[ -n ${fail} ]] ; then
124 eerror "Sorry, but this version does not yet support features"
125 eerror "that you requested: ${fail}"
126 eerror "Please mask ${PF} for now and check back later:"
127 eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
128 die "booooo"
129 fi
130 }
131
132 save_version() {
133 # version.h patch conflict avoidence
134 mv version.h version.h.$1
135 cp -f version.h.pristine version.h
136 }
137
138 src_prepare() {
139 sed -i \
140 -e "/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:${EPREFIX}/usr/bin/xauth:" \
141 pathnames.h || die
142 # keep this as we need it to avoid the conflict between LPK and HPN changing
143 # this file.
144 cp version.h version.h.pristine
145
146 # don't break .ssh/authorized_keys2 for fun
147 sed -i '/^AuthorizedKeysFile/s:^:#:' sshd_config || die
148
149 epatch "${FILESDIR}"/${PN}-5.9_p1-sshd-gssapi-multihomed.patch #378361
150 if use X509 ; then
151 pushd .. >/dev/null
152 epatch "${FILESDIR}"/${PN}-6.4_p1-x509-glue.patch
153 popd >/dev/null
154 epatch "${WORKDIR}"/${X509_PATCH%.*}
155 epatch "${FILESDIR}"/${PN}-6.3_p1-x509-hpn14v2-glue.patch
156 save_version X509
157 fi
158 if ! use X509 ; then
159 if [[ -n ${LDAP_PATCH} ]] && use ldap ; then
160 epatch "${WORKDIR}"/${LDAP_PATCH%.*}
161 save_version LPK
162 fi
163 else
164 use ldap && ewarn "Sorry, X509 and LDAP conflict internally, disabling LDAP"
165 fi
166 epatch "${FILESDIR}"/${PN}-4.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
167 if [[ -n ${HPN_PATCH} ]] && use hpn; then
168 epatch "${WORKDIR}"/${HPN_PATCH%.*}
169 save_version HPN
170 fi
171
172 tc-export PKG_CONFIG
173 local sed_args=(
174 -e "s:-lcrypto:$(${PKG_CONFIG} --libs openssl):"
175 # Disable PATH reset, trust what portage gives us #254615
176 -e 's:^PATH=/:#PATH=/:'
177 # Disable fortify flags ... our gcc does this for us
178 -e 's:-D_FORTIFY_SOURCE=2::'
179 )
180 sed -i "${sed_args[@]}" configure{,.ac} || die
181
182 epatch_user #473004
183
184 # Now we can build a sane merged version.h
185 (
186 sed '/^#define SSH_RELEASE/d' version.h.* | sort -u
187 macros=()
188 for p in HPN LPK X509 ; do [ -e version.h.${p} ] && macros+=( SSH_${p} ) ; done
189 printf '#define SSH_RELEASE SSH_VERSION SSH_PORTABLE %s\n' "${macros}"
190 ) > version.h
191
192 eautoreconf
193 }
194
195 static_use_with() {
196 local flag=$1
197 if use static && use ${flag} ; then
198 ewarn "Disabling '${flag}' support because of USE='static'"
199 # rebuild args so that we invert the first one (USE flag)
200 # but otherwise leave everything else working so we can
201 # just leverage use_with
202 shift
203 [[ -z $1 ]] && flag="${flag} ${flag}"
204 set -- !${flag} "$@"
205 fi
206 use_with "$@"
207 }
208
209 src_configure() {
210 local myconf
211 addwrite /dev/ptmx
212 addpredict /etc/skey/skeykeys #skey configure code triggers this
213
214 use static && append-ldflags -static
215
216 # Special settings for Gentoo/FreeBSD 9.0 or later (see bug #391011)
217 if use elibc_FreeBSD && version_is_at_least 9.0 "$(uname -r|sed 's/\(.\..\).*/\1/')" ; then
218 myconf="${myconf} --disable-utmp --disable-wtmp --disable-wtmpx"
219 append-ldflags -lutil
220 fi
221
222 econf \
223 --with-ldflags="${LDFLAGS}" \
224 --disable-strip \
225 --with-pid-dir="${EPREFIX}"/var/run \
226 --sysconfdir="${EPREFIX}"/etc/ssh \
227 --libexecdir="${EPREFIX}"/usr/$(get_libdir)/misc \
228 --datadir="${EPREFIX}"/usr/share/openssh \
229 --with-privsep-path="${EPREFIX}"/var/empty \
230 --with-privsep-user=sshd \
231 --with-md5-passwords \
232 --with-ssl-engine \
233 $(static_use_with pam) \
234 $(static_use_with kerberos kerberos5 /usr) \
235 ${LDAP_PATCH:+$(use X509 || ( use ldap && use_with ldap ))} \
236 $(use_with ldns) \
237 $(use_with libedit) \
238 $(use_with selinux) \
239 $(use_with skey) \
240 $(use_with tcpd tcp-wrappers) \
241 ${myconf}
242 }
243
244 src_install() {
245 emake install-nokeys DESTDIR="${D}"
246 fperms 600 /etc/ssh/sshd_config
247 dobin contrib/ssh-copy-id
248 newinitd "${FILESDIR}"/sshd.rc6.4 sshd
249 newconfd "${FILESDIR}"/sshd.confd sshd
250 keepdir /var/empty
251
252 # not all openssl installs support ecc, or are functional #352645
253 if ! grep -q '#define OPENSSL_HAS_ECC 1' config.h ; then
254 elog "dev-libs/openssl was built with 'bindist' - disabling ecdsa support"
255 sed -i 's:&& gen_key ecdsa::' "${ED}"/etc/init.d/sshd || die
256 fi
257
258 newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
259 if use pam ; then
260 sed -i \
261 -e "/^#UsePAM /s:.*:UsePAM yes:" \
262 -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
263 -e "/^#PrintMotd /s:.*:PrintMotd no:" \
264 -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
265 "${ED}"/etc/ssh/sshd_config || die "sed of configuration file failed"
266 fi
267
268 # Gentoo tweaks to default config files
269 cat <<-EOF >> "${ED}"/etc/ssh/sshd_config
270
271 # Allow client to pass locale environment variables #367017
272 AcceptEnv LANG LC_*
273 EOF
274 cat <<-EOF >> "${ED}"/etc/ssh/ssh_config
275
276 # Send locale environment variables #367017
277 SendEnv LANG LC_*
278 EOF
279
280 # This instruction is from the HPN webpage,
281 # Used for the server logging functionality
282 if [[ -n ${HPN_PATCH} ]] && use hpn ; then
283 keepdir /var/empty/dev
284 fi
285
286 if use ldap ; then
287 insinto /etc/openldap/schema/
288 newins openssh-lpk_openldap.schema openssh-lpk.schema
289 fi
290
291 doman contrib/ssh-copy-id.1
292 dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
293
294 diropts -m 0700
295 dodir /etc/skel/.ssh
296
297 systemd_dounit "${FILESDIR}"/sshd.{service,socket}
298 systemd_newunit "${FILESDIR}"/sshd_at.service 'sshd@.service'
299 }
300
301 src_test() {
302 local t tests skipped failed passed shell
303 tests="interop-tests compat-tests"
304 skipped=""
305 shell=$(egetshell ${UID})
306 if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
307 elog "Running the full OpenSSH testsuite"
308 elog "requires a usable shell for the 'portage'"
309 elog "user, so we will run a subset only."
310 skipped="${skipped} tests"
311 else
312 tests="${tests} tests"
313 fi
314 # It will also attempt to write to the homedir .ssh
315 local sshhome=${T}/homedir
316 mkdir -p "${sshhome}"/.ssh
317 for t in ${tests} ; do
318 # Some tests read from stdin ...
319 HOMEDIR="${sshhome}" \
320 emake -k -j1 ${t} </dev/null \
321 && passed="${passed}${t} " \
322 || failed="${failed}${t} "
323 done
324 einfo "Passed tests: ${passed}"
325 ewarn "Skipped tests: ${skipped}"
326 if [[ -n ${failed} ]] ; then
327 ewarn "Failed tests: ${failed}"
328 die "Some tests failed: ${failed}"
329 else
330 einfo "Failed tests: ${failed}"
331 return 0
332 fi
333 }
334
335 pkg_preinst() {
336 enewgroup sshd 22
337 enewuser sshd 22 -1 /var/empty sshd
338 }
339
340 pkg_postinst() {
341 if has_version "<${CATEGORY}/${PN}-5.8_p1" ; then
342 elog "Starting with openssh-5.8p1, the server will default to a newer key"
343 elog "algorithm (ECDSA). You are encouraged to manually update your stored"
344 elog "keys list as servers update theirs. See ssh-keyscan(1) for more info."
345 fi
346 ewarn "Remember to merge your config files in /etc/ssh/ and then"
347 ewarn "reload sshd: '/etc/init.d/sshd reload'."
348 # This instruction is from the HPN webpage,
349 # Used for the server logging functionality
350 if [[ -n ${HPN_PATCH} ]] && use hpn ; then
351 echo
352 einfo "For the HPN server logging patch, you must ensure that"
353 einfo "your syslog application also listens at /var/empty/dev/log."
354 fi
355 }