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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Thu Apr 10 03:50:34 2008 UTC (11 years, 6 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
old

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-5.0_p1.ebuild,v 1.2 2008/04/06 22:44:30 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.1.diff.gz"
12 #LDAP_PATCH="${PARCH/openssh-4.9/openssh-lpk-4.6}-0.3.9.patch"
13 HPN_PATCH="${PARCH/5.0/4.9}-hpn13v2.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_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? ( >=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.9_p1-x509-hpn-glue.patch
75 use smartcard && epatch "${FILESDIR}"/openssh-3.9_p1-opensc.patch
76 if ! use X509 ; then
77 if [[ -n ${LDAP_PATCH} ]] && use ldap ; then
78 epatch "${DISTDIR}"/${LDAP_PATCH} "${FILESDIR}"/${PN}-4.4_p1-ldap-hpn-glue.patch
79 epatch "${FILESDIR}"/${P}-lpk-64bit.patch #210110
80 fi
81 #epatch "${DISTDIR}"/openssh-4.7p1-gsskex-20070927.patch #115553
82 else
83 use ldap && ewarn "Sorry, X509 and ldap don't get along, disabling ldap"
84 fi
85 epatch "${FILESDIR}"/${PN}-4.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
86 [[ -n ${HPN_PATCH} ]] && use hpn && epatch "${DISTDIR}"/${HPN_PATCH}
87 epatch "${FILESDIR}"/${PN}-4.7p1-selinux.diff #191665
88
89 sed -i "s:-lcrypto:$(pkg-config --libs openssl):" configure{,.ac} || die
90
91 eautoreconf
92 }
93
94 src_compile() {
95 addwrite /dev/ptmx
96 addpredict /etc/skey/skeykeys #skey configure code triggers this
97
98 local myconf=""
99 if use static ; then
100 append-ldflags -static
101 use pam && ewarn "Disabling pam support becuse of static flag"
102 myconf="${myconf} --without-pam"
103 else
104 myconf="${myconf} $(use_with pam)"
105 fi
106
107 econf \
108 --with-ldflags="${LDFLAGS}" \
109 --disable-strip \
110 --sysconfdir=/etc/ssh \
111 --libexecdir=/usr/$(get_libdir)/misc \
112 --datadir=/usr/share/openssh \
113 --disable-suid-ssh \
114 --with-privsep-path=/var/empty \
115 --with-privsep-user=sshd \
116 --with-md5-passwords \
117 --with-ssl-engine \
118 $(use_with ldap) \
119 $(use_with libedit) \
120 $(use_with kerberos kerberos5 /usr) \
121 $(use_with tcpd tcp-wrappers) \
122 $(use_with selinux) \
123 $(use_with skey) \
124 $(use_with smartcard opensc) \
125 ${myconf} \
126 || die "bad configure"
127 emake || die "compile problem"
128 }
129
130 src_install() {
131 emake install-nokeys DESTDIR="${D}" || die
132 fperms 600 /etc/ssh/sshd_config
133 dobin contrib/ssh-copy-id
134 newinitd "${FILESDIR}"/sshd.rc6 sshd
135 newconfd "${FILESDIR}"/sshd.confd sshd
136 keepdir /var/empty
137
138 newpamd "${FILESDIR}"/sshd.pam_include.1 sshd
139 use pam \
140 && dosed "/^#UsePAM /s:.*:UsePAM yes:" /etc/ssh/sshd_config \
141 && dosed "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" /etc/ssh/sshd_config
142
143 doman contrib/ssh-copy-id.1
144 dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
145
146 diropts -m 0700
147 dodir /etc/skel/.ssh
148 }
149
150 pkg_postinst() {
151 enewgroup sshd 22
152 enewuser sshd 22 -1 /var/empty sshd
153
154 # help fix broken perms caused by older ebuilds.
155 # can probably cut this after the next stage release.
156 chmod u+x "${ROOT}"/etc/skel/.ssh >& /dev/null
157
158 ewarn "Remember to merge your config files in /etc/ssh/ and then"
159 ewarn "restart sshd: '/etc/init.d/sshd restart'."
160 if use pam ; then
161 echo
162 ewarn "Please be aware users need a valid shell in /etc/passwd"
163 ewarn "in order to be allowed to login."
164 fi
165 }

  ViewVC Help
Powered by ViewVC 1.1.20