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/stunnel/stunnel-4.14-r1.ebuild,v 1.5 2007/03/09 17:38:51 vapier Exp $ |
4 |
|
5 |
inherit ssl-cert eutils flag-o-matic |
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 ~ppc ~sparc ~x86" |
14 |
IUSE="ipv6 selinux tcpd" |
15 |
|
16 |
DEPEND="tcpd? ( sys-apps/tcp-wrappers ) |
17 |
>=dev-libs/openssl-0.9.6j" |
18 |
RDEPEND="${DEPEND} |
19 |
selinux? ( sec-policy/selinux-stunnel )" |
20 |
|
21 |
src_unpack() { |
22 |
unpack ${A} |
23 |
# Hack away generation of certificate |
24 |
sed -i s/^install-data-local:/do-not-run-this:/ "${S}"/tools/Makefile.in |
25 |
} |
26 |
|
27 |
src_compile() { |
28 |
local myconf="" |
29 |
# Don't shoot me for doing this! The stunnel configure script is broke and |
30 |
# doesn't honor --disable-foo |
31 |
if use ipv6 ; then |
32 |
myconf="${myconf} --enable-ipv6" |
33 |
fi |
34 |
if ! use tcpd ; then |
35 |
myconf="${myconf} --disable-libwrap" |
36 |
fi |
37 |
econf ${myconf} || die "econf died" |
38 |
emake || die "emake died" |
39 |
} |
40 |
|
41 |
src_install() { |
42 |
make DESTDIR=${D} install || die "make install failed" |
43 |
rm -rf ${D}/usr/share/doc/${PN} |
44 |
rm -f ${D}/{etc/stunnel/stunnel.conf-sample,usr/sbin/stunnel3} |
45 |
rm -f ${D}/usr/share/man/man8/{stunnel.fr.8,stunnel.pl.8} |
46 |
|
47 |
dodoc AUTHORS BUGS CREDITS INSTALL NEWS PORTS README TODO ChangeLog \ |
48 |
doc/en/transproxy.txt |
49 |
dohtml doc/stunnel.html doc/en/VNC_StunnelHOWTO.html tools/ca.html \ |
50 |
tools/importCA.html |
51 |
|
52 |
insinto /etc/stunnel |
53 |
newins ${FILESDIR}/stunnel.conf stunnel.conf |
54 |
newinitd ${FILESDIR}/stunnel.rc6 stunnel |
55 |
# Check if there's currently an cert already there |
56 |
if [ ! -f /etc/stunnel/stunnel.key ]; then |
57 |
docert stunnel |
58 |
fi |
59 |
|
60 |
keepdir /var/run/stunnel |
61 |
} |
62 |
|
63 |
pkg_postinst() { |
64 |
enewgroup stunnel |
65 |
enewuser stunnel -1 -1 -1 stunnel |
66 |
|
67 |
chown stunnel:stunnel ${ROOT}/var/run/stunnel |
68 |
chown stunnel:stunnel ${ROOT}/etc/stunnel/stunnel.{conf,crt,csr,key,pem} |
69 |
chmod 0640 ${ROOT}/etc/stunnel/stunnel.{conf,crt,csr,key,pem} |
70 |
|
71 |
if [ ! -z "$(egrep '/etc/stunnel/stunnel.pid' \ |
72 |
${ROOT}/etc/stunnel/stunnel.conf )" ] ; then |
73 |
|
74 |
ewarn "As of stunnel-4.09, the pid file will be located in /var/run/stunnel." |
75 |
ewarn "Please stop stunnel, etc-update, and start stunnel back up to ensure" |
76 |
ewarn "the update takes place" |
77 |
ewarn "" |
78 |
ewarn "The new location will be /var/run/stunnel/stunnel.pid" |
79 |
ebeep 3 |
80 |
epause 3 |
81 |
fi |
82 |
} |