/[gentoo-x86]/net-misc/openssh/openssh-6.9_p1-r1.ebuild
Gentoo

Contents of /net-misc/openssh/openssh-6.9_p1-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Wed Jul 1 22:53:26 2015 UTC (4 years, 3 months ago) by chutzpah
Branch: MAIN
CVS Tags: HEAD
Revision bump, add the updated X509 patch, drop 5.9_p1-r0 ebuild.

(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 0xE3F69979BB4B8928DA78E3D17CBF44EF)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/openssh-6.9_p1.ebuild,v 1.1 2015/07/01 20:55:01 polynomial-c Exp $
4
5 EAPI="4"
6 inherit eutils user flag-o-matic multilib autotools pam systemd versionator
7
8 # Make it more portable between straight releases
9 # and _p? releases.
10 PARCH=${P/_}
11
12 HPN_PATCH="${PN}-6.9p1-hpnssh14v5.tar.xz"
13 LDAP_PATCH="${PN}-lpk-6.8p1-0.3.14.patch.xz"
14 X509_VER="8.4" X509_PATCH="${PN}-6.9p1+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 mirror://gentoo/${PN}-6.8_p1-sctp.patch.xz
20 ${HPN_PATCH:+hpn? (
21 mirror://gentoo/${HPN_PATCH}
22 http://dev.gentoo.org/~polynomial-c/${HPN_PATCH}
23 mirror://sourceforge/hpnssh/${HPN_PATCH}
24 )}
25 ${LDAP_PATCH:+ldap? ( mirror://gentoo/${LDAP_PATCH} )}
26 ${X509_PATCH:+X509? ( http://roumenpetrov.info/openssh/x509-${X509_VER}/${X509_PATCH} )}
27 "
28
29 LICENSE="BSD GPL-2"
30 SLOT="0"
31 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~arm-linux ~x86-linux"
32 # Probably want to drop ssl defaulting to on in a future version.
33 IUSE="bindist debug ${HPN_PATCH:++}hpn kerberos kernel_linux ldap ldns libedit pam +pie sctp selinux skey ssh1 +ssl static X X509"
34 REQUIRED_USE="pie? ( !static )
35 ssh1? ( ssl )
36 static? ( !kerberos !pam )
37 X509? ( !ldap ssl )"
38
39 LIB_DEPEND="sctp? ( net-misc/lksctp-tools[static-libs(+)] )
40 selinux? ( >=sys-libs/libselinux-1.28[static-libs(+)] )
41 skey? ( >=sys-auth/skey-1.1.5-r1[static-libs(+)] )
42 libedit? ( dev-libs/libedit[static-libs(+)] )
43 ssl? (
44 >=dev-libs/openssl-0.9.6d:0[bindist=]
45 dev-libs/openssl[static-libs(+)]
46 )
47 >=sys-libs/zlib-1.2.3[static-libs(+)]"
48 RDEPEND="
49 !static? (
50 ${LIB_DEPEND//\[static-libs(+)]}
51 ldns? (
52 !bindist? ( net-libs/ldns[ecdsa,ssl] )
53 bindist? ( net-libs/ldns[-ecdsa,ssl] )
54 )
55 )
56 pam? ( virtual/pam )
57 kerberos? ( virtual/krb5 )
58 ldap? ( net-nds/openldap )"
59 DEPEND="${RDEPEND}
60 static? (
61 ${LIB_DEPEND}
62 ldns? (
63 !bindist? ( net-libs/ldns[ecdsa,ssl,static-libs(+)] )
64 bindist? ( net-libs/ldns[-ecdsa,ssl,static-libs(+)] )
65 )
66 )
67 virtual/pkgconfig
68 virtual/os-headers
69 sys-devel/autoconf"
70 RDEPEND="${RDEPEND}
71 pam? ( >=sys-auth/pambase-20081028 )
72 userland_GNU? ( virtual/shadow )
73 X? ( x11-apps/xauth )"
74
75 S=${WORKDIR}/${PARCH}
76
77 pkg_setup() {
78 # this sucks, but i'd rather have people unable to `emerge -u openssh`
79 # than not be able to log in to their server any more
80 maybe_fail() { [[ -z ${!2} ]] && echo "$1" ; }
81 local fail="
82 $(use X509 && maybe_fail X509 X509_PATCH)
83 $(use ldap && maybe_fail ldap LDAP_PATCH)
84 $(use hpn && maybe_fail hpn HPN_PATCH)
85 "
86 fail=$(echo ${fail})
87 if [[ -n ${fail} ]] ; then
88 eerror "Sorry, but this version does not yet support features"
89 eerror "that you requested: ${fail}"
90 eerror "Please mask ${PF} for now and check back later:"
91 eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
92 die "booooo"
93 fi
94
95 # Make sure people who are using tcp wrappers are notified of its removal. #531156
96 if grep -qs '^ *sshd *:' "${EROOT}"/etc/hosts.{allow,deny} ; then
97 eerror "Sorry, but openssh no longer supports tcp-wrappers, and it seems like"
98 eerror "you're trying to use it. Update your ${EROOT}etc/hosts.{allow,deny} please."
99 die "USE=tcpd no longer works"
100 fi
101 }
102
103 save_version() {
104 # version.h patch conflict avoidence
105 mv version.h version.h.$1
106 cp -f version.h.pristine version.h
107 }
108
109 src_prepare() {
110 sed -i \
111 -e "/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:${EPREFIX}/usr/bin/xauth:" \
112 pathnames.h || die
113 # keep this as we need it to avoid the conflict between LPK and HPN changing
114 # this file.
115 cp version.h version.h.pristine
116
117 # don't break .ssh/authorized_keys2 for fun
118 sed -i '/^AuthorizedKeysFile/s:^:#:' sshd_config || die
119
120 if use X509 ; then
121 pushd .. >/dev/null
122 #epatch "${WORKDIR}"/${PN}-6.8_p1-x509-${X509_VER}-glue.patch
123 epatch "${FILESDIR}"/${PN}-6.8_p1-sctp-x509-glue.patch
124 popd >/dev/null
125 epatch "${WORKDIR}"/${X509_PATCH%.*}
126 epatch "${FILESDIR}"/${PN}-6.3_p1-x509-hpn14v2-glue.patch
127 epatch "${FILESDIR}"/${PN}-6.9_p1-x509-warnings.patch
128 save_version X509
129 fi
130 if use ldap ; then
131 epatch "${WORKDIR}"/${LDAP_PATCH%.*}
132 save_version LPK
133 fi
134 epatch "${FILESDIR}"/${PN}-4.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
135 epatch "${FILESDIR}"/${PN}-6.7_p1-openssl-ignore-status.patch
136 # The X509 patchset fixes this independently.
137 use X509 || epatch "${FILESDIR}"/${PN}-6.8_p1-ssl-engine-configure.patch
138 epatch "${WORKDIR}"/${PN}-6.8_p1-sctp.patch
139 if use hpn ; then
140 EPATCH_FORCE="yes" EPATCH_SUFFIX="patch" \
141 EPATCH_MULTI_MSG="Applying HPN patchset ..." \
142 epatch "${WORKDIR}"/${HPN_PATCH%.*.*}
143 save_version HPN
144 fi
145
146 tc-export PKG_CONFIG
147 local sed_args=(
148 -e "s:-lcrypto:$(${PKG_CONFIG} --libs openssl):"
149 # Disable PATH reset, trust what portage gives us #254615
150 -e 's:^PATH=/:#PATH=/:'
151 # Disable fortify flags ... our gcc does this for us
152 -e 's:-D_FORTIFY_SOURCE=2::'
153 )
154 # The -ftrapv flag ICEs on hppa #505182
155 use hppa && sed_args+=(
156 -e '/CFLAGS/s:-ftrapv:-fdisable-this-test:'
157 -e '/OSSH_CHECK_CFLAG_LINK.*-ftrapv/d'
158 )
159 sed -i "${sed_args[@]}" configure{.ac,} || die
160
161 epatch_user #473004
162
163 # Now we can build a sane merged version.h
164 (
165 sed '/^#define SSH_RELEASE/d' version.h.* | sort -u
166 macros=()
167 for p in HPN LPK X509 ; do [ -e version.h.${p} ] && macros+=( SSH_${p} ) ; done
168 printf '#define SSH_RELEASE SSH_VERSION SSH_PORTABLE %s\n' "${macros}"
169 ) > version.h
170
171 eautoreconf
172 }
173
174 src_configure() {
175 addwrite /dev/ptmx
176 addpredict /etc/skey/skeykeys # skey configure code triggers this
177
178 use debug && append-cppflags -DSANDBOX_SECCOMP_FILTER_DEBUG
179 use static && append-ldflags -static
180
181 local myconf=(
182 --with-ldflags="${LDFLAGS}"
183 --disable-strip
184 --with-pid-dir="${EPREFIX}"$(usex kernel_linux '' '/var')/run
185 --sysconfdir="${EPREFIX}"/etc/ssh
186 --libexecdir="${EPREFIX}"/usr/$(get_libdir)/misc
187 --datadir="${EPREFIX}"/usr/share/openssh
188 --with-privsep-path="${EPREFIX}"/var/empty
189 --with-privsep-user=sshd
190 $(use_with kerberos kerberos5 "${EPREFIX}"/usr)
191 # We apply the ldap patch conditionally, so can't pass --without-ldap
192 # unconditionally else we get unknown flag warnings.
193 $(use ldap && use_with ldap)
194 $(use_with ldns)
195 $(use_with libedit)
196 $(use_with pam)
197 $(use_with pie)
198 $(use_with sctp)
199 $(use_with selinux)
200 $(use_with skey)
201 $(use_with ssh1)
202 # The X509 patch deletes this option entirely.
203 $(use X509 || use_with ssl openssl)
204 $(use_with ssl md5-passwords)
205 $(use_with ssl ssl-engine)
206 )
207
208 # Special settings for Gentoo/FreeBSD 9.0 or later (see bug #391011)
209 if use elibc_FreeBSD && version_is_at_least 9.0 "$(uname -r|sed 's/\(.\..\).*/\1/')" ; then
210 myconf+=( --disable-utmp --disable-wtmp --disable-wtmpx )
211 append-ldflags -lutil
212 fi
213
214 econf "${myconf[@]}"
215 }
216
217 src_install() {
218 emake install-nokeys DESTDIR="${D}"
219 fperms 600 /etc/ssh/sshd_config
220 dobin contrib/ssh-copy-id
221 newinitd "${FILESDIR}"/sshd.rc6.4 sshd
222 newconfd "${FILESDIR}"/sshd.confd sshd
223 keepdir /var/empty
224
225 newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
226 if use pam ; then
227 sed -i \
228 -e "/^#UsePAM /s:.*:UsePAM yes:" \
229 -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
230 -e "/^#PrintMotd /s:.*:PrintMotd no:" \
231 -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
232 "${ED}"/etc/ssh/sshd_config || die
233 fi
234
235 # Gentoo tweaks to default config files
236 cat <<-EOF >> "${ED}"/etc/ssh/sshd_config
237
238 # Allow client to pass locale environment variables #367017
239 AcceptEnv LANG LC_*
240 EOF
241 cat <<-EOF >> "${ED}"/etc/ssh/ssh_config
242
243 # Send locale environment variables #367017
244 SendEnv LANG LC_*
245 EOF
246
247 # This instruction is from the HPN webpage,
248 # Used for the server logging functionality
249 if [[ -n ${HPN_PATCH} ]] && use hpn ; then
250 keepdir /var/empty/dev
251 fi
252
253 if ! use X509 && [[ -n ${LDAP_PATCH} ]] && use ldap ; then
254 insinto /etc/openldap/schema/
255 newins openssh-lpk_openldap.schema openssh-lpk.schema
256 fi
257
258 doman contrib/ssh-copy-id.1
259 dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
260
261 diropts -m 0700
262 dodir /etc/skel/.ssh
263
264 systemd_dounit "${FILESDIR}"/sshd.{service,socket}
265 systemd_newunit "${FILESDIR}"/sshd_at.service 'sshd@.service'
266 }
267
268 src_test() {
269 local t tests skipped failed passed shell
270 tests="interop-tests compat-tests"
271 skipped=""
272 shell=$(egetshell ${UID})
273 if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
274 elog "Running the full OpenSSH testsuite"
275 elog "requires a usable shell for the 'portage'"
276 elog "user, so we will run a subset only."
277 skipped="${skipped} tests"
278 else
279 tests="${tests} tests"
280 fi
281 # It will also attempt to write to the homedir .ssh
282 local sshhome=${T}/homedir
283 mkdir -p "${sshhome}"/.ssh
284 for t in ${tests} ; do
285 # Some tests read from stdin ...
286 HOMEDIR="${sshhome}" \
287 emake -k -j1 ${t} </dev/null \
288 && passed="${passed}${t} " \
289 || failed="${failed}${t} "
290 done
291 einfo "Passed tests: ${passed}"
292 ewarn "Skipped tests: ${skipped}"
293 if [[ -n ${failed} ]] ; then
294 ewarn "Failed tests: ${failed}"
295 die "Some tests failed: ${failed}"
296 else
297 einfo "Failed tests: ${failed}"
298 return 0
299 fi
300 }
301
302 pkg_preinst() {
303 enewgroup sshd 22
304 enewuser sshd 22 -1 /var/empty sshd
305 }
306
307 pkg_postinst() {
308 if has_version "<${CATEGORY}/${PN}-5.8_p1" ; then
309 elog "Starting with openssh-5.8p1, the server will default to a newer key"
310 elog "algorithm (ECDSA). You are encouraged to manually update your stored"
311 elog "keys list as servers update theirs. See ssh-keyscan(1) for more info."
312 fi
313 ewarn "Remember to merge your config files in /etc/ssh/ and then"
314 ewarn "reload sshd: '/etc/init.d/sshd reload'."
315 # This instruction is from the HPN webpage,
316 # Used for the server logging functionality
317 if [[ -n ${HPN_PATCH} ]] && use hpn ; then
318 einfo "For the HPN server logging patch, you must ensure that"
319 einfo "your syslog application also listens at /var/empty/dev/log."
320 fi
321 elog "Note: openssh-6.7 versions no longer support USE=tcpd as upstream has"
322 elog " dropped it. Make sure to update any configs that you might have."
323 }

  ViewVC Help
Powered by ViewVC 1.1.20