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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Mon Sep 5 20:00:28 2005 UTC (14 years, 1 month ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +1 -1 lines
FILE REMOVED
old

1 # Copyright 1999-2005 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/openssh/openssh-4.1_p1.ebuild,v 1.7 2005/08/24 00:07:24 vapier Exp $
4
5 inherit eutils flag-o-matic ccc pam
6
7 # Make it more portable between straight releases
8 # and _p? releases.
9 PARCH=${P/_/}
10
11 SFTPLOG_PATCH_VER="1.2"
12 X509_PATCH="${PARCH}+x509-5.1.diff.gz"
13 SELINUX_PATCH="openssh-3.9_p1-selinux.diff"
14 SECURID_PATCH="" #${PARCH}+SecurID_v1.3.1.patch
15 LDAP_PATCH="openssh-lpk-4.0p1-0.3.4.patch" #${PARCH/-/-lpk-}-0.3.4.patch
16 HPN_PATCH="${PARCH}-hpn11.diff"
17
18 DESCRIPTION="Port of OpenBSD's free SSH release"
19 HOMEPAGE="http://www.openssh.com/"
20 SRC_URI="mirror://openbsd/OpenSSH/portable/${PARCH}.tar.gz
21 ldap? ( http://www.opendarwin.org/en/projects/openssh-lpk/files/${LDAP_PATCH} )
22 X509? ( http://roumenpetrov.info/openssh/x509-5.1/${X509_PATCH} )
23 hpn? ( http://www.psc.edu/networking/projects/hpn-ssh/${HPN_PATCH} )"
24 # smartcard? ( http://www.omniti.com/~jesus/projects/${SECURID_PATCH} )
25
26 LICENSE="as-is"
27 SLOT="0"
28 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
29 IUSE="ipv6 static pam tcpd kerberos skey selinux chroot X509 ldap smartcard sftplogging hpn libedit"
30
31 RDEPEND="pam? ( virtual/pam )
32 kerberos? ( virtual/krb5 )
33 selinux? ( sys-libs/libselinux )
34 skey? ( >=app-admin/skey-1.1.5-r1 )
35 ldap? ( net-nds/openldap )
36 libedit? ( dev-libs/libedit )
37 >=dev-libs/openssl-0.9.6d
38 >=sys-libs/zlib-1.1.4
39 smartcard? ( dev-libs/opensc )
40 tcpd? ( >=sys-apps/tcp-wrappers-7.6 )"
41 DEPEND="${RDEPEND}
42 virtual/os-headers
43 !features_noman? ( sys-apps/groff )
44 sys-devel/autoconf"
45 PROVIDE="virtual/ssh"
46
47 S=${WORKDIR}/${PARCH}
48
49 src_unpack() {
50 unpack ${PARCH}.tar.gz
51 cd "${S}"
52
53 #epatch "${FILESDIR}"/openssh-3.9_p1-largekey.patch.bz2
54 epatch "${FILESDIR}"/openssh-3.9_p1-kerberos-detection.patch #80811
55
56 use X509 && epatch ${DISTDIR}/${X509_PATCH}
57 use sftplogging && epatch ${FILESDIR}/openssh-4.0_p1-sftplogging-1.2-gentoo.patch.bz2
58 use skey && epatch ${FILESDIR}/openssh-3.9_p1-skey.patch.bz2
59 use chroot && epatch ${FILESDIR}/openssh-3.9_p1-chroot.patch
60 use selinux && epatch ${FILESDIR}/${SELINUX_PATCH}.bz2
61 use smartcard && epatch ${FILESDIR}/openssh-3.9_p1-opensc.patch.bz2
62 if ! use X509 ; then
63 if [[ -n ${SECURID_PATCH} ]] && use smartcard ; then
64 epatch ${DISTDIR}/${SECURID_PATCH}
65 use ldap && epatch ${FILESDIR}/openssh-4.0_p1-smartcard-ldap-happy.patch
66 fi
67 if use sftplogging ; then
68 ewarn "Sorry, sftplogging and ldap don't get along"
69 else
70 use ldap && epatch ${DISTDIR}/${LDAP_PATCH}
71 fi
72 elif use smartcard || use ldap ; then
73 ewarn "Sorry, x509 and smartcard/ldap don't get along"
74 fi
75 use hpn && epatch ${DISTDIR}/${HPN_PATCH}
76
77 sed -i '/LD.*ssh-keysign/s:$: -Wl,-z,now:' Makefile.in || die "setuid"
78
79 autoconf || die "autoconf failed"
80 }
81
82 src_compile() {
83 local myconf
84
85 addwrite /dev/ptmx
86
87 # make sure .sbss is large enough
88 use skey && use alpha && append-ldflags -mlarge-data
89 if use ldap ; then
90 filter-flags -funroll-loops
91 append-ldflags -lldap
92 append-flags -DWITH_LDAP_PUBKEY
93 fi
94 use selinux && append-flags "-DWITH_SELINUX"
95
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 use ipv6 || myconf="${myconf} --with-ipv4-default"
105
106 econf \
107 --with-ldflags="${LDFLAGS}" \
108 --disable-strip \
109 --sysconfdir=/etc/ssh \
110 --libexecdir=/usr/$(get_libdir)/misc \
111 --datadir=/usr/share/openssh \
112 --disable-suid-ssh \
113 --with-privsep-path=/var/empty \
114 --with-privsep-user=sshd \
115 --with-md5-passwords \
116 $(use_with libedit) \
117 $(use_with kerberos kerberos5 /usr) \
118 $(use_with tcpd tcp-wrappers) \
119 $(use_with skey) \
120 $(use_with smartcard opensc) \
121 ${myconf} \
122 || die "bad configure"
123
124 emake || die "compile problem"
125 }
126
127 src_install() {
128 make 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 keepdir /var/empty
133
134 newpamd "${FILESDIR}"/sshd.pam_include sshd
135 dosed "/^#Protocol /s:.*:Protocol 2:" /etc/ssh/sshd_config
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
144 pkg_postinst() {
145 enewgroup sshd 22
146 enewuser sshd 22 -1 /var/empty sshd
147
148 ewarn "Remember to merge your config files in /etc/ssh/ and then"
149 ewarn "restart sshd: '/etc/init.d/sshd restart'."
150 ewarn
151 einfo "As of version 3.4 the default is to enable the UsePrivelegeSeparation"
152 einfo "functionality, but please ensure that you do not explicitly disable"
153 einfo "this in your configuration as disabling it opens security holes"
154 einfo
155 einfo "This revision has removed your sshd user id and replaced it with a"
156 einfo "new one with UID 22. If you have any scripts or programs that"
157 einfo "that referenced the old UID directly, you will need to update them."
158 einfo
159 if use pam ; then
160 einfo "Please be aware users need a valid shell in /etc/passwd"
161 einfo "in order to be allowed to login."
162 einfo
163 fi
164 }

  ViewVC Help
Powered by ViewVC 1.1.20