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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.13 - (hide annotations) (download)
Tue Mar 9 01:04:17 2010 UTC (9 years, 10 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.12: +1 -1 lines
FILE REMOVED
old

1 robbat2 1.1 # Copyright 1999-2009 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 vapier 1.13 # $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/openssh-5.2_p1-r1.ebuild,v 1.12 2009/08/13 06:30:33 vapier Exp $
4 robbat2 1.1
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/openssh-lpk}-0.3.11.patch.gz"
13 vapier 1.2 PKCS11_PATCH="${PARCH/p1}pkcs11-0.26.tar.bz2"
14 robbat2 1.1 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 armin76 1.8 KEYWORDS="alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86-fbsd"
28 robbat2 1.1 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     # Not needed anymore of 0.3.11. Merged into the main patch.
94     #epatch "${FILESDIR}"/${PN}-5.1_p1-ldap-hpn-glue.patch
95 robbat2 1.11
96     # Fixup per bug #266654
97     epatch "${FILESDIR}"/${PN}-5.2p1-ldap-stdargs.diff
98 robbat2 1.1 fi
99     #epatch "${DISTDIR}"/openssh-5.0p1-gsskex-20080404.patch #115553 #216932
100     else
101     use ldap && ewarn "Sorry, X509 and ldap don't get along, disabling ldap"
102     fi
103     epatch "${FILESDIR}"/${PN}-4.7_p1-GSSAPI-dns.patch #165444 integrated into gsskex
104     [[ -n ${HPN_PATCH} ]] && use hpn && epatch "${DISTDIR}"/${HPN_PATCH}
105     epatch "${FILESDIR}"/${PN}-4.7p1-selinux.diff #191665
106    
107     sed -i "s:-lcrypto:$(pkg-config --libs openssl):" configure{,.ac} || die
108    
109     # Disable PATH reset, trust what portage gives us. bug 254615
110     sed -i -e 's:^PATH=/:#PATH=/:' configure || die
111    
112     eautoreconf
113     }
114    
115     src_compile() {
116     addwrite /dev/ptmx
117     addpredict /etc/skey/skeykeys #skey configure code triggers this
118    
119     local myconf=""
120     if use static ; then
121     append-ldflags -static
122     use pam && ewarn "Disabling pam support becuse of static flag"
123     myconf="${myconf} --without-pam"
124     else
125     myconf="${myconf} $(use_with pam)"
126     fi
127    
128     econf \
129     --with-ldflags="${LDFLAGS}" \
130     --disable-strip \
131     --sysconfdir=/etc/ssh \
132     --libexecdir=/usr/$(get_libdir)/misc \
133     --datadir=/usr/share/openssh \
134     --with-privsep-path=/var/empty \
135     --with-privsep-user=sshd \
136     --with-md5-passwords \
137     --with-ssl-engine \
138     $(use_with kerberos kerberos5 /usr) \
139     ${LDAP_PATCH:+$(use ldap && use_with ldap)} \
140     $(use_with libedit) \
141     ${PKCS11_PATCH:+$(use pkcs11 && use_with pkcs11)} \
142     $(use_with selinux) \
143     $(use_with skey) \
144     $(use_with smartcard opensc) \
145     $(use_with tcpd tcp-wrappers) \
146     ${myconf} \
147     || die "bad configure"
148     emake || die "compile problem"
149     }
150    
151     src_install() {
152     emake install-nokeys DESTDIR="${D}" || die
153     fperms 600 /etc/ssh/sshd_config
154     dobin contrib/ssh-copy-id
155     newinitd "${FILESDIR}"/sshd.rc6 sshd
156     newconfd "${FILESDIR}"/sshd.confd sshd
157     keepdir /var/empty
158    
159     newpamd "${FILESDIR}"/sshd.pam_include.2 sshd
160     if use pam ; then
161     sed -i \
162     -e "/^#UsePAM /s:.*:UsePAM yes:" \
163     -e "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" \
164     -e "/^#PrintMotd /s:.*:PrintMotd no:" \
165     -e "/^#PrintLastLog /s:.*:PrintLastLog no:" \
166     "${D}"/etc/ssh/sshd_config || die "sed of configuration file failed"
167     fi
168    
169     doman contrib/ssh-copy-id.1
170     dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
171    
172     diropts -m 0700
173     dodir /etc/skel/.ssh
174     }
175    
176 robbat2 1.3 src_test() {
177 vapier 1.10 local t tests skipped failed passed shell
178 robbat2 1.9 tests="interop-tests compat-tests"
179     skipped=""
180 vapier 1.10 shell=$(getent passwd ${UID} | cut -d: -f7)
181     if [[ ${shell} == */nologin ]] || [[ ${shell} == */false ]] ; then
182 robbat2 1.9 elog "Running the full OpenSSH testsuite"
183     elog "requires a usable shell for the 'portage'"
184     elog "user, so we will run a subset only."
185     skipped="${skipped} tests"
186     else
187     tests="${tests} tests"
188     fi
189     for t in ${tests} ; do
190 vapier 1.4 # Some tests read from stdin ...
191     emake -k -j1 ${t} </dev/null \
192 robbat2 1.3 && passed="${passed}${t} " \
193     || failed="${failed}${t} "
194     done
195 robbat2 1.9 einfo "Passed tests: ${passed}"
196     ewarn "Skipped tests: ${skipped}"
197 vapier 1.4 if [[ -n ${failed} ]] ; then
198     ewarn "Failed tests: ${failed}"
199 robbat2 1.3 die "Some tests failed: ${failed}"
200     else
201 robbat2 1.9 einfo "Failed tests: ${failed}"
202 robbat2 1.3 return 0
203     fi
204     }
205    
206 robbat2 1.1 pkg_postinst() {
207     enewgroup sshd 22
208     enewuser sshd 22 -1 /var/empty sshd
209    
210     # help fix broken perms caused by older ebuilds.
211     # can probably cut this after the next stage release.
212     chmod u+x "${ROOT}"/etc/skel/.ssh >& /dev/null
213    
214     ewarn "Remember to merge your config files in /etc/ssh/ and then"
215 vapier 1.12 ewarn "reload sshd: '/etc/init.d/sshd reload'."
216 robbat2 1.1 if use pam ; then
217     echo
218     ewarn "Please be aware users need a valid shell in /etc/passwd"
219     ewarn "in order to be allowed to login."
220     fi
221     if use pkcs11 ; then
222     echo
223     einfo "For PKCS#11 you should also emerge one of the askpass softwares"
224     einfo "Example: net-misc/x11-ssh-askpass"
225     fi
226     }

  ViewVC Help
Powered by ViewVC 1.1.20