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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Tue Feb 24 17:02:03 2009 UTC (10 years, 7 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +1 -1 lines
FILE REMOVED
old

1 # Copyright 1999-2009 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.1_p1.ebuild,v 1.5 2009/02/08 17:14:24 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 X509_PATCH="${PARCH}+x509-6.1.1.diff.gz"
12 #LDAP_PATCH="${PARCH/openssh-4.9/openssh-lpk-4.6}-0.3.9.patch"
13 HPN_PATCH="${PARCH}-hpn13v5.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-5.0p1-gsskex-20080404.patch
19 ${LDAP_PATCH:+ldap? ( http://dev.inversepath.com/openssh-lpk/${LDAP_PATCH} )}
20 ${X509_PATCH:+X509? ( http://roumenpetrov.info/openssh/x509-6.1.1/${X509_PATCH} )}
21 ${HPN_PATCH:+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 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? ( >=sys-auth/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 RDEPEND="${RDEPEND}
45 pam? ( sys-auth/pambase )"
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} ]] && use ${1} && echo ${1} ; }
54 local fail="
55 $(maybe_fail X509 X509_PATCH)
56 $(maybe_fail ldap LDAP_PATCH)
57 "
58 fail=$(echo ${fail})
59 if [[ -n ${fail} ]] ; then
60 eerror "Sorry, but this version does not yet support features"
61 eerror "that you requested: ${fail}"
62 eerror "Please mask ${PF} for now and check back later:"
63 eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
64 die "booooo"
65 fi
66 }
67
68 src_unpack() {
69 unpack ${PARCH}.tar.gz
70 cd "${S}"
71
72 sed -i \
73 -e '/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:/usr/bin/xauth:' \
74 pathnames.h || die
75
76 use X509 && epatch "${DISTDIR}"/${X509_PATCH} "${FILESDIR}"/${PN}-5.1_p1-x509-hpn-glue.patch
77 use smartcard && epatch "${FILESDIR}"/openssh-3.9_p1-opensc.patch
78 if ! use X509 ; then
79 if [[ -n ${LDAP_PATCH} ]] && use ldap ; then
80 epatch "${DISTDIR}"/${LDAP_PATCH} "${FILESDIR}"/${PN}-4.4_p1-ldap-hpn-glue.patch
81 epatch "${FILESDIR}"/${P}-lpk-64bit.patch #210110
82 fi
83 #epatch "${DISTDIR}"/openssh-5.0p1-gsskex-20080404.patch #115553 #216932
84 else
85 use ldap && ewarn "Sorry, X509 and ldap don't get along, disabling ldap"
86 fi
87 epatch "${FILESDIR}"/${PN}-4.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
88 [[ -n ${HPN_PATCH} ]] && use hpn && epatch "${DISTDIR}"/${HPN_PATCH}
89 epatch "${FILESDIR}"/${PN}-4.7p1-selinux.diff #191665
90
91 sed -i "s:-lcrypto:$(pkg-config --libs openssl):" configure{,.ac} || die
92
93 eautoreconf
94 }
95
96 src_compile() {
97 addwrite /dev/ptmx
98 addpredict /etc/skey/skeykeys #skey configure code triggers this
99
100 local myconf=""
101 if use static ; then
102 append-ldflags -static
103 use pam && ewarn "Disabling pam support becuse of static flag"
104 myconf="${myconf} --without-pam"
105 else
106 myconf="${myconf} $(use_with pam)"
107 fi
108
109 econf \
110 --with-ldflags="${LDFLAGS}" \
111 --disable-strip \
112 --sysconfdir=/etc/ssh \
113 --libexecdir=/usr/$(get_libdir)/misc \
114 --datadir=/usr/share/openssh \
115 --with-privsep-path=/var/empty \
116 --with-privsep-user=sshd \
117 --with-md5-passwords \
118 --with-ssl-engine \
119 $(use ldap && [ -n "${LDAP_PATCH}" ] && use_with ldap) \
120 $(use_with libedit) \
121 $(use_with kerberos kerberos5 /usr) \
122 $(use_with tcpd tcp-wrappers) \
123 $(use_with selinux) \
124 $(use_with skey) \
125 $(use_with smartcard opensc) \
126 ${myconf} \
127 || die "bad configure"
128 emake || die "compile problem"
129 }
130
131 src_install() {
132 emake install-nokeys DESTDIR="${D}" || die
133 fperms 600 /etc/ssh/sshd_config
134 dobin contrib/ssh-copy-id
135 newinitd "${FILESDIR}"/sshd.rc6 sshd
136 newconfd "${FILESDIR}"/sshd.confd sshd
137 keepdir /var/empty
138
139 newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
140 use pam \
141 && dosed "/^#UsePAM /s:.*:UsePAM yes:" /etc/ssh/sshd_config \
142 && dosed "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" /etc/ssh/sshd_config
143
144 doman contrib/ssh-copy-id.1
145 dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
146
147 diropts -m 0700
148 dodir /etc/skel/.ssh
149 }
150
151 pkg_postinst() {
152 enewgroup sshd 22
153 enewuser sshd 22 -1 /var/empty sshd
154
155 # help fix broken perms caused by older ebuilds.
156 # can probably cut this after the next stage release.
157 chmod u+x "${ROOT}"/etc/skel/.ssh >& /dev/null
158
159 ewarn "Remember to merge your config files in /etc/ssh/ and then"
160 ewarn "restart sshd: '/etc/init.d/sshd restart'."
161 if use pam ; then
162 echo
163 ewarn "Please be aware users need a valid shell in /etc/passwd"
164 ewarn "in order to be allowed to login."
165 fi
166 }

  ViewVC Help
Powered by ViewVC 1.1.20