1 |
# Copyright 1999-2009 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/net-misc/stunnel/stunnel-4.27-r2.ebuild,v 1.2 2009/12/09 01:01:58 ramereth Exp $ |
4 |
|
5 |
inherit autotools ssl-cert eutils |
6 |
|
7 |
DESCRIPTION="TLS/SSL - Port Wrapper" |
8 |
HOMEPAGE="http://stunnel.mirt.net/" |
9 |
SRC_URI="http://www.stunnel.org/download/stunnel/src/${P}.tar.gz" |
10 |
|
11 |
LICENSE="GPL-2" |
12 |
SLOT="0" |
13 |
KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc x86" |
14 |
IUSE="ipv6 selinux tcpd" |
15 |
|
16 |
DEPEND="tcpd? ( sys-apps/tcp-wrappers ) |
17 |
>=dev-libs/openssl-0.9.8k" |
18 |
RDEPEND="${DEPEND} |
19 |
selinux? ( sec-policy/selinux-stunnel )" |
20 |
|
21 |
pkg_setup() { |
22 |
enewgroup stunnel |
23 |
enewuser stunnel -1 -1 -1 stunnel |
24 |
} |
25 |
|
26 |
src_unpack() { |
27 |
unpack ${A} |
28 |
cd "${S}" |
29 |
epatch "${FILESDIR}/${PN}-4.21-libwrap.patch" |
30 |
eautoreconf |
31 |
|
32 |
# Hack away generation of certificate |
33 |
sed -i -e "s/^install-data-local:/do-not-run-this:/" \ |
34 |
tools/Makefile.in || die "sed failed" |
35 |
} |
36 |
|
37 |
src_compile() { |
38 |
econf $(use_enable ipv6) \ |
39 |
$(use_enable tcpd libwrap) || die "econf died" |
40 |
emake || die "emake died" |
41 |
} |
42 |
|
43 |
src_install() { |
44 |
emake DESTDIR="${D}" install || die "emake install failed" |
45 |
rm -rf "${D}"/usr/share/doc/${PN} |
46 |
rm -f "${D}"/etc/stunnel/stunnel.conf-sample "${D}"/usr/bin/stunnel3 \ |
47 |
"${D}"/usr/share/man/man8/stunnel.{fr,pl}.8 |
48 |
|
49 |
# The binary was moved to /usr/bin with 4.21, |
50 |
# symlink for backwards compatibility |
51 |
dosym ../bin/stunnel /usr/sbin/stunnel |
52 |
|
53 |
dodoc AUTHORS BUGS CREDITS PORTS README TODO ChangeLog doc/en/transproxy.txt |
54 |
dohtml doc/stunnel.html doc/en/VNC_StunnelHOWTO.html tools/ca.html \ |
55 |
tools/importCA.html |
56 |
|
57 |
insinto /etc/stunnel |
58 |
doins "${FILESDIR}"/stunnel.conf |
59 |
newinitd "${FILESDIR}"/stunnel.initd stunnel |
60 |
|
61 |
keepdir /var/run/stunnel |
62 |
fowners stunnel:stunnel /var/run/stunnel |
63 |
} |
64 |
|
65 |
pkg_postinst() { |
66 |
if [ ! -f "${ROOT}"/etc/stunnel/stunnel.key ]; then |
67 |
install_cert /etc/stunnel/stunnel |
68 |
chown stunnel:stunnel "${ROOT}"/etc/stunnel/stunnel.{crt,csr,key,pem} |
69 |
chmod 0640 "${ROOT}"/etc/stunnel/stunnel.{crt,csr,key,pem} |
70 |
fi |
71 |
|
72 |
einfo "If you want to run multiple instances of stunnel, create a new config" |
73 |
einfo "file ending with .conf in /etc/stunnel/. **Make sure** you change " |
74 |
einfo "\'pid= \' with a unique filename." |
75 |
} |