summaryrefslogtreecommitdiffstats
path: root/debian/adjust-openssl-dependencies
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:40:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:40:05 +0000
commite21fe8c3a4007c4a10f67e9e8107c3f083002f06 (patch)
tree926b3c2a4d3fd0decde08f6a4d22862ef03a7046 /debian/adjust-openssl-dependencies
parentAdding upstream version 1:9.2p1. (diff)
downloadopenssh-e21fe8c3a4007c4a10f67e9e8107c3f083002f06.tar.xz
openssh-e21fe8c3a4007c4a10f67e9e8107c3f083002f06.zip
Adding debian version 1:9.2p1-2+deb12u2.debian/1%9.2p1-2+deb12u2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xdebian/adjust-openssl-dependencies36
1 files changed, 36 insertions, 0 deletions
diff --git a/debian/adjust-openssl-dependencies b/debian/adjust-openssl-dependencies
new file mode 100755
index 0000000..1cd7f29
--- /dev/null
+++ b/debian/adjust-openssl-dependencies
@@ -0,0 +1,36 @@
+#! /bin/sh
+# Attempt to tighten libssl dependencies to match the check in entropy.c.
+# Must be run after dpkg-shlibdeps.
+
+client=debian/openssh-client.substvars
+server=debian/openssh-server.substvars
+
+libssl_version="$(dpkg-query -W libssl-dev 2>/dev/null | cut -f2)"
+if [ -z "$libssl_version" ]; then
+ echo "Can't find libssl-dev version; leaving dependencies alone."
+ exit 0
+fi
+libssl_version="$(echo "$libssl_version" | sed 's/[a-z-].*//')"
+
+libssl_package="$(sed -n 's/.*[= ]\(libssl[0-9][a-z0-9+.-]*\).*/\1/p' "$client")"
+if [ "$libssl_package" ]; then
+ new_dep="$libssl_package (>= $libssl_version)"
+ sed -i "/^shlibs:Depends=/s/\$/, $new_dep/" "$client"
+ sed -i "/^shlibs:Depends=/s/\$/, $new_dep/" "$server"
+fi
+
+client_udeb=debian/openssh-client-udeb.substvars
+server_udeb=debian/openssh-server-udeb.substvars
+
+libcrypto_package="$(sed -n 's/.*[= ]\(libcrypto[0-9][a-z0-9+.-]*\).*/\1/p' "$client_udeb")"
+if [ "$libcrypto_package" ]; then
+ new_dep="$libcrypto_package (>= $libssl_version)"
+ if [ -e "$client_udeb" ]; then
+ sed -i "/^shlibs:Depends=/s/\$/, $new_dep/" "$client_udeb"
+ fi
+ if [ -e "$server_udeb" ]; then
+ sed -i "/^shlibs:Depends=/s/\$/, $new_dep/" "$server_udeb"
+ fi
+fi
+
+exit 0