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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

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

  ViewVC Help
Powered by ViewVC 1.1.20