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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (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.2: +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.3_p1.ebuild,v 1.2 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/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 ~sparc-fbsd ~x86 ~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 EPATCH_OPTS="-p1" epatch "${WORKDIR}"/*pkcs11*/{1,2,4}*
84 use X509 && EPATCH_OPTS="-R" epatch "${WORKDIR}"/*pkcs11*/1000_all_log.patch
85 fi
86 use X509 && epatch "${DISTDIR}"/${X509_PATCH} "${FILESDIR}"/${PN}-5.2_p1-x509-hpn-glue.patch
87 use smartcard && epatch "${FILESDIR}"/openssh-3.9_p1-opensc.patch
88 if ! use X509 ; then
89 if [[ -n ${LDAP_PATCH} ]] && use ldap ; then
90 # The patch for bug 210110 64-bit stuff is now included.
91 epatch "${DISTDIR}"/${LDAP_PATCH}
92 epatch "${FILESDIR}"/${PN}-5.2p1-ldap-stdargs.diff #266654
93 fi
94 #epatch "${DISTDIR}"/openssh-5.2p1-gsskex-all-20090726.patch #115553 #216932 #279488
95 #epatch "${FILESDIR}"/${P}-gsskex-fix.patch
96 else
97 use ldap && ewarn "Sorry, X509 and ldap don't get along, disabling ldap"
98 fi
99 epatch "${FILESDIR}"/${PN}-4.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
100 [[ -n ${HPN_PATCH} ]] && use hpn && epatch "${DISTDIR}"/${HPN_PATCH}
101 epatch "${FILESDIR}"/${PN}-4.7p1-selinux.diff #191665
102 epatch "${FILESDIR}"/${PN}-5.2_p1-autoconf.patch
103
104 # in 5.2p1, the AES-CTR multithreaded variant is temporarily broken, and
105 # causes random hangs when combined with the -f switch of ssh.
106 # To avoid this, we change the internal table to use the non-multithread
107 # version for the meantime.
108 sed -i \
109 -e '/aes...-ctr.*SSH_CIPHER_SSH2/s,evp_aes_ctr_mt,evp_aes_128_ctr,' \
110 cipher.c || die
111
112 sed -i "s:-lcrypto:$(pkg-config --libs openssl):" configure{,.ac} || die
113
114 # Disable PATH reset, trust what portage gives us. bug 254615
115 sed -i -e 's:^PATH=/:#PATH=/:' configure || die
116
117 eautoreconf
118 }
119
120 static_use_with() {
121 local flag=$1
122 if use static && use ${flag} ; then
123 ewarn "Disabling '${flag}' support because of USE='static'"
124 # rebuild args so that we invert the first one (USE flag)
125 # but otherwise leave everything else working so we can
126 # just leverage use_with
127 shift
128 [[ -z $1 ]] && flag="${flag} ${flag}"
129 set -- !${flag} "$@"
130 fi
131 use_with "$@"
132 }
133
134 src_compile() {
135 addwrite /dev/ptmx
136 addpredict /etc/skey/skeykeys #skey configure code triggers this
137
138 local myconf=""
139 use static && append-ldflags -static
140
141 econf \
142 --with-ldflags="${LDFLAGS}" \
143 --disable-strip \
144 --sysconfdir=/etc/ssh \
145 --libexecdir=/usr/$(get_libdir)/misc \
146 --datadir=/usr/share/openssh \
147 --with-privsep-path=/var/empty \
148 --with-privsep-user=sshd \
149 --with-md5-passwords \
150 --with-ssl-engine \
151 $(static_use_with pam) \
152 $(static_use_with kerberos kerberos5 /usr) \
153 ${LDAP_PATCH:+$(use ldap && use_with ldap)} \
154 $(use_with libedit) \
155 ${PKCS11_PATCH:+$(use pkcs11 && static_use_with pkcs11)} \
156 $(use_with selinux) \
157 $(use_with skey) \
158 $(use_with smartcard opensc) \
159 $(use_with tcpd tcp-wrappers) \
160 ${myconf} \
161 || die "bad configure"
162 emake || die "compile problem"
163 }
164
165 src_install() {
166 emake install-nokeys DESTDIR="${D}" || die
167 fperms 600 /etc/ssh/sshd_config
168 dobin contrib/ssh-copy-id
169 newinitd "${FILESDIR}"/sshd.rc6 sshd
170 newconfd "${FILESDIR}"/sshd.confd sshd
171 keepdir /var/empty
172
173 newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
174 if use pam ; then
175 sed -i \
176 -e "/^#UsePAM /s:.*:UsePAM yes:" \
177 -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
178 -e "/^#PrintMotd /s:.*:PrintMotd no:" \
179 -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
180 "${D}"/etc/ssh/sshd_config || die "sed of configuration file failed"
181 fi
182
183 # This instruction is from the HPN webpage,
184 # Used for the server logging functionality
185 if [[ -n ${HPN_PATCH} ]] && use hpn; then
186 keepdir /var/empty/dev
187 fi
188
189 doman contrib/ssh-copy-id.1
190 dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
191
192 diropts -m 0700
193 dodir /etc/skel/.ssh
194 }
195
196 src_test() {
197 local t tests skipped failed passed shell
198 tests="interop-tests compat-tests"
199 skipped=""
200 shell=$(getent passwd ${UID} | cut -d: -f7)
201 if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
202 elog "Running the full OpenSSH testsuite"
203 elog "requires a usable shell for the 'portage'"
204 elog "user, so we will run a subset only."
205 skipped="${skipped} tests"
206 else
207 tests="${tests} tests"
208 fi
209 for t in ${tests} ; do
210 # Some tests read from stdin ...
211 emake -k -j1 ${t} </dev/null \
212 && passed="${passed}${t} " \
213 || failed="${failed}${t} "
214 done
215 einfo "Passed tests: ${passed}"
216 ewarn "Skipped tests: ${skipped}"
217 if [[ -n ${failed} ]] ; then
218 ewarn "Failed tests: ${failed}"
219 die "Some tests failed: ${failed}"
220 else
221 einfo "Failed tests: ${failed}"
222 return 0
223 fi
224 }
225
226 pkg_postinst() {
227 enewgroup sshd 22
228 enewuser sshd 22 -1 /var/empty sshd
229
230 # help fix broken perms caused by older ebuilds.
231 # can probably cut this after the next stage release.
232 chmod u+x "${ROOT}"/etc/skel/.ssh >& /dev/null
233
234 ewarn "Remember to merge your config files in /etc/ssh/ and then"
235 ewarn "reload sshd: '/etc/init.d/sshd reload'."
236 if use pam ; then
237 echo
238 ewarn "Please be aware users need a valid shell in /etc/passwd"
239 ewarn "in order to be allowed to login."
240 fi
241 if use pkcs11 ; then
242 echo
243 einfo "For PKCS#11 you should also emerge one of the askpass softwares"
244 einfo "Example: net-misc/x11-ssh-askpass"
245 fi
246 # This instruction is from the HPN webpage,
247 # Used for the server logging functionality
248 if [[ -n ${HPN_PATCH} ]] && use hpn; then
249 echo
250 einfo "For the HPN server logging patch, you must ensure that"
251 einfo "your syslog application also listens at /var/empty/dev/log."
252 fi
253 }

  ViewVC Help
Powered by ViewVC 1.1.20