app-editors/kakoune: drop old 0_pre20160620
[gentoo.git] / net-misc / sslh / sslh-1.18-r2.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 MY_P="${PN}-v${PV}"
7 inherit flag-o-matic systemd toolchain-funcs
8
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"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="amd64 ~arm ~m68k ~mips ~s390 ~sh x86"
16 IUSE="caps systemd tcpd"
17
18 RDEPEND="caps? ( sys-libs/libcap )
19         systemd? ( sys-apps/systemd:= )
20         tcpd? ( sys-apps/tcp-wrappers )
21         >=dev-libs/libconfig-1.5"
22 DEPEND="${RDEPEND}
23         dev-lang/perl"
24
25 RESTRICT="test"
26
27 S=${WORKDIR}/${MY_P}
28
29 PATCHES=(
30         "${FILESDIR}/${PN}-1.18-version-deps.patch"
31         "${FILESDIR}/${PN}-1.18-systemd-generator.patch"
32 )
33
34 src_compile() {
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
39         # to be defined.
40         append-cflags -std=gnu99
41
42         emake \
43                 CC="$(tc-getCC)" \
44                 USELIBCAP=$(usev caps) \
45                 USELIBWRAP=$(usev tcpd) \
46                 USESYSTEMD=$(usev systemd)
47 }
48
49 src_install() {
50         dosbin sslh-{fork,select}
51         dosym sslh-fork /usr/sbin/sslh
52
53         gunzip ${PN}.8.gz
54         doman ${PN}.8
55
56         dodoc ChangeLog README.md
57
58         newinitd "${FILESDIR}"/sslh.init.d-2 sslh
59         newconfd "${FILESDIR}"/sslh.conf.d-2 sslh
60
61         if use systemd; then
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
67         fi
68 }