1 |
jer |
1.2 |
# Copyright 1999-2014 Gentoo Foundation |
2 |
pacho |
1.1 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
ago |
1.10 |
# $Header: /var/cvsroot/gentoo-x86/net-misc/stunnel/stunnel-4.56-r2.ebuild,v 1.9 2014/03/18 16:38:50 ago Exp $ |
4 |
pacho |
1.1 |
|
5 |
|
|
EAPI="5" |
6 |
|
|
|
7 |
|
|
inherit ssl-cert eutils systemd user |
8 |
|
|
|
9 |
|
|
DESCRIPTION="TLS/SSL - Port Wrapper" |
10 |
|
|
HOMEPAGE="http://stunnel.mirt.net/" |
11 |
|
|
SRC_URI="ftp://ftp.stunnel.org/stunnel/${P}.tar.gz" |
12 |
|
|
|
13 |
|
|
LICENSE="GPL-2" |
14 |
|
|
SLOT="0" |
15 |
ago |
1.10 |
KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 ~s390 sparc x86 ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x86-macos" |
16 |
pacho |
1.1 |
IUSE="ipv6 selinux tcpd xforward listen-queue" |
17 |
|
|
|
18 |
|
|
DEPEND="tcpd? ( sys-apps/tcp-wrappers ) |
19 |
|
|
>=dev-libs/openssl-0.9.8k" |
20 |
|
|
RDEPEND="${DEPEND} |
21 |
|
|
selinux? ( sec-policy/selinux-stunnel )" |
22 |
|
|
|
23 |
|
|
pkg_setup() { |
24 |
|
|
enewgroup stunnel |
25 |
|
|
enewuser stunnel -1 -1 -1 stunnel |
26 |
|
|
} |
27 |
|
|
|
28 |
|
|
src_prepare() { |
29 |
|
|
use xforward && epatch "${FILESDIR}/${P}-xforwarded-for.patch" |
30 |
|
|
use listen-queue && epatch "${FILESDIR}/${P}-listen-queue.patch" |
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_configure() { |
38 |
|
|
econf \ |
39 |
|
|
$(use_enable ipv6) \ |
40 |
|
|
$(use_enable tcpd libwrap) \ |
41 |
|
|
--with-ssl="${EPREFIX}"/usr \ |
42 |
|
|
--disable-fips |
43 |
|
|
} |
44 |
|
|
|
45 |
|
|
src_install() { |
46 |
|
|
emake DESTDIR="${D}" install |
47 |
|
|
rm -rf "${ED}"/usr/share/doc/${PN} |
48 |
|
|
rm -f "${ED}"/etc/stunnel/stunnel.conf-sample "${ED}"/usr/bin/stunnel3 \ |
49 |
|
|
"${ED}"/usr/share/man/man8/stunnel.{fr,pl}.8 |
50 |
|
|
|
51 |
|
|
# The binary was moved to /usr/bin with 4.21, |
52 |
|
|
# symlink for backwards compatibility |
53 |
|
|
dosym ../bin/stunnel /usr/sbin/stunnel |
54 |
|
|
|
55 |
|
|
dodoc AUTHORS BUGS CREDITS PORTS README TODO ChangeLog |
56 |
|
|
dohtml doc/stunnel.html doc/en/VNC_StunnelHOWTO.html tools/ca.html \ |
57 |
|
|
tools/importCA.html |
58 |
|
|
|
59 |
|
|
insinto /etc/stunnel |
60 |
|
|
doins "${FILESDIR}"/stunnel.conf |
61 |
|
|
newinitd "${FILESDIR}"/stunnel.initd-start-stop-daemon stunnel |
62 |
|
|
|
63 |
|
|
systemd_dounit "${S}/tools/stunnel.service" |
64 |
|
|
systemd_newtmpfilesd "${FILESDIR}"/stunnel.tmpfiles.conf stunnel.conf |
65 |
|
|
} |
66 |
|
|
|
67 |
|
|
pkg_postinst() { |
68 |
|
|
if [ ! -f "${EROOT}"/etc/stunnel/stunnel.key ]; then |
69 |
|
|
install_cert /etc/stunnel/stunnel |
70 |
|
|
chown stunnel:stunnel "${EROOT}"/etc/stunnel/stunnel.{crt,csr,key,pem} |
71 |
|
|
chmod 0640 "${EROOT}"/etc/stunnel/stunnel.{crt,csr,key,pem} |
72 |
|
|
fi |
73 |
|
|
|
74 |
|
|
einfo "If you want to run multiple instances of stunnel, create a new config" |
75 |
|
|
einfo "file ending with .conf in /etc/stunnel/. **Make sure** you change " |
76 |
|
|
einfo "\'pid= \' with a unique filename." |
77 |
|
|
} |