/[gentoo-x86]/net-misc/openssh/openssh-5.2_p1-r3.ebuild
Gentoo

Contents of /net-misc/openssh/openssh-5.2_p1-r3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Mon Jan 24 02:53:08 2011 UTC (8 years, 7 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +1 -1 lines
FILE REMOVED
old

1 # Copyright 1999-2009 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.2_p1-r3.ebuild,v 1.8 2009/10/27 18:31:50 armin76 Exp $
4
5 inherit eutils flag-o-matic multilib autotools pam
6
7 # Make it more portable between straight releases
8 # and _p? releases.
9 PARCH=${P/_/}
10
11 HPN_PATCH="${PARCH}-hpn13v6.diff.gz"
12 LDAP_PATCH="${PARCH/openssh/openssh-lpk}-0.3.11.patch.gz"
13 PKCS11_PATCH="${PARCH/p1}pkcs11-0.26.tar.bz2"
14 X509_VER="6.2.1" 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 # HPN appears twice as sometimes Gentoo has a custom version of it.
19 SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
20 http://www.sxw.org.uk/computing/patches/openssh-5.2p1-gsskex-all-20090726.patch
21 ${HPN_PATCH:+hpn? ( http://www.psc.edu/networking/projects/hpn-ssh/${HPN_PATCH} )}
22 ${LDAP_PATCH:+ldap? ( mirror://gentoo/${LDAP_PATCH} )}
23 ${PKCS11_PATCH:+pkcs11? ( http://alon.barlev.googlepages.com/${PKCS11_PATCH} )}
24 ${X509_PATCH:+X509? ( http://roumenpetrov.info/openssh/x509-${X509_VER}/${X509_PATCH} )}"
25
26 LICENSE="as-is"
27 SLOT="0"
28 KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd"
29 IUSE="hpn kerberos ldap libedit pam pkcs11 selinux skey smartcard static tcpd X X509"
30
31 RDEPEND="pam? ( virtual/pam )
32 kerberos? ( virtual/krb5 )
33 selinux? ( >=sys-libs/libselinux-1.28 )
34 skey? ( >=sys-auth/skey-1.1.5-r1 )
35 ldap? ( net-nds/openldap )
36 libedit? ( dev-libs/libedit )
37 >=dev-libs/openssl-0.9.6d
38 >=sys-libs/zlib-1.2.3
39 smartcard? ( dev-libs/opensc )
40 pkcs11? ( dev-libs/pkcs11-helper )
41 tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
42 X? ( x11-apps/xauth )
43 userland_GNU? ( sys-apps/shadow )"
44 DEPEND="${RDEPEND}
45 dev-util/pkgconfig
46 virtual/os-headers
47 sys-devel/autoconf"
48 RDEPEND="${RDEPEND}
49 pam? ( >=sys-auth/pambase-20081028 )"
50 PROVIDE="virtual/ssh"
51
52 S=${WORKDIR}/${PARCH}
53
54 pkg_setup() {
55 # this sucks, but i'd rather have people unable to `emerge -u openssh`
56 # than not be able to log in to their server any more
57 maybe_fail() { [[ -z ${!2} ]] && use ${1} && echo ${1} ; }
58 local fail="
59 $(maybe_fail ldap LDAP_PATCH)
60 $(maybe_fail pkcs11 PKCS11_PATCH)
61 $(maybe_fail X509 X509_PATCH)
62 "
63 fail=$(echo ${fail})
64 if [[ -n ${fail} ]] ; then
65 eerror "Sorry, but this version does not yet support features"
66 eerror "that you requested: ${fail}"
67 eerror "Please mask ${PF} for now and check back later:"
68 eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
69 die "booooo"
70 fi
71 }
72
73 src_unpack() {
74 unpack ${PARCH}.tar.gz
75 cd "${S}"
76
77 sed -i \
78 -e '/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:/usr/bin/xauth:' \
79 pathnames.h || die
80
81 if use pkcs11 ; then
82 cd "${WORKDIR}"
83 unpack "${PKCS11_PATCH}"
84 cd "${S}"
85 EPATCH_OPTS="-p1" epatch "${WORKDIR}"/*pkcs11*/{1,2,4}*
86 use X509 && EPATCH_OPTS="-R" epatch "${WORKDIR}"/*pkcs11*/1000_all_log.patch
87 fi
88 use X509 && epatch "${DISTDIR}"/${X509_PATCH} "${FILESDIR}"/${P}-x509-hpn-glue.patch
89 use smartcard && epatch "${FILESDIR}"/openssh-3.9_p1-opensc.patch
90 if ! use X509 ; then
91 if [[ -n ${LDAP_PATCH} ]] && use ldap ; then
92 # The patch for bug 210110 64-bit stuff is now included.
93 epatch "${DISTDIR}"/${LDAP_PATCH}
94 epatch "${FILESDIR}"/${PN}-5.2p1-ldap-stdargs.diff #266654
95 fi
96 epatch "${DISTDIR}"/openssh-5.2p1-gsskex-all-20090726.patch #115553 #216932 #279488
97 epatch "${FILESDIR}"/${P}-gsskex-fix.patch
98 else
99 use ldap && ewarn "Sorry, X509 and ldap don't get along, disabling ldap"
100 fi
101 #epatch "${FILESDIR}"/${PN}-4.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
102 [[ -n ${HPN_PATCH} ]] && use hpn && epatch "${DISTDIR}"/${HPN_PATCH}
103 epatch "${FILESDIR}"/${PN}-4.7p1-selinux.diff #191665
104 epatch "${FILESDIR}"/${P}-autoconf.patch
105
106 # in 5.2p1, the AES-CTR multithreaded variant is temporarily broken, and
107 # causes random hangs when combined with the -f switch of ssh.
108 # To avoid this, we change the internal table to use the non-multithread
109 # version for the meantime.
110 sed -i \
111 -e '/aes...-ctr.*SSH_CIPHER_SSH2/s,evp_aes_ctr_mt,evp_aes_128_ctr,' \
112 cipher.c || die
113
114 sed -i "s:-lcrypto:$(pkg-config --libs openssl):" configure{,.ac} || die
115
116 # Disable PATH reset, trust what portage gives us. bug 254615
117 sed -i -e 's:^PATH=/:#PATH=/:' configure || die
118
119 eautoreconf
120 }
121
122 static_use_with() {
123 local flag=$1
124 if use static && use ${flag} ; then
125 ewarn "Disabling '${flag}' support because of USE='static'"
126 # rebuild args so that we invert the first one (USE flag)
127 # but otherwise leave everything else working so we can
128 # just leverage use_with
129 shift
130 [[ -z $1 ]] && flag="${flag} ${flag}"
131 set -- !${flag} "$@"
132 fi
133 use_with "$@"
134 }
135
136 src_compile() {
137 addwrite /dev/ptmx
138 addpredict /etc/skey/skeykeys #skey configure code triggers this
139
140 local myconf=""
141 use static && append-ldflags -static
142
143 econf \
144 --with-ldflags="${LDFLAGS}" \
145 --disable-strip \
146 --sysconfdir=/etc/ssh \
147 --libexecdir=/usr/$(get_libdir)/misc \
148 --datadir=/usr/share/openssh \
149 --with-privsep-path=/var/empty \
150 --with-privsep-user=sshd \
151 --with-md5-passwords \
152 --with-ssl-engine \
153 $(static_use_with pam) \
154 $(static_use_with kerberos kerberos5 /usr) \
155 ${LDAP_PATCH:+$(use ldap && use_with ldap)} \
156 $(use_with libedit) \
157 ${PKCS11_PATCH:+$(use pkcs11 && static_use_with pkcs11)} \
158 $(use_with selinux) \
159 $(use_with skey) \
160 $(use_with smartcard opensc) \
161 $(use_with tcpd tcp-wrappers) \
162 ${myconf} \
163 || die "bad configure"
164 emake || die "compile problem"
165 }
166
167 src_install() {
168 emake install-nokeys DESTDIR="${D}" || die
169 fperms 600 /etc/ssh/sshd_config
170 dobin contrib/ssh-copy-id
171 newinitd "${FILESDIR}"/sshd.rc6 sshd
172 newconfd "${FILESDIR}"/sshd.confd sshd
173 keepdir /var/empty
174
175 newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
176 if use pam ; then
177 sed -i \
178 -e "/^#UsePAM /s:.*:UsePAM yes:" \
179 -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
180 -e "/^#PrintMotd /s:.*:PrintMotd no:" \
181 -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
182 "${D}"/etc/ssh/sshd_config || die "sed of configuration file failed"
183 fi
184
185 # This instruction is from the HPN webpage,
186 # Used for the server logging functionality
187 if [[ -n ${HPN_PATCH} ]] && use hpn; then
188 keepdir /var/empty/dev
189 fi
190
191 doman contrib/ssh-copy-id.1
192 dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
193
194 diropts -m 0700
195 dodir /etc/skel/.ssh
196 }
197
198 src_test() {
199 local t tests skipped failed passed shell
200 tests="interop-tests compat-tests"
201 skipped=""
202 shell=$(getent passwd ${UID} | cut -d: -f7)
203 if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
204 elog "Running the full OpenSSH testsuite"
205 elog "requires a usable shell for the 'portage'"
206 elog "user, so we will run a subset only."
207 skipped="${skipped} tests"
208 else
209 tests="${tests} tests"
210 fi
211 for t in ${tests} ; do
212 # Some tests read from stdin ...
213 emake -k -j1 ${t} </dev/null \
214 && passed="${passed}${t} " \
215 || failed="${failed}${t} "
216 done
217 einfo "Passed tests: ${passed}"
218 ewarn "Skipped tests: ${skipped}"
219 if [[ -n ${failed} ]] ; then
220 ewarn "Failed tests: ${failed}"
221 die "Some tests failed: ${failed}"
222 else
223 einfo "Failed tests: ${failed}"
224 return 0
225 fi
226 }
227
228 pkg_postinst() {
229 enewgroup sshd 22
230 enewuser sshd 22 -1 /var/empty sshd
231
232 # help fix broken perms caused by older ebuilds.
233 # can probably cut this after the next stage release.
234 chmod u+x "${ROOT}"/etc/skel/.ssh >& /dev/null
235
236 ewarn "Remember to merge your config files in /etc/ssh/ and then"
237 ewarn "reload sshd: '/etc/init.d/sshd reload'."
238 if use pam ; then
239 echo
240 ewarn "Please be aware users need a valid shell in /etc/passwd"
241 ewarn "in order to be allowed to login."
242 fi
243 if use pkcs11 ; then
244 echo
245 einfo "For PKCS#11 you should also emerge one of the askpass softwares"
246 einfo "Example: net-misc/x11-ssh-askpass"
247 fi
248 # This instruction is from the HPN webpage,
249 # Used for the server logging functionality
250 if [[ -n ${HPN_PATCH} ]] && use hpn; then
251 echo
252 einfo "For the HPN server logging patch, you must ensure that"
253 einfo "your syslog application also listens at /var/empty/dev/log."
254 fi
255 }

  ViewVC Help
Powered by ViewVC 1.1.20