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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20