diff options
Diffstat (limited to 'debian/adjust-openssl-dependencies')
-rwxr-xr-x | debian/adjust-openssl-dependencies | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/debian/adjust-openssl-dependencies b/debian/adjust-openssl-dependencies new file mode 100755 index 000000000..b9799c410 --- /dev/null +++ b/debian/adjust-openssl-dependencies | |||
@@ -0,0 +1,37 @@ | |||
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 | client_ssh1=debian/openssh-client-ssh1.substvars | ||
7 | server=debian/openssh-server.substvars | ||
8 | |||
9 | libssl_version="$(dpkg-query -W libssl1.0-dev 2>/dev/null | cut -f2)" | ||
10 | if [ -z "$libssl_version" ]; then | ||
11 | libssl_version="$(dpkg-query -W libssl-dev 2>/dev/null | cut -f2)" | ||
12 | fi | ||
13 | if [ -z "$libssl_version" ]; then | ||
14 | echo "Can't find libssl-dev version; leaving dependencies alone." | ||
15 | exit 0 | ||
16 | fi | ||
17 | libssl_version="$(echo "$libssl_version" | sed 's/[a-z-].*//')" | ||
18 | |||
19 | libssl_package="$(sed -n 's/.*[= ]\(libssl[0-9][a-z0-9+.-]*\).*/\1/p' "$client")" | ||
20 | if [ "$libssl_package" ]; then | ||
21 | new_dep="$libssl_package (>= $libssl_version)" | ||
22 | sed -i "/^shlibs:Depends=/s/\$/, $new_dep/" "$client" | ||
23 | sed -i "/^shlibs:Depends=/s/\$/, $new_dep/" "$client_ssh1" | ||
24 | sed -i "/^shlibs:Depends=/s/\$/, $new_dep/" "$server" | ||
25 | fi | ||
26 | |||
27 | client_udeb=debian/openssh-client-udeb.substvars | ||
28 | server_udeb=debian/openssh-server-udeb.substvars | ||
29 | |||
30 | libcrypto_package="$(sed -n 's/.*[= ]\(libcrypto[0-9][a-z0-9+.-]*\).*/\1/p' "$client_udeb")" | ||
31 | if [ "$libcrypto_package" ]; then | ||
32 | new_dep="$libcrypto_package (>= $libssl_version)" | ||
33 | sed -i "/^shlibs:Depends=/s/\$/, $new_dep/" "$client_udeb" | ||
34 | sed -i "/^shlibs:Depends=/s/\$/, $new_dep/" "$server_udeb" | ||
35 | fi | ||
36 | |||
37 | exit 0 | ||