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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Thu Sep 25 20:11:02 2003 UTC (16 years ago) by mholzer
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
cleanup

1 # Copyright 1999-2003 Gentoo Technologies, Inc.
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /home/cvsroot/gentoo-x86/net-misc/openssh/openssh-3.7_p1.ebuild,v 1.6 2003/09/17 04:06:24 vapier Exp $
4
5 inherit eutils flag-o-matic ccc
6 [ `use kerberos` ] && append-flags -I/usr/include/gssapi
7
8 # Make it more portable between straight releases
9 # and _p? releases.
10 PARCH=${P/_/}
11
12 S=${WORKDIR}/${PARCH}
13 DESCRIPTION="Port of OpenBSD's free SSH release"
14 HOMEPAGE="http://www.openssh.com/"
15 IUSE="ipv6 static pam tcpd kerberos skey selinux"
16 SRC_URI="ftp://ftp.openbsd.org/pub/unix/OpenBSD/OpenSSH/portable/${PARCH}.tar.gz
17 selinux? ( http://lostlogicx.com/gentoo/openssh_3.6p1-5.se1.diff.bz2 )"
18
19 # openssh recognizes when openssl has been slightly upgraded and refuses to run.
20 # This new rev will use the new openssl.
21 RDEPEND="virtual/glibc
22 pam? ( >=sys-libs/pam-0.73
23 >=sys-apps/shadow-4.0.2-r2 )
24 kerberos? ( app-crypt/mit-krb5 )
25 selinux? ( sys-apps/selinux-small )
26 afs? ( net-fs/openafs
27 app-crypt/kth-krb ) :
28 ( krb4? ( app-crypt/kth-krb ) )
29 skey? ( app-admin/skey )
30 >=dev-libs/openssl-0.9.6d
31 sys-libs/zlib
32 >=sys-apps/sed-4"
33
34 DEPEND="${RDEPEND}
35 dev-lang/perl
36 sys-apps/groff
37 tcpd? ( >=sys-apps/tcp-wrappers-7.6 )"
38
39 SLOT="0"
40 LICENSE="as-is"
41 KEYWORDS="x86 ppc sparc alpha mips hppa arm amd64"
42
43 src_unpack() {
44 unpack ${PARCH}.tar.gz ; cd ${S}
45
46 use selinux && epatch ${DISTDIR}/openssh_3.6p1-5.se1.diff.bz2
47 use alpha && epatch ${FILESDIR}/${PN}-3.5_p1-gentoo-sshd-gcc3.patch
48 }
49
50 src_compile() {
51 local myconf
52
53 use tcpd || myconf="${myconf} --without-tcp-wrappers"
54 use tcpd && myconf="${myconf} --with-tcp-wrappers"
55 use pam || myconf="${myconf} --without-pam"
56 use pam && myconf="${myconf} --with-pam"
57 use ipv6 || myconf="${myconf} --with-ipv4-default"
58 use krb4 && myconf="${myconf} --with-kerberos4=/usr/athena"
59 use kerberos && myconf="${myconf} --with-kerberos5"
60 use skey || myconf="${myconf} --without-skey"
61 use skey && {
62 myconf="${myconf} --with-skey"
63
64 # prevent the conftest from violating the sandbox
65 sed -i 's#skey_keyinfo("")#"true"#g' ${S}/configure
66
67 # make sure .sbss is large enough
68 use alpha && append-ldflags -mlarge-data
69 }
70
71 if [ "`use afs`" ] && [ "`use krb4`" ]; then
72 myconf="${myconf} --with-afs"
73 elif [ "`use afs`" ] && [ -z "`use krb4`" ]; then
74 myconf="${myconf} --with-afs"
75 myconf="${myconf} --with-kerberos4=/usr/athena"
76 fi
77
78 use selinux && append-flags "-DWITH_SELINUX"
79
80 ./configure \
81 --prefix=/usr \
82 --sysconfdir=/etc/ssh \
83 --mandir=/usr/share/man \
84 --libexecdir=/usr/lib/misc \
85 --datadir=/usr/share/openssh \
86 --disable-suid-ssh \
87 --with-privsep-path=/var/empty \
88 --with-privsep-user=sshd \
89 --with-md5-passwords \
90 --host=${CHOST} ${myconf} || die "bad configure"
91
92 if [ "`use static`" ]
93 then
94 # statically link to libcrypto -- good for the boot cd
95 sed -i "s:-lcrypto:/usr/lib/libcrypto.a:g" Makefile
96 fi
97
98 if [ "`use selinux`" ]
99 then
100 #add -lsecure
101 sed -i "s:LIBS=\(.*\):LIBS=\1 -lsecure:" Makefile
102 fi
103
104 emake || die "compile problem"
105 }
106
107 src_install() {
108 make install-files DESTDIR=${D} || die
109 chmod 600 ${D}/etc/ssh/sshd_config
110 dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
111 insinto /etc/pam.d ; newins ${FILESDIR}/sshd.pam sshd
112 exeinto /etc/init.d ; newexe ${FILESDIR}/sshd.rc6 sshd
113 touch ${D}/var/empty/.keep
114 }
115
116 pkg_preinst() {
117 userdel sshd 2> /dev/null
118 if ! groupmod sshd; then
119 groupadd -g 90 sshd 2> /dev/null || \
120 die "Failed to create sshd group"
121 fi
122 useradd -u 22 -g sshd -s /dev/null -d /var/empty -c "sshd" sshd || \
123 die "Failed to create sshd user"
124 }
125
126 pkg_postinst() {
127 # empty dir for the new priv separation auth chroot..
128 install -d -m0755 -o root -g root ${ROOT}/var/empty
129
130 ewarn "Remember to merge your config files in /etc/ssh/ and then"
131 ewarn "restart sshd: '/etc/init.d/sshd restart'."
132 ewarn
133 einfo "As of version 3.4 the default is to enable the UsePrivelegeSeparation"
134 einfo "functionality, but please ensure that you do not explicitly disable"
135 einfo "this in your configuration as disabling it opens security holes."
136 einfo
137 einfo "This revision has removed your sshd user id and replaced it with a"
138 einfo "new one with UID 22. If you have any scripts or programs that"
139 einfo "that referenced the old UID directly, you will need to update them."
140 einfo
141 if use pam >/dev/null 2>&1; then
142 einfo "Please be aware users need a valid shell in /etc/passwd"
143 einfo "in order to be allowed to login."
144 einfo
145 fi
146 }

  ViewVC Help
Powered by ViewVC 1.1.20