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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Mon Oct 2 20:25:20 2006 UTC (13 years ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
old

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

  ViewVC Help
Powered by ViewVC 1.1.20