diff options
author | Craig Andrews <candrews@gentoo.org> | 2021-08-15 23:39:37 -0400 |
---|---|---|
committer | Craig Andrews <candrews@gentoo.org> | 2021-08-15 23:40:42 -0400 |
commit | 8361d101844ec8f2587f43590d7ca7c569e728e3 (patch) | |
tree | 90221e8b0e1fe22c650e37150ae86f9f880e81bb /net-misc/sslh | |
parent | dev-libs/yaz: add github upstream metadata (diff) | |
download | gentoo-8361d101844ec8f2587f43590d7ca7c569e728e3.tar.gz gentoo-8361d101844ec8f2587f43590d7ca7c569e728e3.tar.bz2 gentoo-8361d101844ec8f2587f43590d7ca7c569e728e3.zip |
net-misc/sslh: libconfig 1.7.3 compatibility
Closes: https://bugs.gentoo.org/808525
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Craig Andrews <candrews@gentoo.org>
Diffstat (limited to 'net-misc/sslh')
-rw-r--r-- | net-misc/sslh/files/sslh-1.21c-libconfig-1.7.3.patch | 92 | ||||
-rw-r--r-- | net-misc/sslh/sslh-1.21c-r3.ebuild | 77 |
2 files changed, 169 insertions, 0 deletions
diff --git a/net-misc/sslh/files/sslh-1.21c-libconfig-1.7.3.patch b/net-misc/sslh/files/sslh-1.21c-libconfig-1.7.3.patch new file mode 100644 index 000000000000..ea2a625a1850 --- /dev/null +++ b/net-misc/sslh/files/sslh-1.21c-libconfig-1.7.3.patch @@ -0,0 +1,92 @@ +From 24e7f46a431b59043bf534eb7cdab76c4ffd595a Mon Sep 17 00:00:00 2001 +From: yrutschle <git1@rutschle.net> +Date: Wed, 23 Jun 2021 11:48:59 +0200 +Subject: [PATCH] fix for libconfig 1.7.3 (#292) + +--- + sslh-conf.c | 50 +++++++++++++++++++++++++++++++++++++++++++------- + 1 file changed, 88 insertions(+), 16 deletions(-) + +diff --git a/sslh-conf.c b/sslh-conf.c +index 5f55656..530ef6b 100644 +--- a/sslh-conf.c ++++ b/sslh-conf.c +@@ -126,6 +126,14 @@ typedef int config_t; + return 0; \ + } + ++enum { ++ CONFIG_TYPE_INT, ++ CONFIG_TYPE_BOOL, ++ CONFIG_TYPE_INT64, ++ CONFIG_TYPE_FLOAT, ++ CONFIG_TYPE_STRING ++}; ++ + make_config_setting_lookup(bool); + make_config_setting_lookup(int); + make_config_setting_lookup(int64); +@@ -134,10 +142,14 @@ make_config_setting_lookup(string); + + make_config_setting_get(bool, int); + make_config_setting_get(int, int); +-make_config_setting_get(int64, int); ++make_config_setting_get(int64, long long int); + make_config_setting_get(float, double); + make_config_setting_get(string, char*); + ++config_setting_t* config_root_setting(config_t* c) { ++ return NULL; ++} ++ + config_setting_t* config_lookup(config_t* c, const char* b) { + return NULL; + } +@@ -146,10 +158,38 @@ void config_init(config_t* c) { + return; + } + ++char* config_setting_name(config_setting_t* c) { ++ return NULL; ++} ++ ++int config_setting_is_list(config_setting_t* c) { ++ return 0; ++} ++ ++int config_setting_is_array(config_setting_t* c) { ++ return 0; ++} ++ ++int config_setting_is_scalar(config_setting_t* c) { ++ return 0; ++} ++ ++int config_setting_index(const config_setting_t *setting) { ++ return 0; ++} ++ + config_setting_t* config_setting_lookup(config_setting_t* a, char* b) { + return NULL; + } + ++int config_setting_remove(config_setting_t* cfg, char* name) { ++ return 0; ++} ++ ++int config_setting_type(config_setting_t* s) { ++ return -1; ++} ++ + int config_setting_length(config_setting_t* a) { + return 0; + } +@@ -1792,7 +1832,7 @@ int sslhcfg_cl_parse(int argc, char* argv[], struct sslhcfg_item* cfg) + } + } + +- s = config_lookup(&c, "/"); ++ s = config_root_setting(&c); + + res = read_block(s, cfg, table_sslhcfg, &errmsg); + if (!res) { diff --git a/net-misc/sslh/sslh-1.21c-r3.ebuild b/net-misc/sslh/sslh-1.21c-r3.ebuild new file mode 100644 index 000000000000..e062ddf36cad --- /dev/null +++ b/net-misc/sslh/sslh-1.21c-r3.ebuild @@ -0,0 +1,77 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" + +inherit flag-o-matic systemd toolchain-funcs + +DESCRIPTION="Port multiplexer - accept both HTTPS and SSH connections on the same port" +HOMEPAGE="https://www.rutschle.net/tech/sslh/README.html" +if [[ ${PV} == "9999" ]] ; then + EGIT_REPO_URI="https://github.com/yrutschle/sslh.git" + inherit git-r3 +else + KEYWORDS="~amd64 ~arm ~m68k ~mips ~s390 ~x86" + SRC_URI="https://github.com/yrutschle/sslh/archive/v${PV}.tar.gz -> ${P}.tar.gz" + S=${WORKDIR}/${P} +fi + +LICENSE="GPL-2" +SLOT="0" +IUSE="caps pcre systemd tcpd" + +RDEPEND="caps? ( sys-libs/libcap ) + pcre? ( dev-libs/libpcre:= ) + systemd? ( sys-apps/systemd:= ) + tcpd? ( sys-apps/tcp-wrappers ) + >=dev-libs/libconfig-1.5:=" +DEPEND="${RDEPEND} + dev-lang/perl" +PATCHES=( + "${FILESDIR}/${P}-libconfig-1.7.3.patch" +) +RESTRICT="test" + +src_prepare() { + default + sed -i \ + -e '/MAN/s:| gzip -9 - >:>:' \ + -e '/MAN=sslh.8.gz/s:.gz::' \ + Makefile || die +} + +src_compile() { + # On older versions of GCC, the default gnu89 variant + # will reject within-for-loop initializers, bug #595426 + # Furthermore, we need to use the gnu variant (gnu99) instead + # of the ISO (c99) variant, as we want the __USE_XOPEN2K macro + # to be defined. + append-cflags -std=gnu99 + + emake \ + CC="$(tc-getCC)" \ + USELIBPCRE=$(usev pcre) \ + USELIBCAP=$(usev caps) \ + USELIBWRAP=$(usev tcpd) \ + USESYSTEMD=$(usev systemd) +} + +src_install() { + dosbin sslh-{fork,select} + dosym sslh-fork /usr/sbin/sslh + + doman ${PN}.8 + + dodoc ChangeLog README.md + + newinitd "${FILESDIR}"/sslh.init.d-3 sslh + newconfd "${FILESDIR}"/sslh.conf.d-2 sslh + + if use systemd; then + # Gentoo puts the binaries in /usr/sbin, but upstream puts them in /usr/bin + sed -i -e 's~/usr/bin/~/usr/sbin/~g' scripts/systemd.sslh.service || die + systemd_newunit scripts/systemd.sslh.service sslh.service + exeinto /usr/lib/systemd/system-generators/ + doexe systemd-sslh-generator + fi +} |