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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Fri Sep 7 18:41:29 2007 UTC (12 years, 1 month ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +1 -1 lines
FILE REMOVED
old

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

  ViewVC Help
Powered by ViewVC 1.1.20