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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Thu Jan 24 19:55:05 2008 UTC (12 years ago) by armin76
Branch: MAIN
Changes since 1.1: +3 -3 lines
alpha/ia64/sparc/x86 stable
(Portage version: 2.1.3.19)

1 armin76 1.2 # Copyright 1999-2008 Gentoo Foundation
2 vapier 1.1 # Distributed under the terms of the GNU General Public License v2
3 armin76 1.2 # $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/openssh-4.7_p1-r3.ebuild,v 1.1 2007/11/21 04:21:12 vapier Exp $
4 vapier 1.1
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.diff.gz"
12     LDAP_PATCH="${PARCH/openssh-4.7/openssh-lpk-4.6}-0.3.9.patch"
13     HPN_PATCH="${PARCH}-hpn12v19.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 armin76 1.2 KEYWORDS="alpha ~amd64 ~arm ~hppa ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh sparc ~sparc-fbsd x86 ~x86-fbsd"
25 vapier 1.1 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? ( >=app-admin/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     use X509 && epatch "${DISTDIR}"/${X509_PATCH} "${FILESDIR}"/${PN}-4.4_p1-x509-hpn-glue.patch
74     use chroot && epatch "${FILESDIR}"/openssh-4.3_p1-chroot.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     fi
80     elif use ldap ; then
81     ewarn "Sorry, X509 and ldap don't get along, disabling ldap"
82     fi
83     [[ -n ${HPN_PATCH} ]] && use hpn && epatch "${DISTDIR}"/${HPN_PATCH}
84     epatch "${FILESDIR}"/${P}-GSSAPI-dns.patch #165444
85    
86     sed -i "s:-lcrypto:$(pkg-config --libs openssl):" configure{,.ac} || die
87    
88     eautoreconf
89     }
90    
91     src_compile() {
92     addwrite /dev/ptmx
93     addpredict /etc/skey/skeykeys #skey configure code triggers this
94    
95     local myconf=""
96     if use static ; then
97     append-ldflags -static
98     use pam && ewarn "Disabling pam support becuse of static flag"
99     myconf="${myconf} --without-pam"
100     else
101     myconf="${myconf} $(use_with pam)"
102     fi
103    
104     econf \
105     --with-ldflags="${LDFLAGS}" \
106     --disable-strip \
107     --sysconfdir=/etc/ssh \
108     --libexecdir=/usr/$(get_libdir)/misc \
109     --datadir=/usr/share/openssh \
110     --disable-suid-ssh \
111     --with-privsep-path=/var/empty \
112     --with-privsep-user=sshd \
113     --with-md5-passwords \
114     --with-ssl-engine \
115     $(use_with ldap) \
116     $(use_with libedit) \
117     $(use_with kerberos kerberos5 /usr) \
118     $(use_with tcpd tcp-wrappers) \
119     $(use_with selinux) \
120     $(use_with skey) \
121     $(use_with smartcard opensc) \
122     ${myconf} \
123     || die "bad configure"
124     emake || die "compile problem"
125     }
126    
127     src_install() {
128     emake install-nokeys DESTDIR="${D}" || die
129     fperms 600 /etc/ssh/sshd_config
130     dobin contrib/ssh-copy-id
131     newinitd "${FILESDIR}"/sshd.rc6 sshd
132     newconfd "${FILESDIR}"/sshd.confd sshd
133     keepdir /var/empty
134    
135     newpamd "${FILESDIR}"/sshd.pam_include.1 sshd
136     use pam \
137     && dosed "/^#UsePAM /s:.*:UsePAM yes:" /etc/ssh/sshd_config \
138     && dosed "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" /etc/ssh/sshd_config
139    
140     doman contrib/ssh-copy-id.1
141     dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
142    
143     diropts -m 0700
144     dodir /etc/skel/.ssh
145     }
146    
147     pkg_postinst() {
148     enewgroup sshd 22
149     enewuser sshd 22 -1 /var/empty sshd
150    
151     # help fix broken perms caused by older ebuilds.
152     # can probably cut this after the next stage release.
153     chmod u+x "${ROOT}"/etc/skel/.ssh >& /dev/null
154    
155     ewarn "Remember to merge your config files in /etc/ssh/ and then"
156     ewarn "restart sshd: '/etc/init.d/sshd restart'."
157     if use pam ; then
158     echo
159     ewarn "Please be aware users need a valid shell in /etc/passwd"
160     ewarn "in order to be allowed to login."
161     fi
162     }

  ViewVC Help
Powered by ViewVC 1.1.20