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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Fri Apr 23 03:31:46 2010 UTC (9 years, 5 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
old
(Portage version: 2.2_rc67/cvs/Linux x86_64)

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.5_p1.ebuild,v 1.1 2010/04/16 21:20:37 vapier Exp $
4
5 EAPI=2
6 inherit eutils 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}-hpn13v7.diff.gz"
13 #HPN_X509_PATCH="${HPN_PATCH%.diff.gz}-x509variant.diff.gz"
14 #LDAP_PATCH="${PARCH/openssh/openssh-lpk}-0.3.13.patch.gz"
15 X509_VER="6.2.3" X509_PATCH="${PARCH}+x509-${X509_VER}.diff.gz"
16
17 DESCRIPTION="Port of OpenBSD's free SSH release"
18 HOMEPAGE="http://www.openssh.org/"
19 SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
20 ${HPN_PATCH:+hpn? ( http://www.psc.edu/networking/projects/hpn-ssh/${HPN_PATCH} mirror://gentoo/${HPN_PATCH} )}
21 ${LDAP_PATCH:+ldap? ( mirror://gentoo/${LDAP_PATCH} )}
22 ${X509_PATCH:+X509? ( http://roumenpetrov.info/openssh/x509-${X509_VER}/${X509_PATCH} )}
23 ${HPN_X509_PATCH:+hpn? ( X509? ( mirror://gentoo/${HPN_X509_PATCH} ) )}
24 "
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 selinux skey 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 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} ]] && echo ${1} ; }
56 local fail="
57 $(use X509 && maybe_fail X509 X509_PATCH)
58 $(use ldap && maybe_fail ldap LDAP_PATCH)
59 $(use hpn && maybe_fail hpn HPN_PATCH)
60 $(use X509 && use hpn && maybe_fail x509+hpn HPN_X509_PATCH)
61 "
62 fail=$(echo ${fail})
63 if [[ -n ${fail} ]] ; then
64 eerror "Sorry, but this version does not yet support features"
65 eerror "that you requested: ${fail}"
66 eerror "Please mask ${PF} for now and check back later:"
67 eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
68 die "booooo"
69 fi
70 }
71
72 src_prepare() {
73 sed -i \
74 -e '/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:/usr/bin/xauth:' \
75 pathnames.h || die
76 # keep this as we need it to avoid the conflict between LPK and HPN changing
77 # this file.
78 cp version.h version.h.pristine
79
80 if use X509 ; then
81 # Apply X509 patch
82 epatch "${DISTDIR}"/${X509_PATCH}
83 # Apply glue so that HPN will still work after X509
84 #epatch "${FILESDIR}"/${PN}-5.2_p1-x509-hpn-glue.patch
85 fi
86 if ! use X509 ; then
87 if [[ -n ${LDAP_PATCH} ]] && use ldap ; then
88 epatch "${DISTDIR}"/${LDAP_PATCH}
89 epatch "${FILESDIR}"/${PN}-5.2p1-ldap-stdargs.diff #266654
90 # version.h patch conflict avoidence
91 mv version.h version.h.lpk
92 cp -f version.h.pristine version.h
93 fi
94 else
95 use ldap && ewarn "Sorry, X509 and LDAP conflict internally, disabling LDAP"
96 fi
97 epatch "${FILESDIR}"/${PN}-5.4_p1-openssl.patch
98 epatch "${FILESDIR}"/${PN}-4.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
99 if [[ -n ${HPN_PATCH} ]] && use hpn; then
100 if use X509 ; then
101 epatch "${DISTDIR}"/${HPN_X509_PATCH}
102 else
103 epatch "${DISTDIR}"/${HPN_PATCH}
104 fi
105 # version.h patch conflict avoidence
106 mv version.h version.h.hpn
107 cp -f version.h.pristine version.h
108 # The AES-CTR multithreaded variant is temporarily broken, and
109 # causes random hangs when combined with the -f switch of ssh.
110 # To avoid this, we change the internal table to use the non-multithread
111 # version for the meantime.
112 sed -i \
113 -e '/aes...-ctr.*SSH_CIPHER_SSH2/s,evp_aes_ctr_mt,evp_aes_128_ctr,' \
114 cipher.c || die
115 fi
116 epatch "${FILESDIR}"/${PN}-5.2_p1-autoconf.patch
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 # Now we can build a sane merged version.h
124 t="${T}"/version.h
125 m="${t}.merge" f="${t}.final"
126 cat version.h.{hpn,pristine,lpk} 2>/dev/null \
127 | sed '/^#define SSH_RELEASE/d' \
128 | sort | uniq >"${m}"
129 sed -n -r \
130 -e '/^\//p' \
131 <"${m}" >"${f}"
132 sed -n -r \
133 -e '/SSH_LPK/s,"lpk","-lpk",g' \
134 -e '/^#define/p' \
135 <"${m}" >>"${f}"
136 v="SSH_VERSION SSH_PORTABLE"
137 [[ -f version.h.hpn ]] && v="${v} SSH_HPN"
138 [[ -f version.h.lpk ]] && v="${v} SSH_LPK"
139 echo "#define SSH_RELEASE ${v}" >>"${f}"
140 cp "${f}" version.h
141
142 eautoreconf
143 }
144
145 static_use_with() {
146 local flag=$1
147 if use static && use ${flag} ; then
148 ewarn "Disabling '${flag}' support because of USE='static'"
149 # rebuild args so that we invert the first one (USE flag)
150 # but otherwise leave everything else working so we can
151 # just leverage use_with
152 shift
153 [[ -z $1 ]] && flag="${flag} ${flag}"
154 set -- !${flag} "$@"
155 fi
156 use_with "$@"
157 }
158
159 src_configure() {
160 addwrite /dev/ptmx
161 addpredict /etc/skey/skeykeys #skey configure code triggers this
162
163 use static && append-ldflags -static
164
165 econf \
166 --with-ldflags="${LDFLAGS}" \
167 --disable-strip \
168 --sysconfdir=/etc/ssh \
169 --libexecdir=/usr/$(get_libdir)/misc \
170 --datadir=/usr/share/openssh \
171 --with-privsep-path=/var/empty \
172 --with-privsep-user=sshd \
173 --with-md5-passwords \
174 --with-ssl-engine \
175 $(static_use_with pam) \
176 $(static_use_with kerberos kerberos5 /usr) \
177 ${LDAP_PATCH:+$(use X509 || ( use ldap && use_with ldap ))} \
178 $(use_with libedit) \
179 $(use_with selinux) \
180 $(use_with skey) \
181 $(use_with tcpd tcp-wrappers) \
182 || die
183 }
184
185 src_compile() {
186 emake || die
187 }
188
189 src_install() {
190 emake install-nokeys DESTDIR="${D}" || die
191 fperms 600 /etc/ssh/sshd_config
192 dobin contrib/ssh-copy-id
193 newinitd "${FILESDIR}"/sshd.rc6 sshd
194 newconfd "${FILESDIR}"/sshd.confd sshd
195 keepdir /var/empty
196
197 newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
198 if use pam ; then
199 sed -i \
200 -e "/^#UsePAM /s:.*:UsePAM yes:" \
201 -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
202 -e "/^#PrintMotd /s:.*:PrintMotd no:" \
203 -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
204 "${D}"/etc/ssh/sshd_config || die "sed of configuration file failed"
205 fi
206
207 # This instruction is from the HPN webpage,
208 # Used for the server logging functionality
209 if [[ -n ${HPN_PATCH} ]] && use hpn; then
210 keepdir /var/empty/dev
211 fi
212
213 doman contrib/ssh-copy-id.1
214 dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
215
216 diropts -m 0700
217 dodir /etc/skel/.ssh
218 }
219
220 src_test() {
221 local t tests skipped failed passed shell
222 tests="interop-tests compat-tests"
223 skipped=""
224 shell=$(getent passwd ${UID} | cut -d: -f7)
225 if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
226 elog "Running the full OpenSSH testsuite"
227 elog "requires a usable shell for the 'portage'"
228 elog "user, so we will run a subset only."
229 skipped="${skipped} tests"
230 else
231 tests="${tests} tests"
232 fi
233 for t in ${tests} ; do
234 # Some tests read from stdin ...
235 emake -k -j1 ${t} </dev/null \
236 && passed="${passed}${t} " \
237 || failed="${failed}${t} "
238 done
239 einfo "Passed tests: ${passed}"
240 ewarn "Skipped tests: ${skipped}"
241 if [[ -n ${failed} ]] ; then
242 ewarn "Failed tests: ${failed}"
243 die "Some tests failed: ${failed}"
244 else
245 einfo "Failed tests: ${failed}"
246 return 0
247 fi
248 }
249
250 pkg_postinst() {
251 enewgroup sshd 22
252 enewuser sshd 22 -1 /var/empty sshd
253
254 ewarn "Remember to merge your config files in /etc/ssh/ and then"
255 ewarn "reload sshd: '/etc/init.d/sshd reload'."
256 if use pam ; then
257 echo
258 ewarn "Please be aware users need a valid shell in /etc/passwd"
259 ewarn "in order to be allowed to login."
260 fi
261 # This instruction is from the HPN webpage,
262 # Used for the server logging functionality
263 if [[ -n ${HPN_PATCH} ]] && use hpn; then
264 echo
265 einfo "For the HPN server logging patch, you must ensure that"
266 einfo "your syslog application also listens at /var/empty/dev/log."
267 fi
268 }

  ViewVC Help
Powered by ViewVC 1.1.20