/[gentoo-x86]/net-misc/openssh/openssh-3.6.1_p2-r2.ebuild
Gentoo

Contents of /net-misc/openssh/openssh-3.6.1_p2-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Thu Sep 25 20:11:02 2003 UTC (16 years ago) by mholzer
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +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.6.1_p2-r2.ebuild,v 1.3 2003/09/16 19:32:41 vapier Exp $
4
5 inherit eutils flag-o-matic
6
7 # Make it more portable between straight releases
8 # and _p? releases.
9 PARCH=${P/_/}
10 X509_PATCH=${PARCH}+x509g2.diff.gz
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 selinux X509"
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 X509? ( http://roumenpetrov.info/openssh/x509g2/${X509_PATCH} )"
19
20 # openssh recognizes when openssl has been slightly upgraded and refuses to run.
21 # This new rev will use the new openssl.
22 RDEPEND="virtual/glibc
23 pam? ( >=sys-libs/pam-0.73
24 >=sys-apps/shadow-4.0.2-r2 )
25 kerberos? ( app-crypt/mit-krb5 )
26 selinux? ( sys-apps/selinux-small )
27 afs? ( net-fs/openafs
28 app-crypt/kth-krb ) :
29 ( krb4? ( app-crypt/kth-krb ) )
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 use X509 && epatch ${DISTDIR}/${X509_PATCH}
49 }
50
51 src_compile() {
52 local myconf
53
54 use tcpd || myconf="${myconf} --without-tcp-wrappers"
55 use tcpd && myconf="${myconf} --with-tcp-wrappers"
56 use pam || myconf="${myconf} --without-pam"
57 use pam && myconf="${myconf} --with-pam"
58 use ipv6 || myconf="${myconf} --with-ipv4-default"
59 use krb4 && myconf="${myconf} --with-kerberos4=/usr/athena"
60 use kerberos && myconf="${myconf} --with-kerberos5"
61
62 if [ "`use afs`" ] && [ "`use krb4`" ]; then
63 myconf="${myconf} --with-afs"
64 elif [ "`use afs`" ] && [ -z "`use krb4`" ]; then
65 myconf="${myconf} --with-afs"
66 myconf="${myconf} --with-kerberos4=/usr/athena"
67 fi
68
69 use selinux && append-flags "-DWITH_SELINUX"
70
71 ./configure \
72 --prefix=/usr \
73 --sysconfdir=/etc/ssh \
74 --mandir=/usr/share/man \
75 --libexecdir=/usr/lib/misc \
76 --datadir=/usr/share/openssh \
77 --disable-suid-ssh \
78 --with-privsep-path=/var/empty \
79 --with-privsep-user=sshd \
80 --with-md5-passwords \
81 --host=${CHOST} ${myconf} || die "bad configure"
82
83 if [ "`use static`" ]
84 then
85 # statically link to libcrypto -- good for the boot cd
86 sed -i "s:-lcrypto:/usr/lib/libcrypto.a:g" Makefile
87 fi
88
89 if [ "`use selinux`" ]
90 then
91 #add -lsecure
92 sed -i "s:LIBS=\(.*\):LIBS=\1 -lsecure:" Makefile
93 fi
94
95 emake || die "compile problem"
96 }
97
98 src_install() {
99 make install-files DESTDIR=${D} || die
100 chmod 600 ${D}/etc/ssh/sshd_config
101 dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
102 insinto /etc/pam.d ; newins ${FILESDIR}/sshd.pam sshd
103 exeinto /etc/init.d ; newexe ${FILESDIR}/sshd.rc6 sshd
104 touch ${D}/var/empty/.keep
105 }
106
107 pkg_preinst() {
108 userdel sshd 2> /dev/null
109 if ! groupmod sshd; then
110 groupadd -g 90 sshd 2> /dev/null || \
111 die "Failed to create sshd group"
112 fi
113 useradd -u 22 -g sshd -s /dev/null -d /var/empty -c "sshd" sshd || \
114 die "Failed to create sshd user"
115 }
116
117 pkg_postinst() {
118 # empty dir for the new priv separation auth chroot..
119 install -d -m0755 -o root -g root ${ROOT}/var/empty
120
121 einfo
122 einfo "Remember to merge your config files in /etc/ssh!"
123 einfo "As of version 3.4 the default is to enable the UsePrivelegeSeparation"
124 einfo "functionality, but please ensure that you do not explicitly disable"
125 einfo "this in your configuration as disabling it opens security holes"
126 einfo
127 einfo "This revision has removed your sshd user id and replaced it with a"
128 einfo "new one with UID 22. If you have any scripts or programs that"
129 einfo "that referenced the old UID directly, you will need to update them."
130 einfo
131 if use pam >/dev/null 2>&1; then
132 einfo "Please be aware users need a valid shell in /etc/passwd"
133 einfo "in order to be allowed to login."
134 einfo
135 fi
136 }

  ViewVC Help
Powered by ViewVC 1.1.20