diff options
Diffstat (limited to 'debian/adjust-openssl-dependencies')
-rwxr-xr-x | debian/adjust-openssl-dependencies | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/debian/adjust-openssl-dependencies b/debian/adjust-openssl-dependencies new file mode 100755 index 000000000..1cd7f2997 --- /dev/null +++ b/debian/adjust-openssl-dependencies | |||
@@ -0,0 +1,36 @@ | |||
1 | #! /bin/sh | ||
2 | # Attempt to tighten libssl dependencies to match the check in entropy.c. | ||
3 | # Must be run after dpkg-shlibdeps. | ||
4 | |||
5 | client=debian/openssh-client.substvars | ||
6 | server=debian/openssh-server.substvars | ||
7 | |||
8 | libssl_version="$(dpkg-query -W libssl-dev 2>/dev/null | cut -f2)" | ||
9 | if [ -z "$libssl_version" ]; then | ||
10 | echo "Can't find libssl-dev version; leaving dependencies alone." | ||
11 | exit 0 | ||
12 | fi | ||
13 | libssl_version="$(echo "$libssl_version" | sed 's/[a-z-].*//')" | ||
14 | |||
15 | libssl_package="$(sed -n 's/.*[= ]\(libssl[0-9][a-z0-9+.-]*\).*/\1/p' "$client")" | ||
16 | if [ "$libssl_package" ]; then | ||
17 | new_dep="$libssl_package (>= $libssl_version)" | ||
18 | sed -i "/^shlibs:Depends=/s/\$/, $new_dep/" "$client" | ||
19 | sed -i "/^shlibs:Depends=/s/\$/, $new_dep/" "$server" | ||
20 | fi | ||
21 | |||
22 | client_udeb=debian/openssh-client-udeb.substvars | ||
23 | server_udeb=debian/openssh-server-udeb.substvars | ||
24 | |||
25 | libcrypto_package="$(sed -n 's/.*[= ]\(libcrypto[0-9][a-z0-9+.-]*\).*/\1/p' "$client_udeb")" | ||
26 | if [ "$libcrypto_package" ]; then | ||
27 | new_dep="$libcrypto_package (>= $libssl_version)" | ||
28 | if [ -e "$client_udeb" ]; then | ||
29 | sed -i "/^shlibs:Depends=/s/\$/, $new_dep/" "$client_udeb" | ||
30 | fi | ||
31 | if [ -e "$server_udeb" ]; then | ||
32 | sed -i "/^shlibs:Depends=/s/\$/, $new_dep/" "$server_udeb" | ||
33 | fi | ||
34 | fi | ||
35 | |||
36 | exit 0 | ||