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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Mon Aug 23 21:54:37 2010 UTC (9 years, 1 month ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +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.5_p1-r1.ebuild,v 1.1 2010/04/20 04:50:38 robbat2 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 PARCH_54=${PARCH/5.5/5.4}
12
13 HPN_PATCH="${PARCH_54}-hpn13v7.diff.gz"
14 HPN_X509_PATCH="${HPN_PATCH%.diff.gz}-x509variant.diff.gz"
15 LDAP_PATCH="${PARCH_54/openssh/openssh-lpk}-0.3.13.patch.gz"
16 X509_VER="6.2.3" X509_PATCH="${PARCH}+x509-${X509_VER}.diff.gz"
17
18 DESCRIPTION="Port of OpenBSD's free SSH release"
19 HOMEPAGE="http://www.openssh.org/"
20 SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
21 ${HPN_PATCH:+hpn? ( http://www.psc.edu/networking/projects/hpn-ssh/${HPN_PATCH} mirror://gentoo/${HPN_PATCH} )}
22 ${LDAP_PATCH:+ldap? ( mirror://gentoo/${LDAP_PATCH} )}
23 ${X509_PATCH:+X509? ( http://roumenpetrov.info/openssh/x509-${X509_VER}/${X509_PATCH} )}
24 ${HPN_X509_PATCH:+hpn? ( X509? ( mirror://gentoo/${HPN_X509_PATCH} ) )}
25 "
26
27 LICENSE="as-is"
28 SLOT="0"
29 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
30 IUSE="hpn kerberos ldap libedit pam selinux skey 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 tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
41 X? ( x11-apps/xauth )
42 userland_GNU? ( sys-apps/shadow )"
43 DEPEND="${RDEPEND}
44 dev-util/pkgconfig
45 virtual/os-headers
46 sys-devel/autoconf"
47 RDEPEND="${RDEPEND}
48 pam? ( >=sys-auth/pambase-20081028 )"
49 PROVIDE="virtual/ssh"
50
51 S=${WORKDIR}/${PARCH}
52
53 pkg_setup() {
54 # this sucks, but i'd rather have people unable to `emerge -u openssh`
55 # than not be able to log in to their server any more
56 maybe_fail() { [[ -z ${!2} ]] && echo ${1} ; }
57 local fail="
58 $(use X509 && maybe_fail X509 X509_PATCH)
59 $(use ldap && maybe_fail ldap LDAP_PATCH)
60 $(use hpn && maybe_fail hpn HPN_PATCH)
61 $(use X509 && use hpn && maybe_fail x509+hpn HPN_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_prepare() {
74 sed -i \
75 -e '/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:/usr/bin/xauth:' \
76 pathnames.h || die
77 # keep this as we need it to avoid the conflict between LPK and HPN changing
78 # this file.
79 cp version.h version.h.pristine
80
81 if use X509 ; then
82 # Apply X509 patch
83 epatch "${DISTDIR}"/${X509_PATCH}
84 # Apply glue so that HPN will still work after X509
85 #epatch "${FILESDIR}"/${PN}-5.2_p1-x509-hpn-glue.patch
86 fi
87 if ! use X509 ; then
88 if [[ -n ${LDAP_PATCH} ]] && use ldap ; then
89 epatch "${DISTDIR}"/${LDAP_PATCH}
90 epatch "${FILESDIR}"/${PN}-5.2p1-ldap-stdargs.diff #266654
91 # version.h patch conflict avoidence
92 mv version.h version.h.lpk
93 cp -f version.h.pristine version.h
94 fi
95 else
96 use ldap && ewarn "Sorry, X509 and LDAP conflict internally, disabling LDAP"
97 fi
98 epatch "${FILESDIR}"/${PN}-5.4_p1-openssl.patch
99 epatch "${FILESDIR}"/${PN}-4.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
100 if [[ -n ${HPN_PATCH} ]] && use hpn; then
101 if use X509 ; then
102 epatch "${DISTDIR}"/${HPN_X509_PATCH}
103 else
104 epatch "${DISTDIR}"/${HPN_PATCH}
105 fi
106 # version.h patch conflict avoidence
107 mv version.h version.h.hpn
108 cp -f version.h.pristine version.h
109 # The AES-CTR multithreaded variant is temporarily broken, and
110 # causes random hangs when combined with the -f switch of ssh.
111 # To avoid this, we change the internal table to use the non-multithread
112 # version for the meantime.
113 sed -i \
114 -e '/aes...-ctr.*SSH_CIPHER_SSH2/s,evp_aes_ctr_mt,evp_aes_128_ctr,' \
115 cipher.c || die
116 fi
117 epatch "${FILESDIR}"/${PN}-5.2_p1-autoconf.patch
118
119 sed -i "s:-lcrypto:$(pkg-config --libs openssl):" configure{,.ac} || die
120
121 # Disable PATH reset, trust what portage gives us. bug 254615
122 sed -i -e 's:^PATH=/:#PATH=/:' configure || die
123
124 # Now we can build a sane merged version.h
125 t="${T}"/version.h
126 m="${t}.merge" f="${t}.final"
127 cat version.h.{hpn,pristine,lpk} 2>/dev/null \
128 | sed '/^#define SSH_RELEASE/d' \
129 | sort | uniq >"${m}"
130 sed -n -r \
131 -e '/^\//p' \
132 <"${m}" >"${f}"
133 sed -n -r \
134 -e '/SSH_LPK/s,"lpk","-lpk",g' \
135 -e '/^#define/p' \
136 <"${m}" >>"${f}"
137 v="SSH_VERSION SSH_PORTABLE"
138 [[ -f version.h.hpn ]] && v="${v} SSH_HPN"
139 [[ -f version.h.lpk ]] && v="${v} SSH_LPK"
140 echo "#define SSH_RELEASE ${v}" >>"${f}"
141 cp "${f}" version.h
142
143 eautoreconf
144 }
145
146 static_use_with() {
147 local flag=$1
148 if use static && use ${flag} ; then
149 ewarn "Disabling '${flag}' support because of USE='static'"
150 # rebuild args so that we invert the first one (USE flag)
151 # but otherwise leave everything else working so we can
152 # just leverage use_with
153 shift
154 [[ -z $1 ]] && flag="${flag} ${flag}"
155 set -- !${flag} "$@"
156 fi
157 use_with "$@"
158 }
159
160 src_configure() {
161 addwrite /dev/ptmx
162 addpredict /etc/skey/skeykeys #skey configure code triggers this
163
164 use static && append-ldflags -static
165
166 econf \
167 --with-ldflags="${LDFLAGS}" \
168 --disable-strip \
169 --sysconfdir=/etc/ssh \
170 --libexecdir=/usr/$(get_libdir)/misc \
171 --datadir=/usr/share/openssh \
172 --with-privsep-path=/var/empty \
173 --with-privsep-user=sshd \
174 --with-md5-passwords \
175 --with-ssl-engine \
176 $(static_use_with pam) \
177 $(static_use_with kerberos kerberos5 /usr) \
178 ${LDAP_PATCH:+$(use X509 || ( use ldap && use_with ldap ))} \
179 $(use_with libedit) \
180 $(use_with selinux) \
181 $(use_with skey) \
182 $(use_with tcpd tcp-wrappers) \
183 || die
184 }
185
186 src_compile() {
187 emake || die
188 }
189
190 src_install() {
191 emake install-nokeys DESTDIR="${D}" || die
192 fperms 600 /etc/ssh/sshd_config
193 dobin contrib/ssh-copy-id
194 newinitd "${FILESDIR}"/sshd.rc6 sshd
195 newconfd "${FILESDIR}"/sshd.confd sshd
196 keepdir /var/empty
197
198 newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
199 if use pam ; then
200 sed -i \
201 -e "/^#UsePAM /s:.*:UsePAM yes:" \
202 -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
203 -e "/^#PrintMotd /s:.*:PrintMotd no:" \
204 -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
205 "${D}"/etc/ssh/sshd_config || die "sed of configuration file failed"
206 fi
207
208 # This instruction is from the HPN webpage,
209 # Used for the server logging functionality
210 if [[ -n ${HPN_PATCH} ]] && use hpn; then
211 keepdir /var/empty/dev
212 fi
213
214 doman contrib/ssh-copy-id.1
215 dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
216
217 diropts -m 0700
218 dodir /etc/skel/.ssh
219 }
220
221 src_test() {
222 local t tests skipped failed passed shell
223 tests="interop-tests compat-tests"
224 skipped=""
225 shell=$(getent passwd ${UID} | cut -d: -f7)
226 if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
227 elog "Running the full OpenSSH testsuite"
228 elog "requires a usable shell for the 'portage'"
229 elog "user, so we will run a subset only."
230 skipped="${skipped} tests"
231 else
232 tests="${tests} tests"
233 fi
234 for t in ${tests} ; do
235 # Some tests read from stdin ...
236 emake -k -j1 ${t} </dev/null \
237 && passed="${passed}${t} " \
238 || failed="${failed}${t} "
239 done
240 einfo "Passed tests: ${passed}"
241 ewarn "Skipped tests: ${skipped}"
242 if [[ -n ${failed} ]] ; then
243 ewarn "Failed tests: ${failed}"
244 die "Some tests failed: ${failed}"
245 else
246 einfo "Failed tests: ${failed}"
247 return 0
248 fi
249 }
250
251 pkg_postinst() {
252 enewgroup sshd 22
253 enewuser sshd 22 -1 /var/empty sshd
254
255 ewarn "Remember to merge your config files in /etc/ssh/ and then"
256 ewarn "reload sshd: '/etc/init.d/sshd reload'."
257 if use pam ; then
258 echo
259 ewarn "Please be aware users need a valid shell in /etc/passwd"
260 ewarn "in order to be allowed to login."
261 fi
262 # This instruction is from the HPN webpage,
263 # Used for the server logging functionality
264 if [[ -n ${HPN_PATCH} ]] && use hpn; then
265 echo
266 einfo "For the HPN server logging patch, you must ensure that"
267 einfo "your syslog application also listens at /var/empty/dev/log."
268 fi
269 }

  ViewVC Help
Powered by ViewVC 1.1.20