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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Tue Jan 25 06:39:24 2011 UTC (8 years, 10 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
old

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

  ViewVC Help
Powered by ViewVC 1.1.20