Gentoo Archives: gentoo-commits

From: Michael Palimaka <kensington@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/sslh/, net-misc/sslh/files/
Date: Wed, 13 Jul 2016 16:59:05
Message-Id: 1468429126.f51fc3240bc6f1f37736ece7f8ecfc5a242e7712.kensington@gentoo
1 commit: f51fc3240bc6f1f37736ece7f8ecfc5a242e7712
2 Author: Craig Andrews <candrews <AT> integralblue <DOT> com>
3 AuthorDate: Fri Jun 24 22:24:34 2016 +0000
4 Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org>
5 CommitDate: Wed Jul 13 16:58:46 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f51fc324
7
8 net-misc/sslh: revision bump adding systemd support
9
10 This new revision builds the systemd generator and installs the systemd service.
11
12 It also renames OPTIONS to DAEMON_OPTS in the sslh conf.d file for compatibility
13 with the systemd service which sources it.
14
15 Gentoo-bug: 563600
16
17 .../sslh/files/sslh-1.18-systemd-generator.patch | 26 ++++++++++
18 net-misc/sslh/files/sslh-1.18-version-deps.patch | 13 +++++
19 net-misc/sslh/files/sslh.conf.d-2 | 4 +-
20 net-misc/sslh/files/sslh.init.d-2 | 2 +-
21 net-misc/sslh/sslh-1.18-r1.ebuild | 60 ++++++++++++++++++++++
22 5 files changed, 102 insertions(+), 3 deletions(-)
23
24 diff --git a/net-misc/sslh/files/sslh-1.18-systemd-generator.patch b/net-misc/sslh/files/sslh-1.18-systemd-generator.patch
25 new file mode 100644
26 index 0000000..476de2a
27 --- /dev/null
28 +++ b/net-misc/sslh/files/sslh-1.18-systemd-generator.patch
29 @@ -0,0 +1,26 @@
30 +https://patch-diff.githubusercontent.com/raw/yrutschle/sslh/pull/98
31 +--- a/Makefile
32 ++++ b/Makefile
33 +@@ -27,6 +27,8 @@ CFLAGS ?=-Wall -g $(CFLAGS_COV)
34 + LIBS=
35 + OBJS=common.o sslh-main.o probe.o tls.o
36 +
37 ++CONDITIONAL_TARGETS=
38 ++
39 + ifneq ($(strip $(USELIBWRAP)),)
40 + LIBS:=$(LIBS) -lwrap
41 + CPPFLAGS+=-DLIBWRAP
42 +@@ -54,10 +56,11 @@ endif
43 + ifneq ($(strip $(USESYSTEMD)),)
44 + LIBS:=$(LIBS) -lsystemd
45 + CPPFLAGS+=-DSYSTEMD
46 ++ CONDITIONAL_TARGETS+=systemd-sslh-generator
47 + endif
48 +
49 +
50 +-all: sslh $(MAN) echosrv
51 ++all: sslh $(MAN) echosrv $(CONDITIONAL_TARGETS)
52 +
53 + .c.o: *.h
54 + $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
55 +
56
57 diff --git a/net-misc/sslh/files/sslh-1.18-version-deps.patch b/net-misc/sslh/files/sslh-1.18-version-deps.patch
58 new file mode 100644
59 index 0000000..aa02871
60 --- /dev/null
61 +++ b/net-misc/sslh/files/sslh-1.18-version-deps.patch
62 @@ -0,0 +1,13 @@
63 +make sure the files using version.h depend on it being generated first
64 +
65 +--- a/Makefile
66 ++++ b/Makefile
67 +@@ -78,7 +78,7 @@
68 + systemd-sslh-generator: systemd-sslh-generator.o
69 + $(CC) $(CFLAGS) $(LDFLAGS) -o systemd-sslh-generator systemd-sslh-generator.o -lconfig
70 +
71 +-echosrv: $(OBJS) echosrv.o
72 ++echosrv: version.h $(OBJS) echosrv.o
73 + $(CC) $(CFLAGS) $(LDFLAGS) -o echosrv echosrv.o probe.o common.o tls.o $(LIBS)
74 +
75 + $(MAN): sslh.pod Makefile
76
77 diff --git a/net-misc/sslh/files/sslh.conf.d-2 b/net-misc/sslh/files/sslh.conf.d-2
78 index 719be7b..73d08d5 100644
79 --- a/net-misc/sslh/files/sslh.conf.d-2
80 +++ b/net-misc/sslh/files/sslh.conf.d-2
81 @@ -1,8 +1,8 @@
82 # /etc/conf.d/sslh
83
84 # Options to sslh itself. See the sslh(1) man page.
85 -#OPTIONS=""
86 +#DAEMON_OPTS=""
87
88 # Multiplexing example
89 # Port 44 can be used for ssh, http, and https. Drop privileges after starting.
90 -#OPTIONS="-p localhost:44 --ssh 127.0.0.1:22 --http 127.0.0.1:80 --ssl 127.0.0.1:443 --user nobody"
91 +#DAEMON_OPTS="-p localhost:44 --ssh 127.0.0.1:22 --http 127.0.0.1:80 --ssl 127.0.0.1:443 --user nobody"
92
93 diff --git a/net-misc/sslh/files/sslh.init.d-2 b/net-misc/sslh/files/sslh.init.d-2
94 index 0351f7c..b75e96f 100644
95 --- a/net-misc/sslh/files/sslh.init.d-2
96 +++ b/net-misc/sslh/files/sslh.init.d-2
97 @@ -8,7 +8,7 @@ start() {
98 start-stop-daemon --start \
99 --pidfile /var/run/${SVCNAME}.pid \
100 --exec /usr/sbin/sslh -- \
101 - ${OPTIONS} \
102 + ${DAEMON_OPTS} \
103 --pidfile /var/run/${SVCNAME}.pid
104 eend $?
105 }
106
107 diff --git a/net-misc/sslh/sslh-1.18-r1.ebuild b/net-misc/sslh/sslh-1.18-r1.ebuild
108 new file mode 100644
109 index 0000000..1059a96
110 --- /dev/null
111 +++ b/net-misc/sslh/sslh-1.18-r1.ebuild
112 @@ -0,0 +1,60 @@
113 +# Copyright 1999-2016 Gentoo Foundation
114 +# Distributed under the terms of the GNU General Public License v2
115 +# $Id$
116 +
117 +EAPI=6
118 +
119 +MY_P="${PN}-v${PV}"
120 +inherit systemd toolchain-funcs
121 +
122 +DESCRIPTION="Port multiplexer - accept both HTTPS and SSH connections on the same port"
123 +HOMEPAGE="http://www.rutschle.net/tech/sslh.shtml"
124 +SRC_URI="http://www.rutschle.net/tech/${PN}/${MY_P}.tar.gz"
125 +
126 +LICENSE="GPL-2"
127 +SLOT="0"
128 +KEYWORDS="~amd64 ~arm ~m68k ~mips ~s390 ~sh ~x86"
129 +IUSE="caps systemd tcpd"
130 +
131 +RDEPEND="caps? ( sys-libs/libcap )
132 + systemd? ( sys-apps/systemd:= )
133 + tcpd? ( sys-apps/tcp-wrappers )
134 + dev-libs/libconfig"
135 +DEPEND="${RDEPEND}
136 + dev-lang/perl"
137 +
138 +RESTRICT="test"
139 +
140 +S=${WORKDIR}/${MY_P}
141 +
142 +PATCHES=(
143 + "${FILESDIR}/${PN}-1.17-version-deps.patch"
144 + "${FILESDIR}/${PN}-1.18-version-deps.patch"
145 + "${FILESDIR}/${PN}-1.18-systemd-generator.patch"
146 +)
147 +
148 +src_compile() {
149 + emake \
150 + CC="$(tc-getCC)" \
151 + USELIBCAP=$(usev caps) \
152 + USELIBWRAP=$(usev tcpd) \
153 + USESYSTEMD=$(usev systemd)
154 +}
155 +
156 +src_install() {
157 + dosbin sslh-{fork,select}
158 + dosym sslh-fork /usr/sbin/sslh
159 + doman sslh.8.gz
160 + dodoc ChangeLog README.md
161 +
162 + newinitd "${FILESDIR}"/sslh.init.d-2 sslh
163 + newconfd "${FILESDIR}"/sslh.conf.d-2 sslh
164 +
165 + if use systemd; then
166 + # Gentoo puts the binaries in /usr/sbin, but upstream puts them in /usr/bin
167 + sed -i -e 's~/usr/bin/~/usr/sbin/~g' scripts/systemd.sslh.service || die
168 + systemd_newunit scripts/systemd.sslh.service sslh.service
169 + exeinto /usr/lib/systemd/system-generators/
170 + doexe systemd-sslh-generator
171 + fi
172 +}