From fc93786a008fe6cf48b42d1f7c8c3eae64b0d3b4 Mon Sep 17 00:00:00 2001
From: Amin Bandali <amin.bandali@savoirfairelinux.com>
Date: Thu, 19 Aug 2021 11:51:10 -0400
Subject: [PATCH] packaging: add debian 11 (bullseye)

Change-Id: I8e6f99f0322d8787c8991228bdd6681b950b6a19
---
 docker/Dockerfile_debian_11              | 25 ++++++++++++++++++++++++
 packaging/rules/debian/jami-all.postinst |  4 +++-
 scripts/make-packaging-target.py         |  5 +++++
 3 files changed, 33 insertions(+), 1 deletion(-)
 create mode 100644 docker/Dockerfile_debian_11

diff --git a/docker/Dockerfile_debian_11 b/docker/Dockerfile_debian_11
new file mode 100644
index 00000000..8f6ba719
--- /dev/null
+++ b/docker/Dockerfile_debian_11
@@ -0,0 +1,25 @@
+FROM debian:bullseye
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN apt-get clean
+RUN apt-get update && \
+    apt-get install -y -o Acquire::Retries=10 \
+        devscripts \
+        equivs \
+        wget
+
+# add deb-src entries (needed for next step)
+RUN sed -n '/^deb\s/s//deb-src /p' /etc/apt/sources.list > /etc/apt/sources.list.d/deb-src.list
+RUN apt-get clean && apt-get update
+
+ADD scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
+
+COPY packaging/rules/debian-qt/control /tmp/builddeps/debian/control
+RUN /opt/prebuild-package-debian.sh qt-deps
+
+COPY packaging/rules/debian/control /tmp/builddeps/debian/control
+RUN /opt/prebuild-package-debian.sh jami-deps
+
+ADD scripts/build-package-debian.sh /opt/build-package-debian.sh
+CMD ["/opt/build-package-debian.sh"]
diff --git a/packaging/rules/debian/jami-all.postinst b/packaging/rules/debian/jami-all.postinst
index dfdd0902..3781271c 100755
--- a/packaging/rules/debian/jami-all.postinst
+++ b/packaging/rules/debian/jami-all.postinst
@@ -94,8 +94,10 @@ if [ -f /etc/os-release ]; then
     . /etc/os-release
 
     # Set-up Jami repository end tag
-    if [ "${DEBIAN_CODENAME}" = "buster" ] || [ "${ID}_${VERSION_ID}" = "debian_10" ]; then
+    if [ "${VERSION_CODENAME}" = "buster" ] || [ "${ID}_${VERSION_ID}" = "debian_10" ]; then
         ENDTAG="debian_10"
+    elif [ "${VERSION_CODENAME}" = "bullseye" ] || [ "${ID}_${VERSION_ID}" = "debian_11" ]; then
+        ENDTAG="debian_11"
     elif [ "${ID}_${VERSION_ID}" = "trisquel_9.0" ]; then
         ENDTAG="ubuntu_18.04"
     elif [ "${UBUNTU_CODENAME}" = "bionic" ] || [ "${ID}_${VERSION_ID}" = "ubuntu_18.04" ]; then
diff --git a/scripts/make-packaging-target.py b/scripts/make-packaging-target.py
index 88540fab..8fe87439 100755
--- a/scripts/make-packaging-target.py
+++ b/scripts/make-packaging-target.py
@@ -138,6 +138,11 @@ def run_generate_all(parsed_args):
             "output_file": "$(DEBIAN_DSC_FILENAME)",
             "options": DPKG_BASED_SYSTEMS_DOCKER_RUN_OPTIONS,
         },
+        {
+            "distribution": "debian_11",
+            "output_file": "$(DEBIAN_DSC_FILENAME)",
+            "options": DPKG_BASED_SYSTEMS_DOCKER_RUN_OPTIONS,
+        },
         {
             "distribution": "debian_testing",
             "output_file": "$(DEBIAN_DSC_FILENAME)",
-- 
GitLab