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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Thu Aug 26 07:31:55 2010 UTC (9 years, 1 month ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +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.ebuild,v 1.2 2010/08/25 21:50:42 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.4}
12
13 HPN_PATCH="${PARCH}-hpn13v9-gentoo.diff.gz"
14 #HPN_X509_PATCH="${PARCH_54}-hpn13v7-x509variant.diff.gz"
15 LDAP_PATCH="${PARCH/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 }
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