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

Contents of /net-misc/openssh/openssh-4.7_p1-r5.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Fri Apr 11 02:20:34 2008 UTC (11 years, 8 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +1 -1 lines
FILE REMOVED
old
(Portage version: 2.2_pre5)

1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/openssh-4.7_p1-r5.ebuild,v 1.9 2008/04/02 15:41:01 vapier Exp $
4
5 inherit eutils flag-o-matic ccc multilib autotools pam
6
7 # Make it more portable between straight releases
8 # and _p? releases.
9 PARCH=${P/_/}
10
11 X509_PATCH="${PARCH}+x509-6.1.diff.gz"
12 LDAP_PATCH="${PARCH/openssh-4.7/openssh-lpk-4.6}-0.3.9.patch"
13 HPN_PATCH="${PARCH}-hpn13v1.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 http://www.sxw.org.uk/computing/patches/openssh-4.7p1-gsskex-20070927.patch
19 ldap? ( http://dev.inversepath.com/openssh-lpk/${LDAP_PATCH} )
20 X509? ( http://roumenpetrov.info/openssh/x509-6.1/${X509_PATCH} )
21 hpn? ( http://www.psc.edu/networking/projects/hpn-ssh/${HPN_PATCH} )"
22
23 LICENSE="as-is"
24 SLOT="0"
25 KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86-fbsd"
26 IUSE="static pam tcpd kerberos skey selinux chroot X509 ldap smartcard hpn libedit X"
27
28 RDEPEND="pam? ( virtual/pam )
29 kerberos? ( virtual/krb5 )
30 selinux? ( >=sys-libs/libselinux-1.28 )
31 skey? ( >=app-admin/skey-1.1.5-r1 )
32 ldap? ( net-nds/openldap )
33 libedit? ( dev-libs/libedit )
34 >=dev-libs/openssl-0.9.6d
35 >=sys-libs/zlib-1.2.3
36 smartcard? ( dev-libs/opensc )
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 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 X509 X509_PATCH)
54 $(maybe_fail ldap LDAP_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 use X509 && epatch "${DISTDIR}"/${X509_PATCH} "${FILESDIR}"/${PN}-4.7_p1-x509-hpn-glue.patch
75 use chroot && epatch "${FILESDIR}"/openssh-4.3_p1-chroot.patch
76 use smartcard && epatch "${FILESDIR}"/openssh-3.9_p1-opensc.patch
77 if ! use X509 ; then
78 if [[ -n ${LDAP_PATCH} ]] && use ldap ; then
79 epatch "${DISTDIR}"/${LDAP_PATCH} "${FILESDIR}"/${PN}-4.4_p1-ldap-hpn-glue.patch
80 epatch "${FILESDIR}"/${P}-lpk-64bit.patch #210110
81 fi
82 epatch "${DISTDIR}"/openssh-4.7p1-gsskex-20070927.patch #115553
83 else
84 use ldap && ewarn "Sorry, X509 and ldap don't get along, disabling ldap"
85 epatch "${FILESDIR}"/${P}-GSSAPI-dns.patch #165444 integrated into gsskex
86 fi
87 [[ -n ${HPN_PATCH} ]] && use hpn && epatch "${DISTDIR}"/${HPN_PATCH}
88 epatch "${FILESDIR}"/${P}-CVE-2008-1483.patch #214985
89 epatch "${FILESDIR}"/${P}-packet-size.patch #212433
90
91 sed -i "s:-lcrypto:$(pkg-config --libs openssl):" configure{,.ac} || die
92
93 # fix #191665
94 epatch "${FILESDIR}"/openssh-4.7p1-selinux.diff
95
96 eautoreconf
97 }
98
99 src_compile() {
100 addwrite /dev/ptmx
101 addpredict /etc/skey/skeykeys #skey configure code triggers this
102
103 local myconf=""
104 if use static ; then
105 append-ldflags -static
106 use pam && ewarn "Disabling pam support becuse of static flag"
107 myconf="${myconf} --without-pam"
108 else
109 myconf="${myconf} $(use_with pam)"
110 fi
111
112 econf \
113 --with-ldflags="${LDFLAGS}" \
114 --disable-strip \
115 --sysconfdir=/etc/ssh \
116 --libexecdir=/usr/$(get_libdir)/misc \
117 --datadir=/usr/share/openssh \
118 --disable-suid-ssh \
119 --with-privsep-path=/var/empty \
120 --with-privsep-user=sshd \
121 --with-md5-passwords \
122 --with-ssl-engine \
123 $(use_with ldap) \
124 $(use_with libedit) \
125 $(use_with kerberos kerberos5 /usr) \
126 $(use_with tcpd tcp-wrappers) \
127 $(use_with selinux) \
128 $(use_with skey) \
129 $(use_with smartcard opensc) \
130 ${myconf} \
131 || die "bad configure"
132 emake || die "compile problem"
133 }
134
135 src_install() {
136 emake install-nokeys DESTDIR="${D}" || die
137 fperms 600 /etc/ssh/sshd_config
138 dobin contrib/ssh-copy-id
139 newinitd "${FILESDIR}"/sshd.rc6 sshd
140 newconfd "${FILESDIR}"/sshd.confd sshd
141 keepdir /var/empty
142
143 newpamd "${FILESDIR}"/sshd.pam_include.1 sshd
144 use pam \
145 && dosed "/^#UsePAM /s:.*:UsePAM yes:" /etc/ssh/sshd_config \
146 && dosed "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" /etc/ssh/sshd_config
147
148 doman contrib/ssh-copy-id.1
149 dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
150
151 diropts -m 0700
152 dodir /etc/skel/.ssh
153 }
154
155 pkg_postinst() {
156 enewgroup sshd 22
157 enewuser sshd 22 -1 /var/empty sshd
158
159 # help fix broken perms caused by older ebuilds.
160 # can probably cut this after the next stage release.
161 chmod u+x "${ROOT}"/etc/skel/.ssh >& /dev/null
162
163 ewarn "Remember to merge your config files in /etc/ssh/ and then"
164 ewarn "restart sshd: '/etc/init.d/sshd restart'."
165 if use pam ; then
166 echo
167 ewarn "Please be aware users need a valid shell in /etc/passwd"
168 ewarn "in order to be allowed to login."
169 fi
170 }

  ViewVC Help
Powered by ViewVC 1.1.20