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

Contents of /net-misc/openssh/openssh-5.4_p1-r1.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, 7 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.4_p1-r1.ebuild,v 1.1 2010/03/29 05:42:45 vapier Exp $
4
5 inherit eutils flag-o-matic multilib autotools pam
6
7 # Make it more portable between straight releases
8 # and _p? releases.
9 PARCH=${P/_/}
10
11 #HPN_PATCH="${PARCH}-hpn13v7.diff.gz"
12 #LDAP_PATCH="${PARCH/openssh/openssh-lpk}-0.3.11.patch.gz"
13 X509_VER="6.2.3" X509_PATCH="${PARCH}+x509-${X509_VER}.diff.gz"
14
15 DESCRIPTION="Port of OpenBSD's free SSH release"
16 HOMEPAGE="http://www.openssh.org/"
17 SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
18 ${HPN_PATCH:+hpn? ( http://www.psc.edu/networking/projects/hpn-ssh/${HPN_PATCH} )}
19 ${LDAP_PATCH:+ldap? ( mirror://gentoo/${LDAP_PATCH} )}
20 ${X509_PATCH:+X509? ( http://roumenpetrov.info/openssh/x509-${X509_VER}/${X509_PATCH} )}"
21
22 LICENSE="as-is"
23 SLOT="0"
24 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
25 IUSE="hpn kerberos ldap libedit pam selinux skey static tcpd X X509"
26
27 RDEPEND="pam? ( virtual/pam )
28 kerberos? ( virtual/krb5 )
29 selinux? ( >=sys-libs/libselinux-1.28 )
30 skey? ( >=sys-auth/skey-1.1.5-r1 )
31 ldap? ( net-nds/openldap )
32 libedit? ( dev-libs/libedit )
33 >=dev-libs/openssl-0.9.6d
34 >=sys-libs/zlib-1.2.3
35 tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
36 X? ( x11-apps/xauth )
37 userland_GNU? ( sys-apps/shadow )"
38 DEPEND="${RDEPEND}
39 dev-util/pkgconfig
40 virtual/os-headers
41 sys-devel/autoconf"
42 RDEPEND="${RDEPEND}
43 pam? ( >=sys-auth/pambase-20081028 )"
44 PROVIDE="virtual/ssh"
45
46 S=${WORKDIR}/${PARCH}
47
48 pkg_setup() {
49 # this sucks, but i'd rather have people unable to `emerge -u openssh`
50 # than not be able to log in to their server any more
51 maybe_fail() { [[ -z ${!2} ]] && use ${1} && echo ${1} ; }
52 local fail="
53 $(maybe_fail ldap LDAP_PATCH)
54 $(maybe_fail X509 X509_PATCH)
55 "
56 fail=$(echo ${fail})
57 if [[ -n ${fail} ]] ; then
58 eerror "Sorry, but this version does not yet support features"
59 eerror "that you requested: ${fail}"
60 eerror "Please mask ${PF} for now and check back later:"
61 eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
62 die "booooo"
63 fi
64 }
65
66 src_unpack() {
67 unpack ${PARCH}.tar.gz
68 cd "${S}"
69
70 sed -i \
71 -e '/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:/usr/bin/xauth:' \
72 pathnames.h || die
73
74 if use X509 ; then
75 # Apply X509 patch
76 epatch "${DISTDIR}"/${X509_PATCH}
77 # Apply glue so that HPN will still work after X509
78 #epatch "${FILESDIR}"/${PN}-5.2_p1-x509-hpn-glue.patch
79 fi
80 if ! use X509 ; then
81 if [[ -n ${LDAP_PATCH} ]] && use ldap ; then
82 # The patch for bug 210110 64-bit stuff is now included.
83 epatch "${DISTDIR}"/${LDAP_PATCH}
84 epatch "${FILESDIR}"/${PN}-5.2p1-ldap-stdargs.diff #266654
85 fi
86 else
87 use ldap && ewarn "Sorry, X509 and ldap don't get along, disabling ldap"
88 fi
89 epatch "${FILESDIR}"/${P}-openssl.patch
90 epatch "${FILESDIR}"/${P}-pkcs11.patch #310929
91 epatch "${FILESDIR}"/${P}-relative-AuthorizedKeysFile.patch #308939
92 epatch "${FILESDIR}"/${PN}-4.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
93 [[ -n ${HPN_PATCH} ]] && use hpn && epatch "${DISTDIR}"/${HPN_PATCH}
94 epatch "${FILESDIR}"/${PN}-5.2_p1-autoconf.patch
95
96 sed -i "s:-lcrypto:$(pkg-config --libs openssl):" configure{,.ac} || die
97
98 # Disable PATH reset, trust what portage gives us. bug 254615
99 sed -i -e 's:^PATH=/:#PATH=/:' configure || die
100
101 eautoreconf
102 }
103
104 static_use_with() {
105 local flag=$1
106 if use static && use ${flag} ; then
107 ewarn "Disabling '${flag}' support because of USE='static'"
108 # rebuild args so that we invert the first one (USE flag)
109 # but otherwise leave everything else working so we can
110 # just leverage use_with
111 shift
112 [[ -z $1 ]] && flag="${flag} ${flag}"
113 set -- !${flag} "$@"
114 fi
115 use_with "$@"
116 }
117
118 src_compile() {
119 addwrite /dev/ptmx
120 addpredict /etc/skey/skeykeys #skey configure code triggers this
121
122 use static && append-ldflags -static
123
124 econf \
125 --with-ldflags="${LDFLAGS}" \
126 --disable-strip \
127 --sysconfdir=/etc/ssh \
128 --libexecdir=/usr/$(get_libdir)/misc \
129 --datadir=/usr/share/openssh \
130 --with-privsep-path=/var/empty \
131 --with-privsep-user=sshd \
132 --with-md5-passwords \
133 --with-ssl-engine \
134 $(static_use_with pam) \
135 $(static_use_with kerberos kerberos5 /usr) \
136 ${LDAP_PATCH:+$(use X509 || ( use ldap && use_with ldap ))} \
137 $(use_with libedit) \
138 $(use_with selinux) \
139 $(use_with skey) \
140 $(use_with tcpd tcp-wrappers) \
141 || die
142 emake || die
143 }
144
145 src_install() {
146 emake install-nokeys DESTDIR="${D}" || die
147 fperms 600 /etc/ssh/sshd_config
148 dobin contrib/ssh-copy-id
149 newinitd "${FILESDIR}"/sshd.rc6 sshd
150 newconfd "${FILESDIR}"/sshd.confd sshd
151 keepdir /var/empty
152
153 newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
154 if use pam ; then
155 sed -i \
156 -e "/^#UsePAM /s:.*:UsePAM yes:" \
157 -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
158 -e "/^#PrintMotd /s:.*:PrintMotd no:" \
159 -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
160 "${D}"/etc/ssh/sshd_config || die "sed of configuration file failed"
161 fi
162
163 # This instruction is from the HPN webpage,
164 # Used for the server logging functionality
165 if [[ -n ${HPN_PATCH} ]] && use hpn; then
166 keepdir /var/empty/dev
167 fi
168
169 doman contrib/ssh-copy-id.1
170 dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
171
172 diropts -m 0700
173 dodir /etc/skel/.ssh
174 }
175
176 src_test() {
177 local t tests skipped failed passed shell
178 tests="interop-tests compat-tests"
179 skipped=""
180 shell=$(getent passwd ${UID} | cut -d: -f7)
181 if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
182 elog "Running the full OpenSSH testsuite"
183 elog "requires a usable shell for the 'portage'"
184 elog "user, so we will run a subset only."
185 skipped="${skipped} tests"
186 else
187 tests="${tests} tests"
188 fi
189 for t in ${tests} ; do
190 # Some tests read from stdin ...
191 emake -k -j1 ${t} </dev/null \
192 && passed="${passed}${t} " \
193 || failed="${failed}${t} "
194 done
195 einfo "Passed tests: ${passed}"
196 ewarn "Skipped tests: ${skipped}"
197 if [[ -n ${failed} ]] ; then
198 ewarn "Failed tests: ${failed}"
199 die "Some tests failed: ${failed}"
200 else
201 einfo "Failed tests: ${failed}"
202 return 0
203 fi
204 }
205
206 pkg_postinst() {
207 enewgroup sshd 22
208 enewuser sshd 22 -1 /var/empty sshd
209
210 ewarn "Remember to merge your config files in /etc/ssh/ and then"
211 ewarn "reload sshd: '/etc/init.d/sshd reload'."
212 if use pam ; then
213 echo
214 ewarn "Please be aware users need a valid shell in /etc/passwd"
215 ewarn "in order to be allowed to login."
216 fi
217 # This instruction is from the HPN webpage,
218 # Used for the server logging functionality
219 if [[ -n ${HPN_PATCH} ]] && use hpn; then
220 echo
221 einfo "For the HPN server logging patch, you must ensure that"
222 einfo "your syslog application also listens at /var/empty/dev/log."
223 fi
224 }

  ViewVC Help
Powered by ViewVC 1.1.20