From 14f22312d9b1dd77a380a3ef98a41d10e990f2b6 Mon Sep 17 00:00:00 2001 From: Sam James Date: Tue, 14 Jun 2022 15:10:52 +0100 Subject: [PATCH] app-admin/authbind: don't call LD directly Bug: https://bugs.gentoo.org/828856 Signed-off-by: Sam James --- app-admin/authbind/authbind-2.1.2-r1.ebuild | 54 +++++++++++++++++++ .../files/authbind-2.1.2-no-use-ld.patch | 12 +++++ 2 files changed, 66 insertions(+) create mode 100644 app-admin/authbind/authbind-2.1.2-r1.ebuild create mode 100644 app-admin/authbind/files/authbind-2.1.2-no-use-ld.patch diff --git a/app-admin/authbind/authbind-2.1.2-r1.ebuild b/app-admin/authbind/authbind-2.1.2-r1.ebuild new file mode 100644 index 0000000000000..37ededba60f35 --- /dev/null +++ b/app-admin/authbind/authbind-2.1.2-r1.ebuild @@ -0,0 +1,54 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit toolchain-funcs + +DESCRIPTION="Bind sockets to privileged ports without root" +HOMEPAGE="https://www.chiark.greenend.org.uk/ucgi/~ian/git/authbind.git/" +SRC_URI="mirror://debian/pool/main/${PN:0:1}/${PN}/${PN}_${PV}.tar.gz" +S="${WORKDIR}/${PN}" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64" + +BDEPEND="virtual/awk" + +PATCHES=( + "${FILESDIR}/${PN}-2.1.2-respect-flags.patch" + "${FILESDIR}/${PN}-2.1.2-no-use-ld.patch" +) + +src_configure() { + tc-export CC + + sed -i \ + -e "s|^prefix=.*|prefix=/usr|" \ + -e "s|^lib_dir=.*|lib_dir=\$(prefix)/$(get_libdir)|" \ + -e "s|^libexec_dir=.*|libexec_dir=\$(prefix)/libexec/authbind|" \ + -e "s|^SHARED_LDFLAGS=.*|SHARED_LDFLAGS=${LDFLAGS}|" \ + Makefile || die "sed failed" + + sed -i \ + -e 's|/usr/lib|/usr/libexec|' \ + authbind-helper.8 || die "sed failed" +} + +src_install() { + dobin authbind + doman authbind.1 authbind-helper.8 + + local major=$(awk -F= '/MAJOR=/ { print $2 }' Makefile || die) + ln -s libauthbind.so.* libauthbind.so.${major} || die + dolib.so libauthbind.so* + + exeinto /usr/libexec/authbind + exeopts -m4755 + doexe helper + + keepdir /etc/authbind/by{addr,port,uid} + + dodoc debian/changelog +} diff --git a/app-admin/authbind/files/authbind-2.1.2-no-use-ld.patch b/app-admin/authbind/files/authbind-2.1.2-no-use-ld.patch new file mode 100644 index 0000000000000..e9c26d92e6c19 --- /dev/null +++ b/app-admin/authbind/files/authbind-2.1.2-no-use-ld.patch @@ -0,0 +1,12 @@ +https://bugs.gentoo.org/828856 +--- a/Makefile ++++ b/Makefile +@@ -81,7 +81,7 @@ helper: helper.o + helper.o authbind.o: authbind.h + + $(LIBTARGET): libauthbind.o +- $(LD) $(SHARED_LDFLAGS) -shared -soname $(LIBCANON) -o $@ $< $(LIBS) ++ $(CC) $(SHARED_LDFLAGS) -nostartfiles -Wl,-soname $(LIBCANON) -o $@ $< $(LIBS) + + clean distclean: + rm -f $(TARGETS) *.o *~ ./#*# *.bak *.new core -- 2.35.1