summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrahmajit Das <brahmajit.xyz@gmail.com>2023-05-31 13:35:43 +0000
committerSam James <sam@gentoo.org>2023-07-23 02:54:59 +0100
commit1a1fa5706559e41c9fce366a69291e7cbc7b86c3 (patch)
tree08e2c16b16ec1c7581af58b4a1f8778be9ac0be2 /net-nds/gssproxy
parentsys-fs/dd-rescue: Fix building for musl. (diff)
downloadgentoo-1a1fa5706559e41c9fce366a69291e7cbc7b86c3.tar.gz
gentoo-1a1fa5706559e41c9fce366a69291e7cbc7b86c3.tar.bz2
gentoo-1a1fa5706559e41c9fce366a69291e7cbc7b86c3.zip
net-nds/gssproxy: Fix build with musl llvm
Upstream-Commit: https://github.com/gssapi/gssproxy/commit/f6ab3193e64ecc9db4d253b6dd99991f461b6081 Closes: https://bugs.gentoo.org/898064 Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/31238 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-nds/gssproxy')
-rw-r--r--net-nds/gssproxy/files/gssproxy-0.9.1-fix-musl-llvm16-build.patch30
-rw-r--r--net-nds/gssproxy/gssproxy-0.9.1-r1.ebuild102
2 files changed, 132 insertions, 0 deletions
diff --git a/net-nds/gssproxy/files/gssproxy-0.9.1-fix-musl-llvm16-build.patch b/net-nds/gssproxy/files/gssproxy-0.9.1-fix-musl-llvm16-build.patch
new file mode 100644
index 000000000000..ac8c35c565ec
--- /dev/null
+++ b/net-nds/gssproxy/files/gssproxy-0.9.1-fix-musl-llvm16-build.patch
@@ -0,0 +1,30 @@
+https://github.com/gssapi/gssproxy/commit/f6ab3193e64ecc9db4d253b6dd99991f461b6081
+From: Brahmajit Das <brahmajit.xyz@gmail.com>
+Date: Wed, 31 May 2023 04:53:23 +0000
+Subject: [PATCH] Fix build with musl and llvm
+
+Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
+--- a/src/gp_util.c
++++ b/src/gp_util.c
+@@ -63,7 +63,7 @@ char *gp_strerror(int errnum)
+ static __thread char buf[MAX_GP_STRERROR];
+ int saved_errno = errno;
+
+-#if ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE)
++#if ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE) || !defined(__GLIBC__)
+ /* XSI version */
+ int ret;
+
+--- a/tests/userproxytest.c
++++ b/tests/userproxytest.c
+@@ -5,6 +5,7 @@
+ #include <stdbool.h>
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
+ #include <sys/wait.h>
+--
+2.40.1
+
diff --git a/net-nds/gssproxy/gssproxy-0.9.1-r1.ebuild b/net-nds/gssproxy/gssproxy-0.9.1-r1.ebuild
new file mode 100644
index 000000000000..2b819259be0a
--- /dev/null
+++ b/net-nds/gssproxy/gssproxy-0.9.1-r1.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Daemon to proxy GSSAPI context establishment and channel handling"
+HOMEPAGE="https://github.com/gssapi/gssproxy"
+SRC_URI="https://github.com/gssapi/${PN}/releases/download/v${PV}/${P}.tar.gz"
+
+LICENSE="BSD-1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+IUSE="debug selinux systemd"
+
+COMMON_DEPEND=">=dev-libs/libverto-0.2.2
+ >=dev-libs/ding-libs-0.6.1
+ virtual/krb5
+ selinux? ( sys-libs/libselinux )"
+RDEPEND="${COMMON_DEPEND}
+ selinux? ( sec-policy/selinux-gssproxy )"
+# We need xml stuff to build the man pages, and people really want/need
+# the man pages for this package :). #585200
+BDEPEND="
+ app-text/docbook-xml-dtd:4.4
+ dev-libs/libxslt
+ virtual/pkgconfig
+"
+
+# Many requirements to run tests, including running slapd as root, hence
+# unfeasible.
+RESTRICT="test"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.9.1-fix-musl-llvm16-build.patch
+)
+
+# pkg_setup() {
+# # Here instead of flag-logic in DEPEND, since virtual/krb5 does not
+# # allow to specify the openldap use flag, which heimdal doesn't
+# # support.
+# # Using mit-krb5 explicitly because heimdal doesn't install kerberos
+# # schemata required for the tests of gss-proxy.
+# if use test && ! has_version "app-crypt/mit-krb5[openldap]"; then
+# eerror "Tests of this package require the kerberos schemata installed from app-crypt/mit-krb5[openldap]."
+# die "Tests enabled but no app-crypt/mit-krb5[openldap] being installed."
+# fi
+# }
+
+# Was required in 0.7.0 to fix the schema- and slapd-path. Reason for
+# comment: see RESTRICT comment
+# src_prepare() {
+# default
+# # The tests look for kerberos schemata in the documentation
+# # directory of krb5, however these are installed in /etc/openldap
+# # and only if the openldap useflag is supplied
+# sed -i \
+# -e 's#/usr/share/doc/krb5-server-ldap*#/etc/openldap/schema#' \
+# -e "s#\(subprocess.Popen..\"\)slapd#\1/usr/$(get_libdir)/openldap/slapd#" \
+# "${S}/tests/testlib.py" || die
+# }
+
+src_configure() {
+ local myeconfargs=(
+ # The build assumes localstatedir is /var and takes care of
+ # using all the right subdirs itself.
+ --localstatedir="${EPREFIX}"/var
+
+ --with-os=gentoo
+ --with-initscript=$(usex systemd systemd none)
+ $(use_with selinux)
+ $(use_with debug gssidebug)
+
+ # We already set FORTIFY_SOURCE by default along with the
+ # other bits. But setting it on each compile line interferes
+ # with efforts to try e.g. FORTIFY_SOURCE=3. So, disable it,
+ # but there's no actual difference to the safety of the binaries
+ # because of Gentoo's configuration/patches to the toolchain.
+ --without-hardening
+ )
+
+ econf "${myeconfargs[@]}"
+}
+
+src_install() {
+ default
+
+ # This is a plugin module, so no need for la file.
+ find "${ED}"/usr -name proxymech.la -delete || die
+
+ doinitd "${FILESDIR}"/gssproxy
+ insinto /etc/gssproxy
+ doins examples/*.conf
+
+ keepdir /var/lib/gssproxy
+ keepdir /var/lib/gssproxy/clients
+ keepdir /var/lib/gssproxy/rcache
+ fperms 0700 /var/lib/gssproxy/clients
+ fperms 0700 /var/lib/gssproxy/rcache
+
+ # The build installs a bunch of empty dirs, so prune them.
+ find "${ED}" -depth -type d -empty -delete || die
+}