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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Wed Feb 25 18:11:16 2009 UTC (10 years, 9 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +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.2_p1.ebuild,v 1.2 2009/02/24 19:11:25 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 #HPN_PATCH="${PARCH/2/1}-hpn13v5.diff.gz"
12 #LDAP_PATCH="${PARCH/openssh-5.2/openssh-lpk-5.1}-0.3.10.patch.gz"
13 #PKCS11_PATCH="${PARCH/2p1/1}pkcs11-0.26.tar.bz2"
14 X509_VER="6.2" X509_PATCH="${PARCH}+x509-${X509_VER}.diff.gz"
15
16 DESCRIPTION="Port of OpenBSD's free SSH release"
17 HOMEPAGE="http://www.openssh.org/"
18 SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
19 http://www.sxw.org.uk/computing/patches/openssh-5.0p1-gsskex-20080404.patch
20 ${HPN_PATCH:+hpn? ( http://www.psc.edu/networking/projects/hpn-ssh/${HPN_PATCH} )}
21 ${LDAP_PATCH:+ldap? ( mirror://gentoo/${LDAP_PATCH} )}
22 ${PKCS11_PATCH:+pkcs11? ( http://alon.barlev.googlepages.com/${PKCS11_PATCH} )}
23 ${X509_PATCH:+X509? ( http://roumenpetrov.info/openssh/x509-${X509_VER}/${X509_PATCH} )}"
24
25 LICENSE="as-is"
26 SLOT="0"
27 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
28 IUSE="hpn kerberos ldap libedit pam pkcs11 selinux skey smartcard static tcpd X X509"
29
30 RDEPEND="pam? ( virtual/pam )
31 kerberos? ( virtual/krb5 )
32 selinux? ( >=sys-libs/libselinux-1.28 )
33 skey? ( >=sys-auth/skey-1.1.5-r1 )
34 ldap? ( net-nds/openldap )
35 libedit? ( dev-libs/libedit )
36 >=dev-libs/openssl-0.9.6d
37 >=sys-libs/zlib-1.2.3
38 smartcard? ( dev-libs/opensc )
39 pkcs11? ( dev-libs/pkcs11-helper )
40 tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
41 X? ( x11-apps/xauth )
42 userland_GNU? ( sys-apps/shadow )"
43 DEPEND="${RDEPEND}
44 dev-util/pkgconfig
45 virtual/os-headers
46 sys-devel/autoconf"
47 RDEPEND="${RDEPEND}
48 pam? ( >=sys-auth/pambase-20081028 )"
49 PROVIDE="virtual/ssh"
50
51 S=${WORKDIR}/${PARCH}
52
53 pkg_setup() {
54 # this sucks, but i'd rather have people unable to `emerge -u openssh`
55 # than not be able to log in to their server any more
56 maybe_fail() { [[ -z ${!2} ]] && use ${1} && echo ${1} ; }
57 local fail="
58 $(maybe_fail ldap LDAP_PATCH)
59 $(maybe_fail pkcs11 PKCS11_PATCH)
60 $(maybe_fail X509 X509_PATCH)
61 "
62 fail=$(echo ${fail})
63 if [[ -n ${fail} ]] ; then
64 eerror "Sorry, but this version does not yet support features"
65 eerror "that you requested: ${fail}"
66 eerror "Please mask ${PF} for now and check back later:"
67 eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
68 die "booooo"
69 fi
70 }
71
72 src_unpack() {
73 unpack ${PARCH}.tar.gz
74 cd "${S}"
75
76 sed -i \
77 -e '/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:/usr/bin/xauth:' \
78 pathnames.h || die
79
80 if use pkcs11 ; then
81 cd "${WORKDIR}"
82 unpack "${PKCS11_PATCH}"
83 cd "${S}"
84 EPATCH_OPTS="-p1" epatch "${WORKDIR}"/*pkcs11*/{1,2,4}*
85 use X509 && EPATCH_OPTS="-R" epatch "${WORKDIR}"/*pkcs11*/1000_all_log.patch
86 fi
87 use X509 && epatch "${DISTDIR}"/${X509_PATCH}
88 use smartcard && epatch "${FILESDIR}"/openssh-3.9_p1-opensc.patch
89 if ! use X509 ; then
90 if [[ -n ${LDAP_PATCH} ]] && use ldap ; then
91 # The patch for bug 210110 64-bit stuff is now included.
92 epatch "${DISTDIR}"/${LDAP_PATCH}
93 epatch "${FILESDIR}"/${PN}-5.1_p1-ldap-hpn-glue.patch
94 fi
95 #epatch "${DISTDIR}"/openssh-5.0p1-gsskex-20080404.patch #115553 #216932
96 else
97 use ldap && ewarn "Sorry, X509 and ldap don't get along, disabling ldap"
98 fi
99 epatch "${FILESDIR}"/${PN}-4.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
100 [[ -n ${HPN_PATCH} ]] && use hpn && epatch "${DISTDIR}"/${HPN_PATCH}
101 epatch "${FILESDIR}"/${PN}-4.7p1-selinux.diff #191665
102
103 sed -i "s:-lcrypto:$(pkg-config --libs openssl):" configure{,.ac} || die
104
105 # Disable PATH reset, trust what portage gives us. bug 254615
106 sed -i -e 's:^PATH=/:#PATH=/:' configure || die
107
108 eautoreconf
109 }
110
111 src_compile() {
112 addwrite /dev/ptmx
113 addpredict /etc/skey/skeykeys #skey configure code triggers this
114
115 local myconf=""
116 if use static ; then
117 append-ldflags -static
118 use pam && ewarn "Disabling pam support becuse of static flag"
119 myconf="${myconf} --without-pam"
120 else
121 myconf="${myconf} $(use_with pam)"
122 fi
123
124 econf \
125 --with-ldflags="${LDFLAGS}" \
126 --disable-strip \
127 --sysconfdir=/etc/ssh \
128 --libexecdir=/usr/$(get_libdir)/misc \
129 --datadir=/usr/share/openssh \
130 --with-privsep-path=/var/empty \
131 --with-privsep-user=sshd \
132 --with-md5-passwords \
133 --with-ssl-engine \
134 $(use_with kerberos kerberos5 /usr) \
135 ${LDAP_PATCH:+$(use ldap && use_with ldap)} \
136 $(use_with libedit) \
137 ${PKCS11_PATCH:+$(use pkcs11 && use_with pkcs11)} \
138 $(use_with selinux) \
139 $(use_with skey) \
140 $(use_with smartcard opensc) \
141 $(use_with tcpd tcp-wrappers) \
142 ${myconf} \
143 || die "bad configure"
144 emake || die "compile problem"
145 }
146
147 src_install() {
148 emake install-nokeys DESTDIR="${D}" || die
149 fperms 600 /etc/ssh/sshd_config
150 dobin contrib/ssh-copy-id
151 newinitd "${FILESDIR}"/sshd.rc6 sshd
152 newconfd "${FILESDIR}"/sshd.confd sshd
153 keepdir /var/empty
154
155 newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
156 if use pam ; then
157 sed -i \
158 -e "/^#UsePAM /s:.*:UsePAM yes:" \
159 -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
160 -e "/^#PrintMotd /s:.*:PrintMotd no:" \
161 -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
162 "${D}"/etc/ssh/sshd_config || die "sed of configuration file failed"
163 fi
164
165 doman contrib/ssh-copy-id.1
166 dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
167
168 diropts -m 0700
169 dodir /etc/skel/.ssh
170 }
171
172 pkg_postinst() {
173 enewgroup sshd 22
174 enewuser sshd 22 -1 /var/empty sshd
175
176 # help fix broken perms caused by older ebuilds.
177 # can probably cut this after the next stage release.
178 chmod u+x "${ROOT}"/etc/skel/.ssh >& /dev/null
179
180 ewarn "Remember to merge your config files in /etc/ssh/ and then"
181 ewarn "restart sshd: '/etc/init.d/sshd restart'."
182 if use pam ; then
183 echo
184 ewarn "Please be aware users need a valid shell in /etc/passwd"
185 ewarn "in order to be allowed to login."
186 fi
187 if use pkcs11 ; then
188 echo
189 einfo "For PKCS#11 you should also emerge one of the askpass softwares"
190 einfo "Example: net-misc/x11-ssh-askpass"
191 fi
192 }

  ViewVC Help
Powered by ViewVC 1.1.20