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

Contents of /net-misc/openssh/openssh-4.6_p1-r4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Mon May 11 09:03:29 2009 UTC (10 years, 5 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +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.6_p1-r4.ebuild,v 1.4 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-5.5.2.diff.gz"
12 LDAP_PATCH="${PARCH/openssh-/openssh-lpk-}-0.3.9.patch"
13 HPN_PATCH="${PARCH}-hpn12v17.diff.gz"
14
15 DESCRIPTION="Port of OpenBSD's free SSH release"
16 HOMEPAGE="http://www.openssh.com/"
17 SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
18 X509? ( http://roumenpetrov.info/openssh/x509-5.5.2/${X509_PATCH} )
19 hpn? ( http://www.psc.edu/networking/projects/hpn-ssh/${HPN_PATCH} )
20 ldap? ( http://dev.inversepath.com/openssh-lpk/${LDAP_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="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 PROVIDE="virtual/ssh"
44
45 S=${WORKDIR}/${PARCH}
46
47 pkg_setup() {
48 # this sucks, but i'd rather have people unable to `emerge -u openssh`
49 # than not be able to log in to their server any more
50 maybe_fail() { [[ -z ${!2} ]] && use ${1} && echo ${1} ; }
51 local fail="
52 $(maybe_fail X509 X509_PATCH)
53 $(maybe_fail ldap LDAP_PATCH)
54 "
55 fail=$(echo ${fail})
56 if [[ -n ${fail} ]] ; then
57 eerror "Sorry, but this version does not yet support features"
58 eerror "that you requested: ${fail}"
59 eerror "Please mask ${PF} for now and check back later:"
60 eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
61 die "booooo"
62 fi
63 }
64
65 src_unpack() {
66 unpack ${PARCH}.tar.gz
67 cd "${S}"
68
69 sed -i \
70 -e '/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:/usr/bin/xauth:' \
71 pathnames.h || die
72
73 epatch "${FILESDIR}"/${P}-include-string-header.patch
74 epatch "${FILESDIR}"/${P}-ChallengeResponseAuthentication.patch #170670
75 epatch "${FILESDIR}"/${P}-chan-read-failed.patch #181407
76 use X509 && epatch "${DISTDIR}"/${X509_PATCH} "${FILESDIR}"/${PN}-4.4_p1-x509-hpn-glue.patch
77 use chroot && epatch "${FILESDIR}"/openssh-4.3_p1-chroot.patch
78 use smartcard && epatch "${FILESDIR}"/openssh-3.9_p1-opensc.patch
79 if ! use X509 ; then
80 if [[ -n ${LDAP_PATCH} ]] && use ldap ; then
81 epatch "${DISTDIR}"/${LDAP_PATCH} "${FILESDIR}"/${PN}-4.4_p1-ldap-hpn-glue.patch
82 fi
83 elif use ldap ; then
84 ewarn "Sorry, X509 and ldap don't get along, disabling ldap"
85 fi
86 [[ -n ${HPN_PATCH} ]] && use hpn && epatch "${DISTDIR}"/${HPN_PATCH}
87
88 sed -i "s:-lcrypto:$(pkg-config --libs openssl):" configure{,.ac} || die
89
90 eautoreconf
91 }
92
93 src_compile() {
94 addwrite /dev/ptmx
95 addpredict /etc/skey/skeykeys #skey configure code triggers this
96
97 local myconf=""
98 if use static ; then
99 append-ldflags -static
100 use pam && ewarn "Disabling pam support becuse of static flag"
101 myconf="${myconf} --without-pam"
102 else
103 myconf="${myconf} $(use_with pam)"
104 fi
105
106 econf \
107 --with-ldflags="${LDFLAGS}" \
108 --disable-strip \
109 --sysconfdir=/etc/ssh \
110 --libexecdir=/usr/$(get_libdir)/misc \
111 --datadir=/usr/share/openssh \
112 --disable-suid-ssh \
113 --with-privsep-path=/var/empty \
114 --with-privsep-user=sshd \
115 --with-md5-passwords \
116 $(use_with ldap) \
117 $(use_with libedit) \
118 $(use_with kerberos kerberos5 /usr) \
119 $(use_with tcpd tcp-wrappers) \
120 $(use_with selinux) \
121 $(use_with skey) \
122 $(use_with smartcard opensc) \
123 ${myconf} \
124 || die "bad configure"
125 emake || die "compile problem"
126 }
127
128 src_install() {
129 emake install-nokeys DESTDIR="${D}" || die
130 fperms 600 /etc/ssh/sshd_config
131 dobin contrib/ssh-copy-id
132 newinitd "${FILESDIR}"/sshd.rc6 sshd
133 newconfd "${FILESDIR}"/sshd.confd sshd
134 keepdir /var/empty
135
136 newpamd "${FILESDIR}"/sshd.pam_include.1 sshd
137 dosed "/^#Protocol /s:.*:Protocol 2:" /etc/ssh/sshd_config
138 use pam \
139 && dosed "/^#UsePAM /s:.*:UsePAM yes:" /etc/ssh/sshd_config \
140 && dosed "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" /etc/ssh/sshd_config
141
142 doman contrib/ssh-copy-id.1
143 dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
144
145 diropts -m 0700
146 dodir /etc/skel/.ssh
147 }
148
149 pkg_postinst() {
150 enewgroup sshd 22
151 enewuser sshd 22 -1 /var/empty sshd
152
153 ewarn "Remember to merge your config files in /etc/ssh/ and then"
154 ewarn "restart sshd: '/etc/init.d/sshd restart'."
155 if use pam ; then
156 echo
157 ewarn "Please be aware users need a valid shell in /etc/passwd"
158 ewarn "in order to be allowed to login."
159 fi
160 }

  ViewVC Help
Powered by ViewVC 1.1.20