@@ -52,6 +52,39 @@ pushd "$LIBMONGOCRYPT_DIR/"
5252 (git remote | grep -q upstream) || git remote add upstream https://github.com/mongodb/libmongocrypt
5353 git fetch upstream
5454 git checkout $( git rev-parse upstream/debian/unstable) -- debian
55+ # The 1.16.0-1 Debian package bumped the debhelper compatibility level to 13, but this level
56+ # isn't supported on some of the older (now unsupported) versions we still build for; so,
57+ # patch back to a lower level for the versions that don't support the current level
58+ if [[ ! -x /usr/bin/dh_assistant ]]; then
59+
60+ patch -p1 << EOF
61+ diff --git b/debian/compat a/debian/compat
62+ new file mode 100644
63+ index 00000000..f599e28b
64+ --- /dev/null
65+ +++ a/debian/compat
66+ @@ -0,0 +1 @@
67+ +10
68+ diff --git b/debian/control a/debian/control
69+ index 12eb7557..602fadbb 100644
70+ --- b/debian/control
71+ +++ a/debian/control
72+ @@ -3,7 +3,7 @@ Priority: optional
73+ Maintainer: Mongo C Driver Team <mongo-c-driver-debian@googlegroups.com>
74+ Uploaders: Kevin Albertson <kevin.albertson@mongodb.com>,
75+ Roberto C. Sanchez <roberto@connexer.com>
76+ -Build-Depends: debhelper-compat (= 13),
77+ +Build-Depends: debhelper (>= 10),
78+ cmake,
79+ libssl-dev,
80+ pkgconf,
81+ EOF
82+
83+ else
84+ # even on the newer versions, we need to specify via debian/compat, owing to the
85+ # barebones debian/control file we use for PPA packaging
86+ echo 13 > debian/compat
87+ fi
5588popd
5689pushd " $LIBMONGOCRYPT_DIR /etc/"
5790 # The files from libmongocrypt/debian/ are the official maintainer scripts,
0 commit comments