summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2020-03-20 16:29:00 +0100
committerDavid Seifert <soap@gentoo.org>2020-03-20 16:29:00 +0100
commit418ec12aa4ce223f7688c215040b6c8544798b63 (patch)
treef1ee001879a7dcb588e2ee312fc9a8320f9a8aed /app-crypt
parentdev-lang/go: remove 1.14 (diff)
downloadgentoo-418ec12aa4ce223f7688c215040b6c8544798b63.tar.gz
gentoo-418ec12aa4ce223f7688c215040b6c8544798b63.tar.bz2
gentoo-418ec12aa4ce223f7688c215040b6c8544798b63.zip
app-crypt/gnupg: Enable SSH_AUTH_SOCK in systemctl --user mode
Package-Manager: Portage-2.3.94, Repoman-2.3.21 Acked-by: Kristian Fiskerstrand <k_f@gentoo.org> Signed-off-by: David Seifert <soap@gentoo.org>
Diffstat (limited to 'app-crypt')
-rw-r--r--app-crypt/gnupg/gnupg-2.2.19.ebuild13
1 files changed, 13 insertions, 0 deletions
diff --git a/app-crypt/gnupg/gnupg-2.2.19.ebuild b/app-crypt/gnupg/gnupg-2.2.19.ebuild
index 0a1d2df46afd..e756ff966ad1 100644
--- a/app-crypt/gnupg/gnupg-2.2.19.ebuild
+++ b/app-crypt/gnupg/gnupg-2.2.19.ebuild
@@ -53,6 +53,19 @@ PATCHES=(
"${FILESDIR}/${PN}-2.1.20-gpgscm-Use-shorter-socket-path-lengts-to-improve-tes.patch"
)
+src_prepare() {
+ default
+
+ # Inject SSH_AUTH_SOCK into user's sessions after enabling gpg-agent-ssh.socket in systemctl --user mode,
+ # idea borrowed from libdbus, see
+ # https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/bus/systemd-user/dbus.socket.in#L6
+ #
+ # This cannot be upstreamed, as it requires determining the exact prefix of 'systemctl',
+ # which in turn requires discovery in Autoconf, something that upstream deeply resents.
+ sed -e "/DirectoryMode=/a ExecStartPost=-${EPREFIX}/bin/systemctl --user set-environment SSH_AUTH_SOCK=%t/gnupg/S.gpg-agent.ssh" \
+ -i doc/examples/systemd-user/gpg-agent-ssh.socket || die
+}
+
src_configure() {
local myconf=()