3 |
3 |
|
4 |
4 |
EAPI=8
|
5 |
5 |
|
6 |
|
inherit ssl-cert systemd tmpfiles
|
|
6 |
PYTHON_COMPAT=( python3_{10..12} )
|
|
7 |
inherit autotools python-any-r1 ssl-cert systemd tmpfiles
|
7 |
8 |
|
8 |
9 |
DESCRIPTION="TLS/SSL - Port Wrapper"
|
9 |
10 |
HOMEPAGE="https://www.stunnel.org/index.html"
|
... | ... | |
20 |
21 |
|
21 |
22 |
LICENSE="GPL-2"
|
22 |
23 |
SLOT="0"
|
23 |
|
KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
|
24 |
|
IUSE="selinux stunnel3 tcpd"
|
|
24 |
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
|
|
25 |
IUSE="selinux stunnel3 systemd tcpd test"
|
|
26 |
RESTRICT="!test? ( test )"
|
25 |
27 |
|
26 |
28 |
DEPEND="
|
27 |
|
dev-libs/openssl:0=
|
|
29 |
dev-libs/openssl:=
|
28 |
30 |
tcpd? ( sys-apps/tcp-wrappers )
|
|
31 |
systemd? ( sys-apps/systemd:= )
|
29 |
32 |
"
|
30 |
|
|
31 |
33 |
RDEPEND="
|
|
34 |
${DEPEND}
|
32 |
35 |
acct-user/stunnel
|
33 |
36 |
acct-group/stunnel
|
34 |
|
${DEPEND}
|
35 |
37 |
selinux? ( sec-policy/selinux-stunnel )
|
36 |
38 |
stunnel3? ( dev-lang/perl )
|
37 |
39 |
"
|
|
40 |
# autoconf-archive for F_S patch
|
|
41 |
BDEPEND="
|
|
42 |
sys-devel/autoconf-archive
|
|
43 |
test? ( ${PYTHON_DEPS} )
|
|
44 |
"
|
|
45 |
|
|
46 |
PATCHES=(
|
|
47 |
"${FILESDIR}"/${PN}-5.71-dont-clobber-fortify-source.patch
|
|
48 |
"${FILESDIR}"/${PN}-5.71-respect-EPYTHON-for-tests.patch
|
|
49 |
)
|
38 |
50 |
|
39 |
|
RESTRICT="test"
|
|
51 |
pkg_setup() {
|
|
52 |
use test && python-any-r1_pkg_setup
|
|
53 |
}
|
40 |
54 |
|
41 |
55 |
src_prepare() {
|
|
56 |
default
|
|
57 |
|
42 |
58 |
# Hack away generation of certificate
|
43 |
59 |
sed -i -e "s/^install-data-local:/do-not-run-this:/" \
|
44 |
|
tools/Makefile.in || die "sed failed"
|
|
60 |
tools/Makefile.am || die "sed failed"
|
|
61 |
|
|
62 |
echo "CONFIG_PROTECT=\"/etc/stunnel/stunnel.conf\"" > "${T}"/20stunnel || die
|
45 |
63 |
|
46 |
|
echo "CONFIG_PROTECT=\"/etc/stunnel/stunnel.conf\"" > "${T}"/20stunnel
|
|
64 |
# We pass --disable-fips to configure, so avoid spurious test failures
|
|
65 |
rm tests/plugins/p10_fips.py tests/plugins/p11_fips_cipher.py || die
|
47 |
66 |
|
48 |
|
eapply_user
|
|
67 |
# Needed for FORTIFY_SOURCE patch
|
|
68 |
eautoreconf
|
49 |
69 |
}
|
50 |
70 |
|
51 |
71 |
src_configure() {
|
52 |
72 |
local myeconfargs=(
|
53 |
73 |
--libdir="${EPREFIX}/usr/$(get_libdir)"
|
54 |
|
$(use_enable tcpd libwrap)
|
55 |
74 |
--with-ssl="${EPREFIX}"/usr
|
56 |
75 |
--disable-fips
|
|
76 |
$(use_enable tcpd libwrap)
|
|
77 |
$(use_enable systemd)
|
57 |
78 |
)
|
58 |
79 |
|
59 |
80 |
econf "${myeconfargs[@]}"
|
... | ... | |
61 |
82 |
|
62 |
83 |
src_install() {
|
63 |
84 |
emake DESTDIR="${D}" install
|
64 |
|
rm -rf "${ED}"/usr/share/doc/${PN}
|
|
85 |
|
|
86 |
rm -rf "${ED}"/usr/share/doc/${PN} || die
|
65 |
87 |
rm -f "${ED}"/etc/stunnel/stunnel.conf-sample \
|
66 |
|
"${ED}"/usr/share/man/man8/stunnel.{fr,pl}.8
|
67 |
|
use stunnel3 || rm -f "${ED}"/usr/bin/stunnel3
|
|
88 |
"${ED}"/usr/share/man/man8/stunnel.{fr,pl}.8 || die
|
|
89 |
|
|
90 |
if ! use stunnel3 ; then
|
|
91 |
rm -f "${ED}"/usr/bin/stunnel3 || die
|
|
92 |
fi
|
68 |
93 |
|
69 |
94 |
dodoc AUTHORS.md BUGS.md CREDITS.md PORTS.md README.md TODO.md
|
70 |
95 |
docinto html
|
... | ... | |
84 |
109 |
}
|
85 |
110 |
|
86 |
111 |
pkg_postinst() {
|
87 |
|
if [ ! -f "${EROOT}"/etc/stunnel/stunnel.key ]; then
|
|
112 |
if [[ ! -f "${EROOT}"/etc/stunnel/stunnel.key ]]; then
|
88 |
113 |
install_cert /etc/stunnel/stunnel
|
89 |
114 |
chown stunnel:stunnel "${EROOT}"/etc/stunnel/stunnel.{crt,csr,key,pem}
|
90 |
115 |
chmod 0640 "${EROOT}"/etc/stunnel/stunnel.{crt,csr,key,pem}
|