commit:     6f6d959362debaa25cb7b0247d33acc822d7a0f7
Author:     Brahmajit Das <brahmajit.xyz <AT> gmail <DOT> com>
AuthorDate: Mon Jun 26 10:33:16 2023 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Sun Jul 16 08:03:28 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6f6d9593

net-misc/utelnetd: Fix call to undeclared function getpt

Closes: https://bugs.gentoo.org/897954
Signed-off-by: Brahmajit Das <brahmajit.xyz <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/31613
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 .../files/utelnetd-0.1.11-musl-getgt.patch         | 14 ++++++++
 net-misc/utelnetd/utelnetd-0.1.11-r4.ebuild        | 38 ++++++++++++++++++++++
 2 files changed, 52 insertions(+)

diff --git a/net-misc/utelnetd/files/utelnetd-0.1.11-musl-getgt.patch 
b/net-misc/utelnetd/files/utelnetd-0.1.11-musl-getgt.patch
new file mode 100644
index 000000000000..b011e90807c3
--- /dev/null
+++ b/net-misc/utelnetd/files/utelnetd-0.1.11-musl-getgt.patch
@@ -0,0 +1,14 @@
+Bug: https://bugs.gentoo.org/897954
+--- a/utelnetd.c
++++ b/utelnetd.c
+@@ -73,6 +73,10 @@
+ #define getpt() posix_openpt(O_RDWR|O_NOCTTY)
+ #endif
+ 
++#if !defined(__GLIBC__)
++#define getpt() posix_openpt(O_RDWR)
++#endif
++
+ #ifdef DEBUG
+ #define TELCMDS
+ #define TELOPTS

diff --git a/net-misc/utelnetd/utelnetd-0.1.11-r4.ebuild 
b/net-misc/utelnetd/utelnetd-0.1.11-r4.ebuild
new file mode 100644
index 000000000000..f1f5d885bfca
--- /dev/null
+++ b/net-misc/utelnetd/utelnetd-0.1.11-r4.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Small telnet daemon derived from the Axis tools"
+HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage";
+SRC_URI="mirror://gentoo/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~s390 ~sparc ~x86"
+
+RDEPEND="sys-apps/shadow"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-0.1.11-musl-getgt.patch
+)
+
+src_prepare() {
+       default
+
+       sed -e "/(STRIP)/d" \
+               -e "/^CC/s|=.*|= $(tc-getCC)|" \
+               -e "/fomit-frame-pointer/d" \
+               -i Makefile || die
+
+       append-cppflags -D_GNU_SOURCE #871195
+}
+
+src_install() {
+       dosbin utelnetd
+       einstalldocs
+
+       newinitd "${FILESDIR}"/utelnetd.initd utelnetd
+}

Reply via email to