/[gentoo-x86]/net-misc/openssh/openssh-5.6_p1-r2.ebuild
Gentoo

Contents of /net-misc/openssh/openssh-5.6_p1-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.20 - (show annotations) (download)
Fri Nov 16 17:46:00 2012 UTC (6 years, 11 months ago) by ago
Branch: MAIN
CVS Tags: HEAD
Changes since 1.19: +1 -1 lines
FILE REMOVED
Remove old

(Portage version: 2.1.11.31/cvs/Linux x86_64, unsigned Manifest commit)

1 # Copyright 1999-2012 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.6_p1-r2.ebuild,v 1.19 2012/11/06 02:44:11 floppym Exp $
4
5 EAPI="2"
6 inherit eutils user flag-o-matic multilib autotools pam
7
8 # Make it more portable between straight releases
9 # and _p? releases.
10 PARCH=${P/_/}
11
12 HPN_PATCH="${PARCH}-hpn13v10.diff.gz"
13 LDAP_PATCH="${PARCH/openssh/openssh-lpk}-0.3.13.patch.gz"
14 X509_VER="6.2.3" 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"
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 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 if use X509 ; then
77 # Apply X509 patch
78 epatch "${DISTDIR}"/${X509_PATCH}
79 # Apply glue so that HPN will still work after X509
80 epatch "${FILESDIR}"/${PN}-5.6_p1-x509-hpn-glue.patch
81 fi
82 if ! use X509 ; then
83 if [[ -n ${LDAP_PATCH} ]] && use ldap ; then
84 epatch "${DISTDIR}"/${LDAP_PATCH}
85 epatch "${FILESDIR}"/${PN}-5.2p1-ldap-stdargs.diff #266654
86 # version.h patch conflict avoidence
87 mv version.h version.h.lpk
88 cp -f version.h.pristine version.h
89 fi
90 else
91 use ldap && ewarn "Sorry, X509 and LDAP conflict internally, disabling LDAP"
92 fi
93 epatch "${FILESDIR}"/${PN}-5.4_p1-openssl.patch
94 epatch "${FILESDIR}"/${PN}-4.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
95 if [[ -n ${HPN_PATCH} ]] && use hpn; then
96 epatch "${DISTDIR}"/${HPN_PATCH}
97 epatch "${FILESDIR}"/${P}-hpn-progressmeter.patch
98 # version.h patch conflict avoidence
99 mv version.h version.h.hpn
100 cp -f version.h.pristine version.h
101 # The AES-CTR multithreaded variant is broken, and causes random hangs
102 # when combined background threading and control sockets. To avoid
103 # this, we change the internal table to use the non-multithread version
104 # for the meantime. Do NOT remove this in new versions. See bug #354113
105 # comment #6 for testcase.
106 # Upstream reference: http://www.psc.edu/networking/projects/hpn-ssh/
107 ## Additionally, the MT-AES-CTR mode cipher replaces the default ST-AES-CTR mode
108 ## cipher. Be aware that if the client process is forked using the -f command line
109 ## option the process will hang as the parent thread gets 'divorced' from the key
110 ## generation threads. This issue will be resolved as soon as possible
111 sed -i \
112 -e '/aes...-ctr.*SSH_CIPHER_SSH2/s,evp_aes_ctr_mt,evp_aes_128_ctr,' \
113 cipher.c || die
114 fi
115 epatch "${FILESDIR}"/${PN}-5.2_p1-autoconf.patch
116
117 sed -i "s:-lcrypto:$(pkg-config --libs openssl):" configure{,.ac} || die
118
119 # Disable PATH reset, trust what portage gives us. bug 254615
120 sed -i -e 's:^PATH=/:#PATH=/:' configure || die
121
122 # Now we can build a sane merged version.h
123 t="${T}"/version.h
124 m="${t}.merge" f="${t}.final"
125 cat version.h.{hpn,pristine,lpk} 2>/dev/null \
126 | sed '/^#define SSH_RELEASE/d' \
127 | sort | uniq >"${m}"
128 sed -n -r \
129 -e '/^\//p' \
130 <"${m}" >"${f}"
131 sed -n -r \
132 -e '/SSH_LPK/s,"lpk","-lpk",g' \
133 -e '/^#define/p' \
134 <"${m}" >>"${f}"
135 v="SSH_VERSION SSH_PORTABLE"
136 [[ -f version.h.hpn ]] && v="${v} SSH_HPN"
137 [[ -f version.h.lpk ]] && v="${v} SSH_LPK"
138 echo "#define SSH_RELEASE ${v}" >>"${f}"
139 cp "${f}" version.h
140
141 eautoreconf
142 }
143
144 static_use_with() {
145 local flag=$1
146 if use static && use ${flag} ; then
147 ewarn "Disabling '${flag}' support because of USE='static'"
148 # rebuild args so that we invert the first one (USE flag)
149 # but otherwise leave everything else working so we can
150 # just leverage use_with
151 shift
152 [[ -z $1 ]] && flag="${flag} ${flag}"
153 set -- !${flag} "$@"
154 fi
155 use_with "$@"
156 }
157
158 src_configure() {
159 addwrite /dev/ptmx
160 addpredict /etc/skey/skeykeys #skey configure code triggers this
161
162 use static && append-ldflags -static
163
164 econf \
165 --with-ldflags="${LDFLAGS}" \
166 --disable-strip \
167 --sysconfdir=/etc/ssh \
168 --libexecdir=/usr/$(get_libdir)/misc \
169 --datadir=/usr/share/openssh \
170 --with-privsep-path=/var/empty \
171 --with-privsep-user=sshd \
172 --with-md5-passwords \
173 --with-ssl-engine \
174 $(static_use_with pam) \
175 $(static_use_with kerberos kerberos5 /usr) \
176 ${LDAP_PATCH:+$(use X509 || ( use ldap && use_with ldap ))} \
177 $(use_with libedit) \
178 $(use_with selinux) \
179 $(use_with skey) \
180 $(use_with tcpd tcp-wrappers)
181 }
182
183 src_compile() {
184 emake || die
185 }
186
187 src_install() {
188 emake install-nokeys DESTDIR="${D}" || die
189 fperms 600 /etc/ssh/sshd_config
190 dobin contrib/ssh-copy-id
191 newinitd "${FILESDIR}"/sshd.rc6.1 sshd
192 newconfd "${FILESDIR}"/sshd.confd sshd
193 keepdir /var/empty
194
195 newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
196 if use pam ; then
197 sed -i \
198 -e "/^#UsePAM /s:.*:UsePAM yes:" \
199 -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
200 -e "/^#PrintMotd /s:.*:PrintMotd no:" \
201 -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
202 "${D}"/etc/ssh/sshd_config || die "sed of configuration file failed"
203 fi
204
205 # This instruction is from the HPN webpage,
206 # Used for the server logging functionality
207 if [[ -n ${HPN_PATCH} ]] && use hpn; then
208 keepdir /var/empty/dev
209 fi
210
211 doman contrib/ssh-copy-id.1
212 dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
213
214 diropts -m 0700
215 dodir /etc/skel/.ssh
216 }
217
218 src_test() {
219 local t tests skipped failed passed shell
220 tests="interop-tests compat-tests"
221 skipped=""
222 shell=$(egetshell ${UID})
223 if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
224 elog "Running the full OpenSSH testsuite"
225 elog "requires a usable shell for the 'portage'"
226 elog "user, so we will run a subset only."
227 skipped="${skipped} tests"
228 else
229 tests="${tests} tests"
230 fi
231 for t in ${tests} ; do
232 # Some tests read from stdin ...
233 emake -k -j1 ${t} </dev/null \
234 && passed="${passed}${t} " \
235 || failed="${failed}${t} "
236 done
237 einfo "Passed tests: ${passed}"
238 ewarn "Skipped tests: ${skipped}"
239 if [[ -n ${failed} ]] ; then
240 ewarn "Failed tests: ${failed}"
241 die "Some tests failed: ${failed}"
242 else
243 einfo "Failed tests: ${failed}"
244 return 0
245 fi
246 }
247
248 pkg_postinst() {
249 enewgroup sshd 22
250 enewuser sshd 22 -1 /var/empty sshd
251
252 ewarn "Remember to merge your config files in /etc/ssh/ and then"
253 ewarn "reload sshd: '/etc/init.d/sshd reload'."
254 if use pam ; then
255 echo
256 ewarn "Please be aware users need a valid shell in /etc/passwd"
257 ewarn "in order to be allowed to login."
258 fi
259 # This instruction is from the HPN webpage,
260 # Used for the server logging functionality
261 if [[ -n ${HPN_PATCH} ]] && use hpn; then
262 echo
263 einfo "For the HPN server logging patch, you must ensure that"
264 einfo "your syslog application also listens at /var/empty/dev/log."
265 fi
266 }

  ViewVC Help
Powered by ViewVC 1.1.20