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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Mon Mar 12 07:14:57 2007 UTC (12 years, 8 months ago) by vapier
Branch: MAIN
Changes since 1.2: +1 -3 lines
drop bindnow-flags
(Portage version: 2.1.2.2)

1 vapier 1.1 # Copyright 1999-2007 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 vapier 1.3 # $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/openssh-4.6_p1.ebuild,v 1.2 2007/03/12 07:13:18 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-5.5.2.diff.gz"
12     SECURID_PATCH="" #${PARCH/4.5/4.4}+SecurID_v1.3.2.patch"
13     LDAP_PATCH="" #${PARCH/-4.5p1/-lpk-4.5p1}-0.3.8.patch"
14     HPN_PATCH="" #${PARCH}-hpn12v15.diff.gz"
15    
16     DESCRIPTION="Port of OpenBSD's free SSH release"
17     HOMEPAGE="http://www.openssh.com/"
18     SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
19     X509? ( http://roumenpetrov.info/openssh/x509-5.5.2/${X509_PATCH} )"
20     # ldap? ( http://dev.inversepath.com/openssh-lpk/${LDAP_PATCH} )
21     # hpn? ( http://www.psc.edu/networking/projects/hpn-ssh/${HPN_PATCH} )
22     # smartcard? ( http://omniti.com/~jesus/projects/${SECURID_PATCH} )
23    
24     LICENSE="as-is"
25     SLOT="0"
26     KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
27     IUSE="static pam tcpd kerberos skey selinux chroot X509 ldap smartcard hpn libedit X"
28    
29     RDEPEND="pam? ( virtual/pam )
30     kerberos? ( virtual/krb5 )
31     selinux? ( >=sys-libs/libselinux-1.28 )
32     skey? ( >=app-admin/skey-1.1.5-r1 )
33     ldap? ( net-nds/openldap )
34     libedit? ( dev-libs/libedit )
35     >=dev-libs/openssl-0.9.6d
36     >=sys-libs/zlib-1.2.3
37     smartcard? ( dev-libs/opensc )
38     tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
39     X? ( x11-apps/xauth )
40     userland_GNU? ( sys-apps/shadow )"
41     DEPEND="${RDEPEND}
42     dev-util/pkgconfig
43     virtual/os-headers
44     sys-devel/autoconf"
45     PROVIDE="virtual/ssh"
46    
47     S=${WORKDIR}/${PARCH}
48    
49     pkg_setup() {
50     # this sucks, but i'd rather have people unable to `emerge -u openssh`
51     # than not be able to log in to their server any more
52 vapier 1.2 maybe_fail() { [[ -z ${!2} ]] && use ${1} && echo ${1} ; }
53     local fail="
54     $(maybe_fail X509 X509_PATCH)
55     $(maybe_fail smartcard SECURID_PATCH)
56     $(maybe_fail ldap LDAP_PATCH)
57     "
58     fail=$(echo ${fail})
59 vapier 1.1 if [[ -n ${fail} ]] ; then
60     eerror "Sorry, but this version does not yet support features"
61     eerror "that you requested: ${fail}"
62     eerror "Please mask ${PF} for now and check back later:"
63     eerror " # echo '=${CATEGORY}/${PF}' >> /etc/portage/package.mask"
64     die "booooo"
65     fi
66     }
67    
68     src_unpack() {
69     unpack ${PARCH}.tar.gz
70     cd "${S}"
71    
72     sed -i \
73     -e '/_PATH_XAUTH/s:/usr/X11R6/bin/xauth:/usr/bin/xauth:' \
74     pathnames.h || die
75    
76     epatch "${FILESDIR}"/${P}-include-string-header.patch
77     use X509 && epatch "${DISTDIR}"/${X509_PATCH} "${FILESDIR}"/${PN}-4.4_p1-x509-hpn-glue.patch
78     use chroot && epatch "${FILESDIR}"/openssh-4.3_p1-chroot.patch
79     use smartcard && epatch "${FILESDIR}"/openssh-3.9_p1-opensc.patch
80     if ! use X509 ; then
81     if [[ -n ${SECURID_PATCH} ]] && use smartcard ; then
82     epatch "${DISTDIR}"/${SECURID_PATCH} \
83     "${FILESDIR}"/${PN}-4.3_p2-securid-updates.patch \
84     "${FILESDIR}"/${PN}-4.3_p2-securid-hpn-glue.patch
85     use ldap && epatch "${FILESDIR}"/openssh-4.0_p1-smartcard-ldap-happy.patch
86     fi
87 vapier 1.2 if [[ -n ${LDAP_PATCH} ]] && use ldap ; then
88 vapier 1.1 epatch "${DISTDIR}"/${LDAP_PATCH} "${FILESDIR}"/${PN}-4.4_p1-ldap-hpn-glue.patch
89     fi
90     elif [[ -n ${SECURID_PATCH} ]] && use smartcard || use ldap ; then
91     ewarn "Sorry, X509 and smartcard/ldap don't get along, disabling smartcard/ldap"
92     fi
93     [[ -n ${HPN_PATCH} ]] && use hpn && epatch "${DISTDIR}"/${HPN_PATCH}
94    
95     sed -i "s:-lcrypto:$(pkg-config --libs openssl):" configure{,.ac} || die
96    
97     eautoreconf
98     }
99    
100     src_compile() {
101     addwrite /dev/ptmx
102     addpredict /etc/skey/skeykeys #skey configure code triggers this
103    
104     local myconf=""
105     if use static ; then
106     append-ldflags -static
107     use pam && ewarn "Disabling pam support becuse of static flag"
108     myconf="${myconf} --without-pam"
109     else
110     myconf="${myconf} $(use_with pam)"
111     fi
112    
113     econf \
114     --with-ldflags="${LDFLAGS}" \
115     --disable-strip \
116     --sysconfdir=/etc/ssh \
117     --libexecdir=/usr/$(get_libdir)/misc \
118     --datadir=/usr/share/openssh \
119     --disable-suid-ssh \
120     --with-privsep-path=/var/empty \
121     --with-privsep-user=sshd \
122     --with-md5-passwords \
123     $(use_with ldap) \
124     $(use_with libedit) \
125     $(use_with kerberos kerberos5 /usr) \
126     $(use_with tcpd tcp-wrappers) \
127     $(use_with selinux) \
128     $(use_with skey) \
129     $(use_with smartcard opensc) \
130     ${myconf} \
131     || die "bad configure"
132     emake || die "compile problem"
133     }
134    
135     src_install() {
136     emake install-nokeys DESTDIR="${D}" || die
137     fperms 600 /etc/ssh/sshd_config
138     dobin contrib/ssh-copy-id
139     newinitd "${FILESDIR}"/sshd.rc6 sshd
140     newconfd "${FILESDIR}"/sshd.confd sshd
141     keepdir /var/empty
142    
143     newpamd "${FILESDIR}"/sshd.pam_include sshd
144     dosed "/^#Protocol /s:.*:Protocol 2:" /etc/ssh/sshd_config
145     use pam \
146     && dosed "/^#UsePAM /s:.*:UsePAM yes:" /etc/ssh/sshd_config \
147     && dosed "/^#PasswordAuthentication /s:.*:PasswordAuthentication no:" /etc/ssh/sshd_config
148    
149     doman contrib/ssh-copy-id.1
150     dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
151    
152     diropts -m 0600
153     dodir /etc/skel/.ssh
154     }
155    
156     pkg_postinst() {
157     enewgroup sshd 22
158     enewuser sshd 22 -1 /var/empty sshd
159    
160     ewarn "Remember to merge your config files in /etc/ssh/ and then"
161     ewarn "restart sshd: '/etc/init.d/sshd restart'."
162     if use pam ; then
163     echo
164     ewarn "Please be aware users need a valid shell in /etc/passwd"
165     ewarn "in order to be allowed to login."
166     fi
167     }

  ViewVC Help
Powered by ViewVC 1.1.20