Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/stunnel/
Date: Sat, 10 Oct 2015 22:01:48
Message-Id: 1444514816.15091012722971c85414b3c246c766e68671cdd9.blueness@gentoo
1 commit: 15091012722971c85414b3c246c766e68671cdd9
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 10 22:06:56 2015 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 10 22:06:56 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=15091012
7
8 net-misc/stunnel: add libressl support
9
10 Package-Manager: portage-2.2.20.1
11
12 net-misc/stunnel/stunnel-5.24-r1.ebuild | 90 +++++++++++++++++++++++++++++++++
13 1 file changed, 90 insertions(+)
14
15 diff --git a/net-misc/stunnel/stunnel-5.24-r1.ebuild b/net-misc/stunnel/stunnel-5.24-r1.ebuild
16 new file mode 100644
17 index 0000000..d75157c
18 --- /dev/null
19 +++ b/net-misc/stunnel/stunnel-5.24-r1.ebuild
20 @@ -0,0 +1,90 @@
21 +# Copyright 1999-2015 Gentoo Foundation
22 +# Distributed under the terms of the GNU General Public License v2
23 +# $Id$
24 +
25 +EAPI="5"
26 +
27 +inherit ssl-cert eutils multilib systemd user
28 +
29 +DESCRIPTION="TLS/SSL - Port Wrapper"
30 +HOMEPAGE="http://www.stunnel.org/index.html"
31 +SRC_URI="ftp://ftp.stunnel.org/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
32 + http://www.usenix.org.uk/mirrors/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
33 + http://ftp.nluug.nl/pub/networking/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
34 + http://www.namesdir.com/mirrors/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
35 + http://stunnel.cybermirror.org/archive/${PV%%.*}.x/${P}.tar.gz
36 + http://mirrors.zerg.biz/stunnel/archive/${PV%%.*}.x/${P}.tar.gz
37 + ftp://mirrors.go-parts.com/stunnel/archive/${PV%%.*}.x/${P}.tar.gz"
38 +
39 +LICENSE="GPL-2"
40 +SLOT="0"
41 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x86-macos"
42 +IUSE="ipv6 libressl selinux stunnel3 tcpd"
43 +
44 +DEPEND="tcpd? ( sys-apps/tcp-wrappers )
45 + !libressl? ( dev-libs/openssl:0 )
46 + libressl? ( dev-libs/libressl )"
47 +RDEPEND="${DEPEND}
48 + stunnel3? ( dev-lang/perl )
49 + selinux? ( sec-policy/selinux-stunnel )"
50 +
51 +RESTRICT="test"
52 +
53 +pkg_setup() {
54 + enewgroup stunnel
55 + enewuser stunnel -1 -1 -1 stunnel
56 +}
57 +
58 +src_prepare() {
59 + # Hack away generation of certificate
60 + sed -i -e "s/^install-data-local:/do-not-run-this:/" \
61 + tools/Makefile.in || die "sed failed"
62 +
63 + echo "CONFIG_PROTECT=\"/etc/stunnel/stunnel.conf\"" > "${T}"/20stunnel
64 +}
65 +
66 +src_configure() {
67 + econf \
68 + --libdir="${EPREFIX}/usr/$(get_libdir)" \
69 + $(use_enable ipv6) \
70 + $(use_enable tcpd libwrap) \
71 + --with-ssl="${EPREFIX}"/usr \
72 + --disable-fips
73 +}
74 +
75 +src_install() {
76 + emake DESTDIR="${D}" install
77 + rm -rf "${ED}"/usr/share/doc/${PN}
78 + rm -f "${ED}"/etc/stunnel/stunnel.conf-sample \
79 + "${ED}"/usr/share/man/man8/stunnel.{fr,pl}.8
80 + use stunnel3 || rm -f "${ED}"/usr/bin/stunnel3
81 +
82 + # The binary was moved to /usr/bin with 4.21,
83 + # symlink for backwards compatibility
84 + dosym ../bin/stunnel /usr/sbin/stunnel
85 +
86 + dodoc AUTHORS BUGS CREDITS PORTS README TODO ChangeLog
87 + dohtml doc/stunnel.html doc/en/VNC_StunnelHOWTO.html tools/ca.html \
88 + tools/importCA.html
89 +
90 + insinto /etc/stunnel
91 + doins "${FILESDIR}"/stunnel.conf
92 + doinitd "${FILESDIR}"/stunnel
93 +
94 + doenvd "${T}"/20stunnel
95 +
96 + systemd_dounit "${S}/tools/stunnel.service"
97 + systemd_newtmpfilesd "${FILESDIR}"/stunnel.tmpfiles.conf stunnel.conf
98 +}
99 +
100 +pkg_postinst() {
101 + if [ ! -f "${EROOT}"/etc/stunnel/stunnel.key ]; then
102 + install_cert /etc/stunnel/stunnel
103 + chown stunnel:stunnel "${EROOT}"/etc/stunnel/stunnel.{crt,csr,key,pem}
104 + chmod 0640 "${EROOT}"/etc/stunnel/stunnel.{crt,csr,key,pem}
105 + fi
106 +
107 + einfo "If you want to run multiple instances of stunnel, create a new config"
108 + einfo "file ending with .conf in /etc/stunnel/. **Make sure** you change "
109 + einfo "\'pid= \' with a unique filename."
110 +}