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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Mon Jan 24 02:53:08 2011 UTC (8 years, 8 months 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.6_p1-r1.ebuild,v 1.1 2010/08/26 07:32:44 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}-hpn13v9-gentoo.diff.gz"
13 LDAP_PATCH="${PARCH/openssh/openssh-lpk}-0.3.13.patch.gz"
14 X509_VER="6.2.3" 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} 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 # version.h patch conflict avoidence
99 mv version.h version.h.hpn
100 cp -f version.h.pristine version.h
101 # The AES-CTR multithreaded variant is temporarily broken, and
102 # causes random hangs when combined with the -f switch of ssh.
103 # To avoid this, we change the internal table to use the non-multithread
104 # version for the meantime.
105 sed -i \
106 -e '/aes...-ctr.*SSH_CIPHER_SSH2/s,evp_aes_ctr_mt,evp_aes_128_ctr,' \
107 cipher.c || die
108 fi
109 epatch "${FILESDIR}"/${PN}-5.2_p1-autoconf.patch
110
111 sed -i "s:-lcrypto:$(pkg-config --libs openssl):" configure{,.ac} || die
112
113 # Disable PATH reset, trust what portage gives us. bug 254615
114 sed -i -e 's:^PATH=/:#PATH=/:' configure || die
115
116 # Now we can build a sane merged version.h
117 t="${T}"/version.h
118 m="${t}.merge" f="${t}.final"
119 cat version.h.{hpn,pristine,lpk} 2>/dev/null \
120 | sed '/^#define SSH_RELEASE/d' \
121 | sort | uniq >"${m}"
122 sed -n -r \
123 -e '/^\//p' \
124 <"${m}" >"${f}"
125 sed -n -r \
126 -e '/SSH_LPK/s,"lpk","-lpk",g' \
127 -e '/^#define/p' \
128 <"${m}" >>"${f}"
129 v="SSH_VERSION SSH_PORTABLE"
130 [[ -f version.h.hpn ]] && v="${v} SSH_HPN"
131 [[ -f version.h.lpk ]] && v="${v} SSH_LPK"
132 echo "#define SSH_RELEASE ${v}" >>"${f}"
133 cp "${f}" version.h
134
135 eautoreconf
136 }
137
138 static_use_with() {
139 local flag=$1
140 if use static && use ${flag} ; then
141 ewarn "Disabling '${flag}' support because of USE='static'"
142 # rebuild args so that we invert the first one (USE flag)
143 # but otherwise leave everything else working so we can
144 # just leverage use_with
145 shift
146 [[ -z $1 ]] && flag="${flag} ${flag}"
147 set -- !${flag} "$@"
148 fi
149 use_with "$@"
150 }
151
152 src_configure() {
153 addwrite /dev/ptmx
154 addpredict /etc/skey/skeykeys #skey configure code triggers this
155
156 use static && append-ldflags -static
157
158 econf \
159 --with-ldflags="${LDFLAGS}" \
160 --disable-strip \
161 --sysconfdir=/etc/ssh \
162 --libexecdir=/usr/$(get_libdir)/misc \
163 --datadir=/usr/share/openssh \
164 --with-privsep-path=/var/empty \
165 --with-privsep-user=sshd \
166 --with-md5-passwords \
167 --with-ssl-engine \
168 $(static_use_with pam) \
169 $(static_use_with kerberos kerberos5 /usr) \
170 ${LDAP_PATCH:+$(use X509 || ( use ldap && use_with ldap ))} \
171 $(use_with libedit) \
172 $(use_with selinux) \
173 $(use_with skey) \
174 $(use_with tcpd tcp-wrappers)
175 }
176
177 src_compile() {
178 emake || die
179 }
180
181 src_install() {
182 emake install-nokeys DESTDIR="${D}" || die
183 fperms 600 /etc/ssh/sshd_config
184 dobin contrib/ssh-copy-id
185 newinitd "${FILESDIR}"/sshd.rc6 sshd
186 newconfd "${FILESDIR}"/sshd.confd sshd
187 keepdir /var/empty
188
189 newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
190 if use pam ; then
191 sed -i \
192 -e "/^#UsePAM /s:.*:UsePAM yes:" \
193 -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
194 -e "/^#PrintMotd /s:.*:PrintMotd no:" \
195 -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
196 "${D}"/etc/ssh/sshd_config || die "sed of configuration file failed"
197 fi
198
199 # This instruction is from the HPN webpage,
200 # Used for the server logging functionality
201 if [[ -n ${HPN_PATCH} ]] && use hpn; then
202 keepdir /var/empty/dev
203 fi
204
205 doman contrib/ssh-copy-id.1
206 dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
207
208 diropts -m 0700
209 dodir /etc/skel/.ssh
210 }
211
212 src_test() {
213 local t tests skipped failed passed shell
214 tests="interop-tests compat-tests"
215 skipped=""
216 shell=$(getent passwd ${UID} | cut -d: -f7)
217 if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
218 elog "Running the full OpenSSH testsuite"
219 elog "requires a usable shell for the 'portage'"
220 elog "user, so we will run a subset only."
221 skipped="${skipped} tests"
222 else
223 tests="${tests} tests"
224 fi
225 for t in ${tests} ; do
226 # Some tests read from stdin ...
227 emake -k -j1 ${t} </dev/null \
228 && passed="${passed}${t} " \
229 || failed="${failed}${t} "
230 done
231 einfo "Passed tests: ${passed}"
232 ewarn "Skipped tests: ${skipped}"
233 if [[ -n ${failed} ]] ; then
234 ewarn "Failed tests: ${failed}"
235 die "Some tests failed: ${failed}"
236 else
237 einfo "Failed tests: ${failed}"
238 return 0
239 fi
240 }
241
242 pkg_postinst() {
243 enewgroup sshd 22
244 enewuser sshd 22 -1 /var/empty sshd
245
246 ewarn "Remember to merge your config files in /etc/ssh/ and then"
247 ewarn "reload sshd: '/etc/init.d/sshd reload'."
248 if use pam ; then
249 echo
250 ewarn "Please be aware users need a valid shell in /etc/passwd"
251 ewarn "in order to be allowed to login."
252 fi
253 # This instruction is from the HPN webpage,
254 # Used for the server logging functionality
255 if [[ -n ${HPN_PATCH} ]] && use hpn; then
256 echo
257 einfo "For the HPN server logging patch, you must ensure that"
258 einfo "your syslog application also listens at /var/empty/dev/log."
259 fi
260 }

  ViewVC Help
Powered by ViewVC 1.1.20