aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorknuxify <knuxify@gmail.com>2024-04-10 20:34:49 +0200
committerKevin Daudt <kdaudt@alpinelinux.org>2024-05-11 07:55:28 +0000
commit27deb9d17257373b527d1d9b3e17b45d841bdded (patch)
tree449b50ef038e50ed53ac9dfdf7b68684db7b9111
parent81f87257e1c43210c7ed26eb12b891203d3dabf5 (diff)
community/gcr4: add gcr-ssh-agent and autostart wrapper
This adds a new subpackage, gcr-ssh-agent, which replaces the old gcr-ssh-agent subpackage from community/gcr. It also adds three files used for autostart: - /etc/xdg/autostart/gcr-ssh-agent.desktop - the autostart .desktop file, points to the wrapper. - /usr/libexec/gcr-ssh-agent-wrapper - wrapper that automatically sets up the basedir for the current user ID. - /etc/profile.d/30-gcr-ssh-agent.sh - sets up SSH_AUTH_SOCK variable (used by apps to figure out which SSH agent to use). Lastly, it drops gcr-ssh-agent from the required dependencies of the gcr package. This is to make sure that it is only installed when directly requested by the user. Fixes #15965.
-rw-r--r--community/gcr4/30-gcr-ssh-agent.sh4
-rw-r--r--community/gcr4/APKBUILD27
-rwxr-xr-xcommunity/gcr4/gcr-ssh-agent-wrapper14
-rw-r--r--community/gcr4/gcr-ssh-agent.desktop6
4 files changed, 47 insertions, 4 deletions
diff --git a/community/gcr4/30-gcr-ssh-agent.sh b/community/gcr4/30-gcr-ssh-agent.sh
new file mode 100644
index 00000000000..c25031e5a97
--- /dev/null
+++ b/community/gcr4/30-gcr-ssh-agent.sh
@@ -0,0 +1,4 @@
+# Set SSH_AUTH_SOCK for gcr-ssh-agent.
+if [ ! "$SSH_AUTH_SOCK" ]; then
+ export SSH_AUTH_SOCK="/run/user/$(id -u)/gcr/ssh"
+fi
diff --git a/community/gcr4/APKBUILD b/community/gcr4/APKBUILD
index 32315bd57f8..407c5d0a8ca 100644
--- a/community/gcr4/APKBUILD
+++ b/community/gcr4/APKBUILD
@@ -30,8 +30,12 @@ subpackages="
$pkgname-dev
$pkgname-lang
$pkgname-base
+ gcr-ssh-agent:ssh
"
-source="https://download.gnome.org/sources/gcr/${pkgver%.*}/gcr-$pkgver.tar.xz"
+source="https://download.gnome.org/sources/gcr/${pkgver%.*}/gcr-$pkgver.tar.xz
+ gcr-ssh-agent-wrapper
+ gcr-ssh-agent.desktop
+ 30-gcr-ssh-agent.sh"
builddir="$srcdir/gcr-$pkgver"
options="!check" # fix later after p11-kit fixes
@@ -53,10 +57,7 @@ check() {
}
package() {
- depends="gcr-ssh-agent"
DESTDIR="$pkgdir" meson install --no-rebuild -C output
-
- rm "$pkgdir"/usr/libexec/gcr-ssh-agent
}
base() {
@@ -66,6 +67,24 @@ base() {
amove usr/lib
}
+ssh() {
+ pkgdesc="$pkgdesc (ssh agent daemon)"
+ depends="gcr4" # for gcr4-ssh-askpass
+
+ amove usr/libexec/gcr-ssh-agent
+
+ # Install wrapper used for gcr-ssh-agent autostart
+ install -Dm755 "$srcdir"/gcr-ssh-agent-wrapper \
+ "$subpkgdir"/usr/libexec/gcr-ssh-agent-wrapper
+ install -Dm644 "$srcdir"/gcr-ssh-agent.desktop \
+ "$subpkgdir"/etc/xdg/autostart/gcr-ssh-agent.desktop
+ install -Dm644 "$srcdir"/30-gcr-ssh-agent.sh \
+ "$subpkgdir"/etc/profile.d/30-gcr-ssh-agent.sh
+}
+
sha512sums="
3f252de55e07d47a49c03b714e323ceb00d82e010fe1bb606073e3188bf8bef84359a322ed6fe843620fa5d108e825dd7e9a60136c8a0e802b8f2178aa87b164 gcr-4.3.0.tar.xz
+907371c4c4adf8fb3731fe509329d1f7f83633aa1d82d76f6249b2f116c76418b67f7060a74054957e0e03f3ab106d85b77508191895ea7b6ffbad2e6f92bfee gcr-ssh-agent-wrapper
+90eefba939cc52b4251b4682dc8702d9a7f87ca2abd77b0caccd8fb0707692bc9fee9c23703388cb5336c1047731a4c6175423a03b05b1cf644c73040d0e244a gcr-ssh-agent.desktop
+f92d098db8146bdcacb7cc47b9ad5e9151cd1b26e786dfc164fe8c2941ded4f540e6458aedb0189ce52d49c46f7058bab86b9e02aae35962a487332503fb60ff 30-gcr-ssh-agent.sh
"
diff --git a/community/gcr4/gcr-ssh-agent-wrapper b/community/gcr4/gcr-ssh-agent-wrapper
new file mode 100755
index 00000000000..60550e4f168
--- /dev/null
+++ b/community/gcr4/gcr-ssh-agent-wrapper
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+UID="$(id -u)"
+if [ ! "$UID" ]; then exit 1; fi
+
+# Create base directory for the ssh-agent socket.
+GCR_BASE_DIR="/run/user/$UID/gcr"
+if [ -e "$GCR_BASE_DIR" ]; then
+ rm -rf "$GCR_BASE_DIR"
+fi
+mkdir -p "$GCR_BASE_DIR"
+
+/usr/libexec/gcr-ssh-agent --base-dir "$GCR_BASE_DIR" $*
+exit $?
diff --git a/community/gcr4/gcr-ssh-agent.desktop b/community/gcr4/gcr-ssh-agent.desktop
new file mode 100644
index 00000000000..30145047d79
--- /dev/null
+++ b/community/gcr4/gcr-ssh-agent.desktop
@@ -0,0 +1,6 @@
+[Desktop Entry]
+Type=Application
+Name=GCR SSH Agent
+Exec=/usr/libexec/gcr-ssh-agent-wrapper
+NoDisplay=true
+Terminal=false