1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit flag-o-matic systemd toolchain-funcs
9 DESCRIPTION="Port multiplexer - accept both HTTPS and SSH connections on the same port"
10 HOMEPAGE="http://www.rutschle.net/tech/sslh.shtml"
11 SRC_URI="http://www.rutschle.net/tech/${PN}/${MY_P}.tar.gz"
15 KEYWORDS="amd64 ~arm ~m68k ~mips ~s390 ~sh x86"
16 IUSE="caps systemd tcpd"
18 RDEPEND="caps? ( sys-libs/libcap )
19 systemd? ( sys-apps/systemd:= )
20 tcpd? ( sys-apps/tcp-wrappers )
21 >=dev-libs/libconfig-1.5"
30 "${FILESDIR}/${PN}-1.18-version-deps.patch"
31 "${FILESDIR}/${PN}-1.18-systemd-generator.patch"
35 # On older versions of GCC, the default gnu89 variant
36 # will reject within-for-loop initializers, bug #595426
37 # Furthermore, we need to use the gnu variant (gnu99) instead
38 # of the ISO (c99) variant, as we want the __USE_XOPEN2K macro
40 append-cflags -std=gnu99
44 USELIBCAP=$(usev caps) \
45 USELIBWRAP=$(usev tcpd) \
46 USESYSTEMD=$(usev systemd)
50 dosbin sslh-{fork,select}
51 dosym sslh-fork /usr/sbin/sslh
56 dodoc ChangeLog README.md
58 newinitd "${FILESDIR}"/sslh.init.d-2 sslh
59 newconfd "${FILESDIR}"/sslh.conf.d-2 sslh
62 # Gentoo puts the binaries in /usr/sbin, but upstream puts them in /usr/bin
63 sed -i -e 's~/usr/bin/~/usr/sbin/~g' scripts/systemd.sslh.service || die
64 systemd_newunit scripts/systemd.sslh.service sslh.service
65 exeinto /usr/lib/systemd/system-generators/
66 doexe systemd-sslh-generator