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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (show annotations) (download)
Mon May 11 09:03:29 2009 UTC (10 years, 7 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.14: +1 -1 lines
FILE REMOVED
old
(Portage version: 2.2_rc33/cvs/Linux x86_64)

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-4.7_p1-r20.ebuild,v 1.14 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.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 ldap? ( http://dev.inversepath.com/openssh-lpk/${LDAP_PATCH} )
19 X509? ( http://roumenpetrov.info/openssh/x509-6.1/${X509_PATCH} )
20 hpn? ( http://www.psc.edu/networking/projects/hpn-ssh/${HPN_PATCH} )"
21
22 LICENSE="as-is"
23 SLOT="0"
24 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
25 IUSE="static pam tcpd kerberos skey selinux chroot X509 ldap smartcard hpn libedit X"
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 smartcard? ( dev-libs/opensc )
36 tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
37 X? ( x11-apps/xauth )
38 userland_GNU? ( sys-apps/shadow )"
39 DEPEND="${RDEPEND}
40 dev-util/pkgconfig
41 virtual/os-headers
42 sys-devel/autoconf"
43 RDEPEND="${RDEPEND}
44 pam? ( >=sys-auth/pambase-20080219.1 )"
45 PROVIDE="virtual/ssh"
46
47 S=${WORKDIR}/${PARCH}
48
49 pkg_setup() {
50 # this sucks, but i'd rather have people unable to `emerge -u openssh`
51 # than not be able to log in to their server any more
52 maybe_fail() { [[ -z ${!2} ]] && use ${1} && echo ${1} ; }
53 local fail="
54 $(maybe_fail X509 X509_PATCH)
55 $(maybe_fail ldap LDAP_PATCH)
56 "
57 fail=$(echo ${fail})
58 if [[ -n ${fail} ]] ; then
59 eerror "Sorry, but this version does not yet support features"
60 eerror "that you requested: ${fail}"
61 eerror "Please mask ${PF} for now and check back later:"
62 eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
63 die "booooo"
64 fi
65 }
66
67 src_unpack() {
68 unpack ${PARCH}.tar.gz
69 cd "${S}"
70
71 sed -i \
72 -e '/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:/usr/bin/xauth:' \
73 pathnames.h || die
74
75 use X509 && epatch "${DISTDIR}"/${X509_PATCH} "${FILESDIR}"/${PN}-4.7_p1-x509-hpn-glue.patch
76 use chroot && epatch "${FILESDIR}"/openssh-4.3_p1-chroot.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 fi
82 elif use ldap ; then
83 ewarn "Sorry, X509 and ldap don't get along, disabling ldap"
84 fi
85 [[ -n ${HPN_PATCH} ]] && use hpn && epatch "${DISTDIR}"/${HPN_PATCH}
86 epatch "${FILESDIR}"/${P}-GSSAPI-dns.patch #165444
87
88 sed -i "s:-lcrypto:$(pkg-config --libs openssl):" configure{,.ac} || die
89
90 # fix #191665
91 epatch "${FILESDIR}"/openssh-4.7p1-selinux.diff
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 --disable-suid-ssh \
116 --with-privsep-path=/var/empty \
117 --with-privsep-user=sshd \
118 --with-md5-passwords \
119 --with-ssl-engine \
120 $(use_with ldap) \
121 $(use_with libedit) \
122 $(use_with kerberos kerberos5 /usr) \
123 $(use_with tcpd tcp-wrappers) \
124 $(use_with selinux) \
125 $(use_with skey) \
126 $(use_with smartcard opensc) \
127 ${myconf} \
128 || die "bad configure"
129 emake || die "compile problem"
130 }
131
132 src_install() {
133 emake install-nokeys DESTDIR="${D}" || die
134 fperms 600 /etc/ssh/sshd_config
135 dobin contrib/ssh-copy-id
136 newinitd "${FILESDIR}"/sshd.rc6 sshd
137 newconfd "${FILESDIR}"/sshd.confd sshd
138 keepdir /var/empty
139
140 newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
141 if use pam; then
142 # Whenever enabling the pam USE flag, enable PAM support on
143 # the configuration file. Also disable password authentication
144 # and printing of motd and last login. The latter is done to
145 # leave those tasks up to PAM itself, through pambase.
146 sed -i \
147 -e "/^#UsePAM /s:.*:UsePAM yes:" \
148 -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
149 -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
150 -e "/^#PrintMotd /s:.*:PrintMotd no:" \
151 "${D}"/etc/ssh/sshd_config
152 fi
153
154 doman contrib/ssh-copy-id.1
155 dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
156
157 diropts -m 0700
158 dodir /etc/skel/.ssh
159 }
160
161 pkg_postinst() {
162 enewgroup sshd 22
163 enewuser sshd 22 -1 /var/empty sshd
164
165 # help fix broken perms caused by older ebuilds.
166 # can probably cut this after the next stage release.
167 chmod u+x "${ROOT}"/etc/skel/.ssh >& /dev/null
168
169 ewarn "Remember to merge your config files in /etc/ssh/ and then"
170 ewarn "restart sshd: '/etc/init.d/sshd restart'."
171 if use pam ; then
172 echo
173 ewarn "Please be aware users need a valid shell in /etc/passwd"
174 ewarn "in order to be allowed to login."
175 fi
176 }

  ViewVC Help
Powered by ViewVC 1.1.20