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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Thu May 15 22:10:48 2003 UTC (16 years, 7 months ago) by mholzer
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +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_p1.ebuild,v 1.1 2003/04/02 06:18:32 lostlogic Exp $
4
5 inherit eutils
6
7 IUSE="ipv6 static pam tcpd kerberos selinux"
8
9 # Make it more portable between straight releases
10 # and _p? releases.
11 PARCH=${P/_/}
12 S=${WORKDIR}/${PARCH}
13 DESCRIPTION="Port of OpenBSD's free SSH release"
14 HOMEPAGE="http://www.openssh.com/"
15 SRC_URI="ftp://ftp.openbsd.org/pub/unix/OpenBSD/OpenSSH/portable/${PARCH}.tar.gz
16 selinux? http://lostlogicx.com/gentoo/openssh_3.6p1-5.se1.diff.bz2"
17
18 # openssh recognizes when openssl has been slightly upgraded and refuses to run.
19 # This new rev will use the new openssl.
20 RDEPEND="virtual/glibc
21 pam? ( >=sys-libs/pam-0.73 >=sys-apps/shadow-4.0.2-r2 )
22 kerberos? ( app-crypt/krb5 )
23 selinux? ( sys-apps/selinux-small )
24 >=dev-libs/openssl-0.9.6d
25 sys-libs/zlib"
26
27 DEPEND="${RDEPEND}
28 dev-lang/perl
29 sys-apps/groff
30 tcpd? ( >=sys-apps/tcp-wrappers-7.6 )"
31
32
33 SLOT="0"
34 LICENSE="as-is"
35 KEYWORDS="~x86 ~ppc ~sparc ~alpha ~mips ~hppa arm"
36
37 src_unpack() {
38 unpack ${PARCH}.tar.gz
39 cd ${S}
40 use selinux && epatch ${DISTDIR}/openssh_3.6p1-5.se1.diff.bz2
41
42 if [ `use alpha` ]; then
43 epatch ${FILESDIR}/${PN}-3.5_p1-gentoo-sshd-gcc3.patch || die
44 fi
45 }
46
47 src_compile() {
48 local myconf
49 use tcpd || myconf="${myconf} --without-tcp-wrappers"
50 use tcpd && myconf="${myconf} --with-tcp-wrappers"
51 use pam || myconf="${myconf} --without-pam"
52 use pam && myconf="${myconf} --with-pam"
53 use ipv6 || myconf="${myconf} --with-ipv4-default"
54
55 # app-crypt/krb5
56 use kerberos && myconf="${myconf} --with-kerberos5"
57
58 # app-crypt/kth-krb
59 # KTH's implementation of kerberos IV
60 # KTH_KRB="yes" emerge openssh-3.5_p1-r1.ebuild
61 if [ ! -z $KTH_KRB ]; then
62 myconf="${myconf} --with-kerberos4=/usr/athena"
63 fi
64
65 use selinux && CFLAGS="${CFLAGS} -DWITH_SELINUX"
66
67 ./configure \
68 --prefix=/usr \
69 --sysconfdir=/etc/ssh \
70 --mandir=/usr/share/man \
71 --libexecdir=/usr/lib/misc \
72 --datadir=/usr/share/openssh \
73 --disable-suid-ssh \
74 --with-privsep-path=/var/empty \
75 --with-privsep-user=sshd \
76 --with-md5-passwords \
77 --host=${CHOST} ${myconf} || die "bad configure"
78
79 if [ "`use static`" ]
80 then
81 # statically link to libcrypto -- good for the boot cd
82 perl -pi -e "s|-lcrypto|/usr/lib/libcrypto.a|g" Makefile
83 fi
84
85 if [ "`use selinux`" ]
86 then
87 #add -lsecure
88 sed "s:LIBS=\(.*\):LIBS=\1 -lsecure:" < Makefile > Makefile.new
89 mv Makefile.new Makefile
90 fi
91
92 emake || die "compile problem"
93 }
94
95 src_install() {
96 make install-files DESTDIR=${D} || die
97 chmod 600 ${D}/etc/ssh/sshd_config
98 dodoc ChangeLog CREDITS OVERVIEW README* TODO sshd_config
99 insinto /etc/pam.d ; newins ${FILESDIR}/sshd.pam sshd
100 exeinto /etc/init.d ; newexe ${FILESDIR}/sshd.rc6 sshd
101 touch ${D}/var/empty/.keep
102 }
103
104 pkg_preinst() {
105
106 userdel sshd 2> /dev/null
107 if ! groupmod sshd; then
108 groupadd -g 90 sshd 2> /dev/null || \
109 die "Failed to create sshd group"
110 fi
111 useradd -u 22 -g sshd -s /dev/null -d /var/empty -c "sshd" sshd || \
112 die "Failed to create sshd user"
113
114 }
115
116 pkg_postinst() {
117
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