From 3349b7deff242d1f61569bac27f054cdfa061069 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
Date: Thu, 1 Dec 2022 16:37:19 -0500
Subject: [PATCH] packaging: migrate packaging scripts in client-qt
This patch moves already existing packaging scripts from jami-project
into client-qt.
Introduced changes are:
+ WITH_SUBMODULE must search in system lib too because for
packaging client-qt (for rpm) will be built separately, and will
depend on jami-daemon.
+ Fix appdata.xml (replace old wiki with docs.jami.net)
+ path changes (because we build in client-qt not jami-project).
GitLab: #853
Change-Id: I1313830d85c8094fcbcc52e22033a2add7b1e89f
---
INSTALL.md | 2 +-
extras/build/cmake/modules/FindLibJami.cmake | 5 +
extras/data/jami.appdata.xml | 6 +-
extras/packaging/gnu-linux/Jenkinsfile | 257 ++++++++++++
extras/packaging/gnu-linux/Makefile | 306 ++++++++++++++
.../gnu-linux/docker/Dockerfile_debian_10 | 46 +++
.../gnu-linux/docker/Dockerfile_debian_11 | 26 ++
.../docker/Dockerfile_debian_testing | 27 ++
.../docker/Dockerfile_debian_unstable | 28 ++
.../gnu-linux/docker/Dockerfile_fedora_36 | 103 +++++
.../gnu-linux/docker/Dockerfile_fedora_37 | 103 +++++
.../docker/Dockerfile_opensuse-leap_15.4 | 109 +++++
.../gnu-linux/docker/Dockerfile_snap | 84 ++++
.../gnu-linux/docker/Dockerfile_ubuntu_18.04 | 40 ++
.../gnu-linux/docker/Dockerfile_ubuntu_20.04 | 29 ++
.../gnu-linux/docker/Dockerfile_ubuntu_22.04 | 22 +
.../gnu-linux/docker/Dockerfile_ubuntu_22.10 | 22 +
extras/packaging/gnu-linux/guix/channels.scm | 5 +
.../gnu-linux/guix/guix-pack-deb.postinst | 97 +++++
.../gnu-linux/guix/guix-pack-manifest.scm | 98 +++++
extras/packaging/gnu-linux/guix/manifest.scm | 116 ++++++
.../gnu-linux/guix/minimal-manifest.scm | 27 ++
.../gnu-linux/rules/debian-qt/compat | 1 +
.../gnu-linux/rules/debian-qt/control | 390 ++++++++++++++++++
.../rules/debian-qt/libqt-jami-env.sh | 8 +
.../rules/debian-qt/libqt-jami.install | 2 +
...101201-fatal-error-getcurrenkeyboard.patch | 59 +++
.../gnu-linux/rules/debian-qt/patches/series | 1 +
.../packaging/gnu-linux/rules/debian-qt/rules | 33 ++
.../gnu-linux/rules/debian-qt/source/format | 1 +
.../gnu-linux/rules/debian/README.Debian | 35 ++
.../packaging/gnu-linux/rules/debian/compat | 1 +
.../packaging/gnu-linux/rules/debian/control | 119 ++++++
.../gnu-linux/rules/debian/copyright | 212 ++++++++++
.../rules/debian/jami-all.lintian-overrides | 3 +
.../gnu-linux/rules/debian/jami-all.manpages | 1 +
.../gnu-linux/rules/debian/jami-all.postinst | 168 ++++++++
.../gnu-linux/rules/debian/jami-all.triggers | 1 +
.../rules/debian/jami-daemon.manpages | 1 +
.../rules/debian/jami.lintian-overrides | 3 +
.../gnu-linux/rules/debian/jami.manpages | 0
.../gnu-linux/rules/debian/jami.triggers | 1 +
extras/packaging/gnu-linux/rules/debian/rules | 158 +++++++
.../gnu-linux/rules/debian/source/format | 1 +
extras/packaging/gnu-linux/rules/debian/watch | 3 +
.../gnu-linux/rules/rpm/jami-all.postinst | 133 ++++++
.../gnu-linux/rules/rpm/jami-daemon.spec | 128 ++++++
.../gnu-linux/rules/rpm/jami-libclient.spec | 25 ++
.../gnu-linux/rules/rpm/jami-libqt.spec | 97 +++++
.../gnu-linux/rules/rpm/jami-qt.spec | 26 ++
.../packaging/gnu-linux/rules/rpm/jami.spec | 83 ++++
...101201-fatal-error-getcurrenkeyboard.patch | 59 +++
.../rules/snap/common/icons/jami.svg | 340 +++++++++++++++
.../rules/snap/common/scripts/jami-wrapper | 5 +
.../gnu-linux/rules/snap/jami/snapcraft.yaml | 367 ++++++++++++++++
.../gnu-linux/scripts/build-package-debian.sh | 135 ++++++
.../gnu-linux/scripts/build-package-rpm.sh | 149 +++++++
.../gnu-linux/scripts/build-package-snap.sh | 38 ++
.../gnu-linux/scripts/deploy-packages.sh | 332 +++++++++++++++
.../gnu-linux/scripts/install-cmake.sh | 15 +
.../scripts/prebuild-package-debian.sh | 86 ++++
extras/packaging/gnu-linux/tarballs.manifest | 16 +
62 files changed, 4790 insertions(+), 4 deletions(-)
create mode 100644 extras/packaging/gnu-linux/Jenkinsfile
create mode 100644 extras/packaging/gnu-linux/Makefile
create mode 100644 extras/packaging/gnu-linux/docker/Dockerfile_debian_10
create mode 100644 extras/packaging/gnu-linux/docker/Dockerfile_debian_11
create mode 100644 extras/packaging/gnu-linux/docker/Dockerfile_debian_testing
create mode 100644 extras/packaging/gnu-linux/docker/Dockerfile_debian_unstable
create mode 100644 extras/packaging/gnu-linux/docker/Dockerfile_fedora_36
create mode 100644 extras/packaging/gnu-linux/docker/Dockerfile_fedora_37
create mode 100644 extras/packaging/gnu-linux/docker/Dockerfile_opensuse-leap_15.4
create mode 100644 extras/packaging/gnu-linux/docker/Dockerfile_snap
create mode 100644 extras/packaging/gnu-linux/docker/Dockerfile_ubuntu_18.04
create mode 100644 extras/packaging/gnu-linux/docker/Dockerfile_ubuntu_20.04
create mode 100644 extras/packaging/gnu-linux/docker/Dockerfile_ubuntu_22.04
create mode 100644 extras/packaging/gnu-linux/docker/Dockerfile_ubuntu_22.10
create mode 100644 extras/packaging/gnu-linux/guix/channels.scm
create mode 100644 extras/packaging/gnu-linux/guix/guix-pack-deb.postinst
create mode 100644 extras/packaging/gnu-linux/guix/guix-pack-manifest.scm
create mode 100644 extras/packaging/gnu-linux/guix/manifest.scm
create mode 100644 extras/packaging/gnu-linux/guix/minimal-manifest.scm
create mode 100644 extras/packaging/gnu-linux/rules/debian-qt/compat
create mode 100644 extras/packaging/gnu-linux/rules/debian-qt/control
create mode 100755 extras/packaging/gnu-linux/rules/debian-qt/libqt-jami-env.sh
create mode 100644 extras/packaging/gnu-linux/rules/debian-qt/libqt-jami.install
create mode 100644 extras/packaging/gnu-linux/rules/debian-qt/patches/0001-qtbug-101201-fatal-error-getcurrenkeyboard.patch
create mode 100644 extras/packaging/gnu-linux/rules/debian-qt/patches/series
create mode 100755 extras/packaging/gnu-linux/rules/debian-qt/rules
create mode 100644 extras/packaging/gnu-linux/rules/debian-qt/source/format
create mode 100644 extras/packaging/gnu-linux/rules/debian/README.Debian
create mode 100644 extras/packaging/gnu-linux/rules/debian/compat
create mode 100644 extras/packaging/gnu-linux/rules/debian/control
create mode 100644 extras/packaging/gnu-linux/rules/debian/copyright
create mode 100644 extras/packaging/gnu-linux/rules/debian/jami-all.lintian-overrides
create mode 100644 extras/packaging/gnu-linux/rules/debian/jami-all.manpages
create mode 100755 extras/packaging/gnu-linux/rules/debian/jami-all.postinst
create mode 100644 extras/packaging/gnu-linux/rules/debian/jami-all.triggers
create mode 100644 extras/packaging/gnu-linux/rules/debian/jami-daemon.manpages
create mode 100644 extras/packaging/gnu-linux/rules/debian/jami.lintian-overrides
create mode 100644 extras/packaging/gnu-linux/rules/debian/jami.manpages
create mode 100644 extras/packaging/gnu-linux/rules/debian/jami.triggers
create mode 100755 extras/packaging/gnu-linux/rules/debian/rules
create mode 100644 extras/packaging/gnu-linux/rules/debian/source/format
create mode 100644 extras/packaging/gnu-linux/rules/debian/watch
create mode 100755 extras/packaging/gnu-linux/rules/rpm/jami-all.postinst
create mode 100644 extras/packaging/gnu-linux/rules/rpm/jami-daemon.spec
create mode 100644 extras/packaging/gnu-linux/rules/rpm/jami-libclient.spec
create mode 100644 extras/packaging/gnu-linux/rules/rpm/jami-libqt.spec
create mode 100644 extras/packaging/gnu-linux/rules/rpm/jami-qt.spec
create mode 100644 extras/packaging/gnu-linux/rules/rpm/jami.spec
create mode 100644 extras/packaging/gnu-linux/rules/rpm/patches/0001-qtbug-101201-fatal-error-getcurrenkeyboard.patch
create mode 100644 extras/packaging/gnu-linux/rules/snap/common/icons/jami.svg
create mode 100755 extras/packaging/gnu-linux/rules/snap/common/scripts/jami-wrapper
create mode 100644 extras/packaging/gnu-linux/rules/snap/jami/snapcraft.yaml
create mode 100755 extras/packaging/gnu-linux/scripts/build-package-debian.sh
create mode 100755 extras/packaging/gnu-linux/scripts/build-package-rpm.sh
create mode 100755 extras/packaging/gnu-linux/scripts/build-package-snap.sh
create mode 100755 extras/packaging/gnu-linux/scripts/deploy-packages.sh
create mode 100755 extras/packaging/gnu-linux/scripts/install-cmake.sh
create mode 100755 extras/packaging/gnu-linux/scripts/prebuild-package-debian.sh
create mode 100644 extras/packaging/gnu-linux/tarballs.manifest
diff --git a/INSTALL.md b/INSTALL.md
index a54595fa7..81bd3c5ef 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -8,7 +8,7 @@ There are essentially two ways to build `client-qt`:
## Disclaimer
Because the client-qt is multi-platforms and supporting macOS, we need a recent version of Qt to do rendering with Metal. So, Qt 6.2 is necessary.
-This version is generally not packaged on a lot of platforms, and to control available plugins and such, we have our own Qt packaged (generated by https://review.jami.net/jami-project and available on https://jami.net on the distributions we support).
+This version is generally not packaged on a lot of platforms, and to control available plugins and such, we have our own Qt packaged (available on https://jami.net on the distributions we support).
So, you will need to get Qt 6.2 first. For this, there is 3 methods:
### Qt from https://jami.net (recommended)
diff --git a/extras/build/cmake/modules/FindLibJami.cmake b/extras/build/cmake/modules/FindLibJami.cmake
index ddb053190..1e271001e 100644
--- a/extras/build/cmake/modules/FindLibJami.cmake
+++ b/extras/build/cmake/modules/FindLibJami.cmake
@@ -54,6 +54,9 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib;.so;.dll")
if(WITH_DAEMON_SUBMODULE)
find_library(LIBJAMI_LIB NAMES jami ring
PATHS ${DAEMON_DIR}/src/.libs
+ PATHS ${CMAKE_INSTALL_PREFIX}/lib
+ PATHS ${CMAKE_INSTALL_PREFIX}/libexec
+ PATHS ${CMAKE_INSTALL_PREFIX}/bin
NO_DEFAULT_PATH)
else()
# Search only in these given PATHS.
@@ -78,6 +81,8 @@ if(NOT LIBJAMI_LIB)
if(WITH_DAEMON_SUBMODULE)
find_library(LIBJAMI_LIB NAMES jami ring
PATHS ${DAEMON_DIR}/src/.libs
+ PATHS ${CMAKE_INSTALL_PREFIX}/lib
+ PATHS ${CMAKE_INSTALL_PREFIX}/libexec
NO_DEFAULT_PATH)
else()
# Search only in these given PATHS.
diff --git a/extras/data/jami.appdata.xml b/extras/data/jami.appdata.xml
index a9316504b..61defebe0 100644
--- a/extras/data/jami.appdata.xml
+++ b/extras/data/jami.appdata.xml
@@ -58,16 +58,16 @@
ügyfélalkalmazásai, így a Jami interoperábilis és többplatformos
kommunikációs keretrendszerré válik.
-
+
https://jami.net/
https://git.jami.net/savoirfairelinux/jami-client-qt/issues
https://jami.net/help/
- https://git.jami.net/savoirfairelinux/jami-project/-/wikis/home
+ https://docs.jami.net
https://www.paypal.com/donate/?hosted_button_id=MGUDJLQZ4TP5W
https://www.transifex.com/savoirfairelinux/jami
-
+
diff --git a/extras/packaging/gnu-linux/Jenkinsfile b/extras/packaging/gnu-linux/Jenkinsfile
new file mode 100644
index 000000000..500556a8c
--- /dev/null
+++ b/extras/packaging/gnu-linux/Jenkinsfile
@@ -0,0 +1,257 @@
+// Copyright (C) 2021-2022 Savoir-faire Linux Inc.
+//
+// Author: Maxim Cournoyer
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// Packaging validation for supported GNU/Linux systems.
+//
+// Note: To work on this script without having to push a commit each
+// time, use the jenkins-cli command (see:
+// https://wiki.savoirfairelinux.com/wiki/Jenkins.jami.net#Usage_CLI_de_Jenkins).
+//
+// Requirements:
+// 1. gerrit-trigger plugin
+// 2. ws-cleanup plugin
+// 3. ansicolor plugin
+
+// TODO:
+// - GPG-sign release tarballs.
+// - GPG-sign release commits.
+// - Allow publishing from any node, to avoid relying on a single machine.
+
+// Configuration globals.
+def SUBMODULES = ['daemon', '3rdparty/SortFilterProxyModel', '3rdparty/qrencode-win32', 'extras/packaging/update/sparkle/Sparkle']
+def TARGETS = [:]
+def REMOTE_HOST = env.SSH_HOST_DL_RING_CX
+def REMOTE_BASE_DIR = '/srv/repository/ring'
+def JAMI_PUBLIC_KEY_FINGERPRINT = 'A295D773307D25A33AE72F2F64CD5FA175348F84'
+def GIT_USER_EMAIL = 'jenkins@jami.net'
+def GIT_USER_NAME = 'jenkins'
+def GIT_PUSH_URL = 'ssh://jenkins@review.jami.net:29420/jami-client-qt'
+def JENKINS_SSH_KEY = '35cefd32-dd99-41b0-8312-0b386df306ff'
+def DL_SSH_KEY = '5825b39b-dfc6-435f-918e-12acc1f56221'
+def SNAPCRAFT_KEY = '106e398c-43ca-41c0-8f7e-4f45030f8bdd'
+
+pipeline {
+ agent {
+ label 'guix'
+ }
+
+ options {
+ ansiColor('xterm')
+ }
+
+ parameters {
+ string(name: 'GERRIT_REFSPEC',
+ defaultValue: 'refs/heads/master',
+ description: 'The Gerrit refspec to fetch.')
+ booleanParam(name: 'DEPLOY',
+ defaultValue: false,
+ description: 'Whether to deploy packages.')
+ booleanParam(name: 'PUBLISH',
+ defaultValue: false,
+ description: 'Whether to upload tarball and push to git.')
+ choice(name: 'CHANNEL',
+ choices: 'internal\nnightly\nstable',
+ description: 'The repository channel to deploy to. ' +
+ 'Defaults to "internal".')
+ booleanParam(name: 'BUILD_ARM',
+ defaultValue: false,
+ description: 'Whether to build ARM packages.')
+ booleanParam(name: 'BUILD_DEB_PACK',
+ defaultValue: false,
+ description: 'Whether to build DEB PACK packages.')
+ string(name: 'PACKAGING_TARGETS',
+ defaultValue: '',
+ description: 'A whitespace-separated list of packaging ' +
+ 'targets, e.g. "debian_10 snap". ' +
+ 'When left unspecified, all the packaging targets are built.')
+ }
+
+ environment {
+ TARBALLS = '/var/cache/jami' // set the cache directory
+ }
+
+ stages {
+ stage('Check configuration') {
+ steps {
+ script {
+ if (!fileExists(TARBALLS)) {
+ error "The ${TARBALLS} directory does not exist. \
+See https://wiki.savoirfairelinux.com/wiki/Jenkins.jami.net#Configuration"
+ }
+
+ mountType = sh(script: "findmnt ${TARBALLS} -o fstype -n",
+ returnStdout: true)
+ if (!(mountType =~ /^nfs/)) {
+ error "The ${TARBALLS} directory is not mounted on NFS storage. \
+See https://wiki.savoirfairelinux.com/wiki/Jenkins.jami.net#Configuration_client_NFS"
+ }
+ }
+ }
+ }
+
+ stage('Configure Git') {
+ steps {
+ sh """git config user.name ${GIT_USER_NAME}
+ git config user.email ${GIT_USER_EMAIL}
+ """
+ }
+ }
+
+ stage('Fetch submodules') {
+ steps {
+ echo 'Initializing submodules ' + SUBMODULES.join(', ')
+ sh 'git submodule update --init --recursive'
+ }
+ }
+
+ stage('Generate release tarball') {
+ steps {
+ sh """\
+#!/usr/bin/env -S bash -l
+make -f extras/packaging/gnu-linux/Makefile portable-release-tarball .tarball-version
+"""
+ stash(includes: '*.tar.gz, .tarball-version',
+ name: 'release-tarball')
+ }
+ }
+
+ stage('Publish release artifacts') {
+ when {
+ expression {
+ params.PUBLISH && params.CHANNEL != 'internal'
+ }
+ }
+
+ steps {
+ sshagent(credentials: [JENKINS_SSH_KEY, DL_SSH_KEY]) {
+ echo "Publishing to git repository..."
+ script {
+ def tagDate = sh 'date +"%Y%M%d"'
+ sh """
+ git tag -am ${params.CHANNEL}/${tagDate} \"Jami new ${params.CHANNEL} version\"
+ """
+ if (params.CHANNEL == 'stable') {
+ // Only stables releases get tarballs and a tag.
+ sh 'git push --follow-tags'
+ echo "Publishing release tarball..."
+ sh 'rsync --verbose jami*.tar.gz ' +
+ "${REMOTE_HOST}:${REMOTE_BASE_DIR}" +
+ "/release/tarballs/"
+ } else {
+ sh 'git push --tags'
+ }
+ }
+ }
+ }
+ }
+
+ stage('Build packages') {
+ environment {
+ DISABLE_CONTRIB_DOWNLOADS = 'TRUE'
+ }
+ steps {
+ script {
+ def targetsText = params.PACKAGING_TARGETS.trim()
+ if (!targetsText) {
+ targetsText = sh(script: 'make -f extras/packaging/gnu-linux/Makefile -s list-package-targets',
+ returnStdout: true).trim()
+ }
+
+ TARGETS = targetsText.split(/\s/)
+ if (!params.BUILD_ARM) {
+ TARGETS = TARGETS.findAll { !(it =~ /_(armhf|arm64)$/) }
+ }
+ if (!params.BUILD_DEB_PACK) {
+ TARGETS = TARGETS.findAll { !(it =~ /_(deb-pack)$/) }
+ }
+
+ def stages = [:]
+
+ TARGETS.each { target ->
+ // Note: The stage calls are wrapped in closures, to
+ // delay their execution.
+ stages[target] = {
+ stage(target) {
+ // Offload builds to different agents.
+ node('linux-builder') {
+ cleanWs()
+ unstash 'release-tarball'
+ catchError(buildResult: 'FAILURE',
+ stageResult: 'FAILURE') {
+ sh """#!/usr/bin/env -S bash -l
+ echo Building on node \$NODE_NAME
+ whoami
+ tar xf *.tar.gz --strip-components=1
+ make -f extras/packaging/gnu-linux/Makefile ${target}
+ """
+ stash(includes: 'extras/packaging/gnu-linux/packages/**',
+ name: target)
+ }
+ }
+ }
+ }
+ }
+ parallel stages
+ }
+ }
+ }
+ stage('Sign & deploy packages') {
+ agent {
+ label 'ring-buildmachine-02.mtl.sfl'
+ }
+
+ when {
+ expression {
+ params.DEPLOY
+ }
+ }
+
+ steps {
+ sshagent(credentials: [JENKINS_SSH_KEY, DL_SSH_KEY]) {
+ script {
+ TARGETS.each { target ->
+ try {
+ unstash target
+ } catch (err) {
+ echo "Failed to unstash ${target}, skipping..."
+ return
+ }
+ }
+
+ def distributionsText = sh(
+ script: 'find extras/packaging/gnu-linux/packages/* -maxdepth 1 -type d -print0 ' +
+ '| xargs -0 -n1 basename -z',
+ returnStdout: true).trim()
+ def distributions = distributionsText.split("\0")
+
+ distributions.each { distribution ->
+ echo "Deploying ${distribution} packages..."
+ withCredentials([string(credentialsId: SNAPCRAFT_KEY, variable: 'SNAPCRAFT_STORE_CREDENTIALS')]) {
+ sh """extras/packaging/gnu-linux/scripts/deploy-packages.sh \
+ --distribution=${distribution} \
+ --keyid="${JAMI_PUBLIC_KEY_FINGERPRINT}" \
+ --remote-repository-location="${REMOTE_HOST}:${REMOTE_BASE_DIR}/${params.CHANNEL}" \
+ --remote-manual-download-location="${REMOTE_HOST}:${REMOTE_BASE_DIR}/manual-${params.CHANNEL}"
+"""
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/extras/packaging/gnu-linux/Makefile b/extras/packaging/gnu-linux/Makefile
new file mode 100644
index 000000000..0ad56635e
--- /dev/null
+++ b/extras/packaging/gnu-linux/Makefile
@@ -0,0 +1,306 @@
+# -*- mode: makefile; -*-
+# Copyright (C) 2016-2021 Savoir-faire Linux Inc.
+#
+# Author: Maxim Cournoyer
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+.DEFAULT_GOAL := package-all
+
+# Default caching directory
+export TARBALLS ?= /var/cache/jami
+
+##############################
+## Version number variables ##
+##############################
+TARBALL_VERSION := $(shell cat $(CURDIR)/.tarball-version 2> /dev/null)
+
+ifeq ($(TARBALL_VERSION),)
+LAST_COMMIT_DATE := $(shell git log -1 --format=%cd --date=format:'%Y%m%d.%H%M')
+COMMIT_ID := $(shell git rev-parse --short HEAD)
+RELEASE_VERSION := $(LAST_COMMIT_DATE).$(COMMIT_ID)
+else
+$(warning Using version from the .tarball-version file: $(TARBALL_VERSION))
+RELEASE_VERSION := $(TARBALL_VERSION)
+endif
+RELEASE_TARBALL_FILENAME := jami_$(RELEASE_VERSION).tar.gz
+
+# Export for consumption in child processes.
+export RELEASE_VERSION
+export RELEASE_TARBALL_FILENAME
+
+# Debian versions
+DEBIAN_VERSION := $(RELEASE_VERSION)~dfsg1-1
+DEBIAN_DSC_FILENAME := jami_$(DEBIAN_VERSION).dsc
+
+# Qt versions
+QT_MAJOR := 6
+QT_MINOR := 2
+QT_PATCH := 3
+QT_TARBALL_CHECKSUM := f784998a159334d1f47617fd51bd0619b9dbfe445184567d2cd7c820ccb12771
+DEBIAN_QT_VERSION := $(QT_MAJOR).$(QT_MINOR).$(QT_PATCH)-2
+DEBIAN_QT_DSC_FILENAME := libqt-jami_$(DEBIAN_QT_VERSION).dsc
+QT_JAMI_PREFIX := /usr/lib/libqt-jami
+
+#####################
+## Other variables ##
+#####################
+TMPDIR := $(shell mktemp -d)
+CURRENT_UID:=$(shell id -u)
+CURRENT_GID:=$(shell id -g)
+
+#############################
+## Release tarball targets ##
+#############################
+.PHONY: release-tarball purge-release-tarballs portable-release-tarball
+# See: https://reproducible-builds.org/docs/archives/
+TAR_REPRODUCIBILITY_OPTIONS = \
+ --format=gnu \
+ --mtime=@1 \
+ --owner=root:0 \
+ --group=root:0
+
+# This file can be used when not wanting to invoke the tarball
+# producing machinery (which depends on the Git checkout), nor its
+# prerequisites. It is used to set the TARBALL_VERSION Make variable.
+.tarball-version:
+ echo $(RELEASE_VERSION) > $@
+
+purge-release-tarballs:
+ rm -f jami_*.tar.* tarballs.manifest
+
+release-tarball:
+ rm -f "$(RELEASE_TARBALL_FILENAME)" tarballs.manifest
+ $(MAKE) -f extras/packaging/gnu-linux/Makefile "$(RELEASE_TARBALL_FILENAME)"
+
+# Predicate to check if the 'guix' command is available.
+has-guix-p:
+ command -v guix > /dev/null 2>&1 || \
+ (echo 'guix' is required to build the '$@' target && exit 1)
+
+# The bundled tarballs included in the release tarball depend on what
+# is available on the host. To ensure it can be shared across all
+# different GNU/Linux distributions, generate it in a minimal
+# container. Wget uses GnuTLS, which looks up its certs from
+# /etc/ssl/certs.
+guix-share-tarball-arg = $${TARBALLS:+"--share=$$TARBALLS"}
+portable-release-tarball: has-guix-p
+ guix shell --container --network \
+ --preserve=TARBALLS $(guix-share-tarball-arg) \
+ --expose=/usr/bin/env \
+ --expose=$$SSL_CERT_DIR=/etc/ssl/certs \
+ --manifest=$(CURDIR)/extras/packaging/gnu-linux/guix/minimal-manifest.scm \
+ -- $(MAKE) -f extras/packaging/gnu-linux/Makefile release-tarball
+
+daemon/contrib/native/Makefile:
+ mkdir -p ./daemon/contrib/native && \
+ cd daemon/contrib/native && \
+ ../bootstrap
+
+# Fetch the required contrib sources and copy them to
+# daemon/contrib/tarballs. To use a custom tarballs cache directory,
+# export the TARBALLS environment variable.
+tarballs.manifest: daemon/contrib/native/Makefile
+ cd daemon/contrib/native && \
+ $(MAKE) list && \
+ $(MAKE) fetch -j && \
+ $(MAKE) --no-print-directory --silent list-tarballs > "$(CURDIR)/$@"
+
+ifeq ($(TARBALL_VERSION),)
+# Generate the release tarball. To regenerate a fresh tarball
+# manually clear the tarballs.manifest file.
+$(RELEASE_TARBALL_FILENAME): tarballs.manifest
+# Prepare the sources of the top repository and relevant submodules.
+ rm -f "$@"
+ mkdir $(TMPDIR)/client-qt
+ git archive HEAD | tar xf - -C $(TMPDIR)/client-qt
+ for m in \
+ ./daemon \
+ . \
+ ./3rdparty/SortFilterProxyModel; do \
+ (cd "$$m" && git archive --prefix "$$m/" HEAD \
+ | tar xf - -C $(TMPDIR)/client-qt); \
+ done
+# Create the base archive.
+ tar -cf $(TMPDIR)/client-qt.tar $(TMPDIR)/client-qt \
+ --transform 's,.*/client-qt,client-qt,' \
+ $(TAR_REPRODUCIBILITY_OPTIONS)
+# Append the cached tarballs listed in the manifest.
+ tar --append --file $(TMPDIR)/client-qt.tar \
+ --files-from $< \
+ --transform 's,^.*/,client-qt/daemon/contrib/tarballs/,' \
+ $(TAR_REPRODUCIBILITY_OPTIONS)
+# Compress the tarball and move it into place.
+ gzip --no-name $(TMPDIR)/client-qt.tar
+ mv $(TMPDIR)/client-qt.tar.gz "$@"
+ rm -rf $(TMPDIR)
+else
+# If TARBALL_VERSION is defined, assume it's already been generated,
+# without doing any checks, which would require Git.
+$(RELEASE_TARBALL_FILENAME):
+endif
+
+#######################
+## Packaging targets ##
+#######################
+
+#
+# Traditionally built packages (in Docker containers).
+#
+DISTRIBUTIONS := \
+ debian_10 \
+ debian_11 \
+ debian_testing \
+ debian_unstable \
+ raspbian_10_armhf \
+ ubuntu_18.04 \
+ ubuntu_20.04 \
+ ubuntu_22.04 \
+ ubuntu_22.10 \
+ fedora_35 \
+ fedora_36 \
+ fedora_37 \
+ opensuse-leap_15.3 \
+ opensuse-leap_15.4 \
+ snap
+
+IS_SHELL_INTERACTIVE := $(shell [ -t 0 ] && echo yes)
+
+# The following Make variable can be used to provide extra arguments
+# used with the 'docker run' commands invoked to build the packages.
+DOCKER_RUN_EXTRA_ARGS =
+
+# This function is used to produce the rules of the packaging targets
+# that rely on Docker.
+# Arg1: The name-version string of the distribution (e.g., ubuntu-18.04).
+# Arg2: Extra arguments to pass to 'docker build'.
+# Arg3: Extra arguments to pass to 'docker run'.
+define make-docker-package-target
+$(1)-docker-image-name := jami-packaging-$(1)
+$(1)-docker-image-file := .docker-image-$$($(1)-docker-image-name)
+$(1)-docker-run-command := docker run \
+ --rm --privileged --security-opt apparmor=docker-default \
+ -e RELEASE_VERSION="$(RELEASE_VERSION)" \
+ -e RELEASE_TARBALL_FILENAME="$(RELEASE_TARBALL_FILENAME)" \
+ -e DEBIAN_VERSION="$(DEBIAN_VERSION)" \
+ -e DEBIAN_QT_VERSION="$(DEBIAN_QT_VERSION)" \
+ -e CURRENT_UID="$(CURRENT_UID)" \
+ -e CURRENT_GID="$(CURRENT_GID)" \
+ -e DISTRIBUTION="$(1)" \
+ -e QT_JAMI_PREFIX="$(QT_JAMI_PREFIX)" \
+ -e QT_MAJOR="$(QT_MAJOR)" \
+ -e QT_MINOR="$(QT_MINOR)" \
+ -e QT_PATCH="$(QT_PATCH)" \
+ -e QT_TARBALL_CHECKSUM="$(QT_TARBALL_CHECKSUM)" \
+ -e FORCE_REBUILD_QT="$(FORCE_REBUILD_QT)" \
+ -e SNAP_PKG_NAME="$(or $(SNAP_PKG_NAME),jami)" \
+ -e TARBALLS="$(TARBALLS)" \
+ -v '$(TARBALLS)':'$(TARBALLS)' \
+ -v '$(CURDIR)/$(RELEASE_TARBALL_FILENAME)':'/src/$(RELEASE_TARBALL_FILENAME)' \
+ -v '$(CURDIR)/extras/packaging/gnu-linux/packages/$(1)':/opt/output \
+ -t $(and $(IS_SHELL_INTERACTIVE),-i) \
+ $(3) \
+ "$$($(1)-docker-image-name)"
+
+$$($(1)-docker-image-file): extras/packaging/gnu-linux/docker/Dockerfile_$(1)
+ docker build \
+ -t $$($(1)-docker-image-name) \
+ -f extras/packaging/gnu-linux/docker/Dockerfile_$(1) $(2) $(CURDIR) && \
+ touch "$$@"
+
+packages/$(1)/.packages-built: $(RELEASE_TARBALL_FILENAME) $$($(1)-docker-image-file)
+ mkdir -p "$$$$(dirname "$$@")" && \
+ $$($(1)-docker-run-command) && \
+ touch "$$@"
+
+.PHONY: $(1)
+$(1): packages/$(1)/.packages-built
+PACKAGE-TARGETS += $(1)
+
+.PHONY: $(1)-interactive
+$(1)-interactive: $(RELEASE_TARBALL_FILENAME) $$($(1)-docker-image-file)
+ $$($(1)-docker-run-command) bash
+
+endef
+
+$(foreach target,$(DISTRIBUTIONS),\
+ $(eval $(call make-docker-package-target,$(target))))
+
+#
+# Guix-generated Debian packages (deb packs) targets.
+#
+SUPPORTED_GNU_ARCHS = x86_64
+DEB_PACK_TARGETS =
+
+define guix-pack-command
+guix pack -C xz -f deb -m $(CURDIR)/extras/packaging/gnu-linux/guix/guix-pack-manifest.scm -v3 \
+ -S /usr/bin/jami=bin/jami \
+ -S /usr/share/applications/jami.desktop=share/applications/jami.desktop \
+ -S /usr/share/icons/hicolor/scalable/apps/jami.svg=share/icons/hicolor/scalable/apps/jami.svg \
+ -S /usr/share/icons/hicolor/48x48/apps/jami.png=share/icons/hicolor/48x48/apps/jami.png \
+ -S /usr/share/metainfo/jami.appdata.xml=share/metainfo/jami.appdata.xml \
+ --postinst-file=$(CURDIR)/extras/packaging/gnu-linux/guix/guix-pack-deb.postinst
+endef
+
+# Arg1: the GNU architecture type (e.g., x86_64, i686, powerpcle, etc.)
+define define-deb-pack-rule
+deb-file-name := packages/guix-deb-pack/jami-$(RELEASE_VERSION)-$(1).deb
+DEB_PACK_TARGETS += deb-pack-$(subst _,-,$(1))
+.PHONY: deb-pack-$(subst _,-,$(1))
+deb-pack-$(subst _,-,$(1)): $$(deb-file-name)
+$$(deb-file-name): has-guix-p $(RELEASE_TARBALL_FILENAME)
+ output=$$$$($(guix-pack-command) --system=$(1)-linux $$(GUIX_PACK_ARGS)) && \
+ mkdir -p "$$$$(dirname "$$@")" && \
+ cp --reflink=auto "$$$$output" "$$@" && \
+ guix gc --delete "$$$$output"
+ chmod +w "$$@"
+endef
+
+$(foreach arch,$(SUPPORTED_GNU_ARCHS),\
+ $(eval $(call define-deb-pack-rule,$(arch))))
+
+PACKAGE-TARGETS += $(DEB_PACK_TARGETS)
+
+package-all: $(PACKAGE-TARGETS)
+
+.PHONY: list-package-targets
+list-package-targets:
+ @$(foreach p,$(PACKAGE-TARGETS),\
+ echo $(p);)
+
+###################
+## Other targets ##
+###################
+.PHONY: docs
+
+# Build the documentation
+# Note that newly added RST files will likely not display on all documents'
+# navigation bar unless the docs/build folder is manually deleted.
+docs: env
+ env/bin/sphinx-build -b html docs/source docs/build/html
+ env/bin/sphinx-build -b texinfo docs/source docs/build/texinfo
+
+env:
+ virtualenv env
+ env/bin/pip install Sphinx==1.4.1 sphinx-rtd-theme==0.1.9
+
+.PHONY: clean
+clean:
+ rm -rf env
+ rm -rf docs/build
+ rm -f jami_*.tar.gz
+ rm -rf packages
+ rm -f Makefile.packaging.distro_targets
+ rm -f .docker-image-*
+ rm -rf client-qt/daemon/contrib/tarballs/*
diff --git a/extras/packaging/gnu-linux/docker/Dockerfile_debian_10 b/extras/packaging/gnu-linux/docker/Dockerfile_debian_10
new file mode 100644
index 000000000..7164588e9
--- /dev/null
+++ b/extras/packaging/gnu-linux/docker/Dockerfile_debian_10
@@ -0,0 +1,46 @@
+FROM debian:buster
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN apt-get clean
+RUN apt-get update -y
+RUN apt-get install -y -o Acquire::Retries=10 \
+ devscripts \
+ apt-utils \
+ equivs \
+ gcc-8 \
+ g++-8 \
+ clang \
+ clang-tools \
+ libarchive-dev \
+ wget
+
+ADD extras/packaging/gnu-linux/scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
+
+COPY extras/packaging/gnu-linux/rules/debian-qt/control /tmp/builddeps/debian/control
+RUN /opt/prebuild-package-debian.sh qt-deps
+
+COPY extras/packaging/gnu-linux/rules/debian/control /tmp/builddeps/debian/control
+RUN /opt/prebuild-package-debian.sh jami-deps
+
+RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 50
+RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 50
+RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10
+
+# Install CMake 3.19 for Qt 6
+ADD extras/packaging/gnu-linux/scripts/install-cmake.sh /opt/install-cmake.sh
+RUN /opt/install-cmake.sh
+RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
+RUN apt install nodejs -y
+
+ADD extras/packaging/gnu-linux/scripts/build-package-debian.sh /opt/build-package-debian.sh
+
+RUN wget https://ftp.gnu.org/gnu/binutils/binutils-2.37.tar.xz -q -O /tmp/binutils.xz \
+ && cd /tmp/ \
+ && tar xvf binutils.xz \
+ && cd binutils-2.37 \
+ && ./configure \
+ && make \
+ && make install
+
+CMD ["/opt/build-package-debian.sh"]
diff --git a/extras/packaging/gnu-linux/docker/Dockerfile_debian_11 b/extras/packaging/gnu-linux/docker/Dockerfile_debian_11
new file mode 100644
index 000000000..c033deba3
--- /dev/null
+++ b/extras/packaging/gnu-linux/docker/Dockerfile_debian_11
@@ -0,0 +1,26 @@
+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 \
+ python-is-python3 \
+ wget
+
+ADD extras/packaging/gnu-linux/scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
+
+COPY extras/packaging/gnu-linux/rules/debian-qt/control /tmp/builddeps/debian/control
+RUN /opt/prebuild-package-debian.sh qt-deps
+
+COPY extras/packaging/gnu-linux/rules/debian/control /tmp/builddeps/debian/control
+RUN /opt/prebuild-package-debian.sh jami-deps
+
+# Install CMake 3.19 for Qt 6
+ADD extras/packaging/gnu-linux/scripts/install-cmake.sh /opt/install-cmake.sh
+RUN /opt/install-cmake.sh
+
+ADD extras/packaging/gnu-linux/scripts/build-package-debian.sh /opt/build-package-debian.sh
+CMD ["/opt/build-package-debian.sh"]
diff --git a/extras/packaging/gnu-linux/docker/Dockerfile_debian_testing b/extras/packaging/gnu-linux/docker/Dockerfile_debian_testing
new file mode 100644
index 000000000..327d9d445
--- /dev/null
+++ b/extras/packaging/gnu-linux/docker/Dockerfile_debian_testing
@@ -0,0 +1,27 @@
+FROM debian:testing
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN apt-get clean
+RUN apt-get update --allow-releaseinfo-change && \
+ apt-get install -y -o Acquire::Retries=10 \
+ devscripts \
+ equivs \
+ python-is-python3 \
+ wget \
+ nasm
+
+ADD extras/packaging/gnu-linux/scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
+
+COPY extras/packaging/gnu-linux/rules/debian-qt/control /tmp/builddeps/debian/control
+RUN /opt/prebuild-package-debian.sh qt-deps
+
+COPY extras/packaging/gnu-linux/rules/debian/control /tmp/builddeps/debian/control
+RUN /opt/prebuild-package-debian.sh jami-deps
+
+# Install CMake 3.19 for Qt 6
+ADD extras/packaging/gnu-linux/scripts/install-cmake.sh /opt/install-cmake.sh
+RUN /opt/install-cmake.sh
+
+ADD extras/packaging/gnu-linux/scripts/build-package-debian.sh /opt/build-package-debian.sh
+CMD ["/opt/build-package-debian.sh"]
diff --git a/extras/packaging/gnu-linux/docker/Dockerfile_debian_unstable b/extras/packaging/gnu-linux/docker/Dockerfile_debian_unstable
new file mode 100644
index 000000000..54228657b
--- /dev/null
+++ b/extras/packaging/gnu-linux/docker/Dockerfile_debian_unstable
@@ -0,0 +1,28 @@
+FROM debian:unstable
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN apt-get clean
+RUN apt-get update && \
+ apt-get install -y -o Acquire::Retries=10 \
+ devscripts \
+ equivs \
+ python-is-python3 \
+ libdbus-1-dev \
+ libdbus-c++-dev \
+ wget
+
+ADD extras/packaging/gnu-linux/scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
+
+COPY extras/packaging/gnu-linux/rules/debian-qt/control /tmp/builddeps/debian/control
+RUN /opt/prebuild-package-debian.sh qt-deps
+
+COPY extras/packaging/gnu-linux/rules/debian/control /tmp/builddeps/debian/control
+RUN /opt/prebuild-package-debian.sh jami-deps
+
+# Install CMake 3.19 for Qt 6
+ADD extras/packaging/gnu-linux/scripts/install-cmake.sh /opt/install-cmake.sh
+RUN /opt/install-cmake.sh
+
+ADD extras/packaging/gnu-linux/scripts/build-package-debian.sh /opt/build-package-debian.sh
+CMD ["/opt/build-package-debian.sh"]
diff --git a/extras/packaging/gnu-linux/docker/Dockerfile_fedora_36 b/extras/packaging/gnu-linux/docker/Dockerfile_fedora_36
new file mode 100644
index 000000000..e8bc4dc8c
--- /dev/null
+++ b/extras/packaging/gnu-linux/docker/Dockerfile_fedora_36
@@ -0,0 +1,103 @@
+FROM fedora:36
+
+RUN dnf clean all
+
+RUN dnf install -y dnf-command\(builddep\) rpmdevtools && \
+ dnf install -y mock
+
+RUN dnf groupinstall -y "X Software Development"
+
+RUN dnf install -y \
+ git \
+ rpm-build \
+ tar \
+ make \
+ autoconf \
+ automake \
+ nasm \
+ speexdsp-devel \
+ pulseaudio-libs-devel \
+ libcanberra-devel \
+ libcurl-devel \
+ libtool \
+ mesa-libgbm-devel \
+ mesa-dri-drivers \
+ dbus-devel \
+ expat-devel \
+ pcre-devel \
+ yaml-cpp-devel \
+ dbus-c++-devel \
+ dbus-devel \
+ libXext-devel \
+ libXfixes-devel \
+ yasm \
+ python2.7 \
+ speex-devel \
+ gsm-devel \
+ chrpath \
+ check \
+ astyle \
+ uuid-c++-devel \
+ gettext-devel \
+ gcc-c++ \
+ which \
+ alsa-lib-devel \
+ systemd-devel \
+ libuuid-devel \
+ uuid-devel \
+ gnutls-devel \
+ nettle-devel \
+ opus-devel \
+ patch \
+ jsoncpp-devel \
+ libnatpmp-devel \
+ webkitgtk4-devel \
+ cryptopp-devel \
+ libva-devel \
+ libvdpau-devel \
+ msgpack-devel \
+ NetworkManager-libnm-devel \
+ openssl-devel \
+ clutter-devel \
+ clutter-gtk-devel \
+ libappindicator-gtk3-devel \
+ libnotify-devel \
+ libupnp-devel \
+ qrencode-devel \
+ libargon2-devel \
+ libsndfile-devel \
+ libdrm \
+ gperf \
+ bison \
+ clang \
+ clang-devel \
+ llvm-devel \
+ nodejs \
+ flex \
+ gstreamer1 gstreamer1-devel \
+ gstreamer1-plugins-base-devel \
+ gstreamer1-plugins-good \
+ gstreamer1-plugins-bad-free-devel \
+ nss-devel \
+ libxcb* \
+ libxkb* \
+ libX11-devel \
+ vulkan-devel \
+ libXrender-devel \
+ xcb-util-* \
+ xz \
+ xkeyboard-config \
+ libnotify \
+ wget \
+ libstdc++-static \
+ sqlite-devel \
+ perl-generators \
+ perl-English \
+ libxshmfence-devel \
+ ninja-build \
+ clang \
+ cmake
+
+ADD extras/packaging/gnu-linux/scripts/build-package-rpm.sh /opt/build-package-rpm.sh
+
+CMD ["/opt/build-package-rpm.sh"]
diff --git a/extras/packaging/gnu-linux/docker/Dockerfile_fedora_37 b/extras/packaging/gnu-linux/docker/Dockerfile_fedora_37
new file mode 100644
index 000000000..7a2ac9004
--- /dev/null
+++ b/extras/packaging/gnu-linux/docker/Dockerfile_fedora_37
@@ -0,0 +1,103 @@
+FROM fedora:37
+
+RUN dnf clean all
+
+RUN dnf install -y dnf-command\(builddep\) rpmdevtools && \
+ dnf install -y mock
+
+RUN dnf groupinstall -y "X Software Development"
+
+RUN dnf install -y \
+ git \
+ rpm-build \
+ tar \
+ make \
+ autoconf \
+ automake \
+ nasm \
+ speexdsp-devel \
+ pulseaudio-libs-devel \
+ libcanberra-devel \
+ libcurl-devel \
+ libtool \
+ mesa-libgbm-devel \
+ mesa-dri-drivers \
+ dbus-devel \
+ expat-devel \
+ pcre-devel \
+ yaml-cpp-devel \
+ dbus-c++-devel \
+ dbus-devel \
+ libXext-devel \
+ libXfixes-devel \
+ yasm \
+ python2.7 \
+ speex-devel \
+ gsm-devel \
+ chrpath \
+ check \
+ astyle \
+ uuid-c++-devel \
+ gettext-devel \
+ gcc-c++ \
+ which \
+ alsa-lib-devel \
+ systemd-devel \
+ libuuid-devel \
+ uuid-devel \
+ gnutls-devel \
+ nettle-devel \
+ opus-devel \
+ patch \
+ jsoncpp-devel \
+ libnatpmp-devel \
+ webkitgtk4-devel \
+ cryptopp-devel \
+ libva-devel \
+ libvdpau-devel \
+ msgpack-devel \
+ NetworkManager-libnm-devel \
+ openssl-devel \
+ clutter-devel \
+ clutter-gtk-devel \
+ libappindicator-gtk3-devel \
+ libnotify-devel \
+ libupnp-devel \
+ qrencode-devel \
+ libargon2-devel \
+ libsndfile-devel \
+ libdrm \
+ gperf \
+ bison \
+ clang \
+ clang-devel \
+ llvm-devel \
+ nodejs \
+ flex \
+ gstreamer1 gstreamer1-devel \
+ gstreamer1-plugins-base-devel \
+ gstreamer1-plugins-good \
+ gstreamer1-plugins-bad-free-devel \
+ nss-devel \
+ libxcb* \
+ libxkb* \
+ libX11-devel \
+ vulkan-devel \
+ libXrender-devel \
+ xcb-util-* \
+ xz \
+ xkeyboard-config \
+ libnotify \
+ wget \
+ libstdc++-static \
+ sqlite-devel \
+ perl-generators \
+ perl-English \
+ libxshmfence-devel \
+ ninja-build \
+ clang \
+ cmake
+
+ADD extras/packaging/gnu-linux/scripts/build-package-rpm.sh /opt/build-package-rpm.sh
+
+CMD ["/opt/build-package-rpm.sh"]
diff --git a/extras/packaging/gnu-linux/docker/Dockerfile_opensuse-leap_15.4 b/extras/packaging/gnu-linux/docker/Dockerfile_opensuse-leap_15.4
new file mode 100644
index 000000000..dce857ab6
--- /dev/null
+++ b/extras/packaging/gnu-linux/docker/Dockerfile_opensuse-leap_15.4
@@ -0,0 +1,109 @@
+FROM opensuse/leap:15.4
+
+RUN zypper refresh
+
+RUN zypper --non-interactive install -y \
+ dnf \
+ dnf-command\(builddep\) \
+ rpmdevtools \
+ Mesa-dri-devel Mesa-dri \
+ git \
+ gcc10 \
+ gcc10-c++ \
+ rpm-build \
+ tar \
+ make \
+ autoconf \
+ automake \
+ nasm \
+ speexdsp-devel \
+ libpulse-devel \
+ libcanberra-devel \
+ libcurl-devel \
+ libtool \
+ pcre-devel \
+ yaml-cpp-devel \
+ libdbus-c++-devel \
+ libXext-devel \
+ libXfixes-devel \
+ yasm \
+ speex-devel \
+ libgsm-devel \
+ chrpath \
+ check \
+ astyle \
+ gettext-devel \
+ which \
+ alsa-lib-devel \
+ systemd-devel \
+ libuuid-devel \
+ uuid-devel \
+ libopus-devel \
+ patch \
+ jsoncpp-devel \
+ webkit2gtk3-devel \
+ libcryptopp-devel \
+ libva-devel \
+ libvdpau-devel \
+ msgpack-devel \
+ clutter-devel \
+ openssl-devel \
+ clutter-gtk-devel \
+ libnma-devel \
+ libcryptopp-devel \
+ libdbus-c++-devel \
+ libexpat-devel \
+ gnome-icon-theme-symbolic \
+ libgsm-devel \
+ gtk3-devel \
+ libappindicator-devel \
+ sqlite-devel \
+ ffmpeg-4-libavutil-devel \
+ gtk3-devel\
+ qrencode-devel \
+ python3-python-dateutil \
+ libsndfile-devel \
+ libdrm \
+ gperf \
+ bison \
+ flex \
+ ffmpeg ffmpeg-devel \
+ nodejs12 \
+ mozilla-nss-devel \
+ python-xml \
+ libxcb* \
+ libxkb* \
+ libX11-devel \
+ libXrender-devel \
+ libfreetype6 \
+ xcb-util-image-devel \
+ xcb-util-keysyms-devel \
+ xcb-util-renderutil-devel \
+ xcb-util-wm-devel \
+ xorg-x11-devel \
+ xz \
+ xkeyboard-config \
+ libnotify \
+ argon2-devel \
+ libxshmfence-devel \
+ xproto-devel \
+ xcb-proto-devel \
+ xcb-* \
+ xorg-* \
+ vulkan-devel \
+ ninja \
+ gstreamer-devel \
+ gstreamer-plugins-good \
+ gstreamer-plugins-bad-devel \
+ gstreamer-plugins-base-devel \
+ cmake \
+ wget
+
+RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 50
+RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 50
+
+ADD extras/packaging/gnu-linux/scripts/build-package-rpm.sh /opt/build-package-rpm.sh
+
+ENV CC=gcc
+ENV CXX=g++
+CMD ["/opt/build-package-rpm.sh"]
diff --git a/extras/packaging/gnu-linux/docker/Dockerfile_snap b/extras/packaging/gnu-linux/docker/Dockerfile_snap
new file mode 100644
index 000000000..fe8277da9
--- /dev/null
+++ b/extras/packaging/gnu-linux/docker/Dockerfile_snap
@@ -0,0 +1,84 @@
+ARG RISK=edge
+ARG UBUNTU=focal
+
+FROM ubuntu:$UBUNTU as builder
+ARG RISK
+ARG UBUNTU
+RUN echo "Building snapcraft:$RISK in ubuntu:$UBUNTU"
+
+# Grab dependencies
+RUN apt-get update
+RUN apt-get dist-upgrade --yes
+RUN apt-get install --yes \
+ curl \
+ jq \
+ squashfs-tools
+
+# Grab the core snap (for backwards compatibility) from the stable channel and
+# unpack it in the proper place.
+RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/core' | jq '.download_url' -r) --output core.snap
+RUN mkdir -p /snap/core
+RUN unsquashfs -d /snap/core/current core.snap
+
+# Grab the core22 snap (which snapcraft uses as a base) from the stable channel
+# and unpack it in the proper place.
+RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/core22?channel='$RISK | jq '.download_url' -r) --output core22.snap
+RUN mkdir -p /snap/core22
+RUN unsquashfs -d /snap/core22/current core22.snap
+
+# Grab the core20 snap (which snapcraft uses as a base) from the stable channel
+# and unpack it in the proper place.
+RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/core20' | jq '.download_url' -r) --output core20.snap
+RUN mkdir -p /snap/core20
+RUN unsquashfs -d /snap/core20/current core20.snap
+
+# Grab the core20 snap (which snapcraft uses as a base) from the stable channel
+# and unpack it in the proper place.
+RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/lxd' | jq '.download_url' -r) --output lxd.snap
+RUN mkdir -p /snap/lxd
+RUN unsquashfs -d /snap/lxd/current lxd.snap
+
+# Grab the snapcraft snap from the $RISK channel and unpack it in the proper
+# place.
+RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/snapcraft?channel='$RISK | jq '.download_url' -r) --output snapcraft.snap
+RUN mkdir -p /snap/snapcraft
+RUN unsquashfs -d /snap/snapcraft/current snapcraft.snap
+
+# Fix Python3 installation: Make sure we use the interpreter from
+# the snapcraft snap:
+RUN unlink /snap/snapcraft/current/usr/bin/python3
+RUN ln -s /snap/snapcraft/current/usr/bin/python3.* /snap/snapcraft/current/usr/bin/python3
+RUN echo /snap/snapcraft/current/lib/python3.*/site-packages >> /snap/snapcraft/current/usr/lib/python3/dist-packages/site-packages.pth
+
+# Create a snapcraft runner (TODO: move version detection to the core of
+# snapcraft).
+RUN mkdir -p /snap/bin
+RUN echo "#!/bin/sh" > /snap/bin/snapcraft
+RUN snap_version="$(awk '/^version:/{print $2}' /snap/snapcraft/current/meta/snap.yaml | tr -d \')" && echo "export SNAP_VERSION=\"$snap_version\"" >> /snap/bin/snapcraft
+RUN echo 'exec "$SNAP/usr/bin/python3" "$SNAP/bin/snapcraft" "$@"' >> /snap/bin/snapcraft
+RUN chmod +x /snap/bin/snapcraft
+
+# Multi-stage build, only need the snaps from the builder. Copy them one at a
+# time so they can be cached.
+FROM ubuntu:$UBUNTU
+COPY --from=builder /snap/core /snap/core
+COPY --from=builder /snap/core22 /snap/core22
+COPY --from=builder /snap/core20 /snap/core20
+COPY --from=builder /snap/lxd /snap/lxd
+COPY --from=builder /snap/snapcraft /snap/snapcraft
+COPY --from=builder /snap/bin/snapcraft /snap/bin/snapcraft
+
+# Generate locale and install dependencies.
+RUN apt-get update && apt-get dist-upgrade --yes && apt-get install --yes snapd sudo apt-transport-https locales && locale-gen en_US.UTF-8
+
+# Set the proper environment.
+ENV LANG="en_US.UTF-8"
+ENV LANGUAGE="en_US:en"
+ENV LC_ALL="en_US.UTF-8"
+ENV PATH="/snap/bin:/snap/snapcraft/current/usr/bin:/snap/snapcraft/current/libexec/snapcraft/:$PATH"
+ENV SNAP="/snap/snapcraft/current"
+ENV SNAP_NAME="snapcraft"
+ENV SNAP_ARCH="amd64"
+
+ADD extras/packaging/gnu-linux/scripts/build-package-snap.sh /opt/build-package-snap.sh
+CMD ["/opt/build-package-snap.sh"]
diff --git a/extras/packaging/gnu-linux/docker/Dockerfile_ubuntu_18.04 b/extras/packaging/gnu-linux/docker/Dockerfile_ubuntu_18.04
new file mode 100644
index 000000000..fab4e9e6e
--- /dev/null
+++ b/extras/packaging/gnu-linux/docker/Dockerfile_ubuntu_18.04
@@ -0,0 +1,40 @@
+FROM ubuntu:18.04
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN apt-get clean
+RUN apt-get update && \
+ apt-get install -y -o Acquire::Retries=10 \
+ devscripts \
+ equivs \
+ curl \
+ gcc-8 \
+ g++-8 \
+ clang \
+ clang-tools \
+ libarchive-dev \
+ software-properties-common \
+ wget
+
+# nodejs (more recent version needed for building libqt-jami)
+RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
+RUN apt install nodejs -y
+
+ADD extras/packaging/gnu-linux/scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
+
+COPY extras/packaging/gnu-linux/rules/debian-qt/control /tmp/builddeps/debian/control
+RUN /opt/prebuild-package-debian.sh qt-deps
+
+COPY extras/packaging/gnu-linux/rules/debian/control /tmp/builddeps/debian/control
+RUN /opt/prebuild-package-debian.sh jami-deps
+
+RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 50
+RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 50
+RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 10
+
+# Install CMake 3.19 for Qt 6
+ADD extras/packaging/gnu-linux/scripts/install-cmake.sh /opt/install-cmake.sh
+RUN /opt/install-cmake.sh
+
+ADD extras/packaging/gnu-linux/scripts/build-package-debian.sh /opt/build-package-debian.sh
+CMD ["/opt/build-package-debian.sh"]
diff --git a/extras/packaging/gnu-linux/docker/Dockerfile_ubuntu_20.04 b/extras/packaging/gnu-linux/docker/Dockerfile_ubuntu_20.04
new file mode 100644
index 000000000..3c3aba5b7
--- /dev/null
+++ b/extras/packaging/gnu-linux/docker/Dockerfile_ubuntu_20.04
@@ -0,0 +1,29 @@
+FROM ubuntu:20.04
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN apt-get clean
+RUN apt-get update && \
+ apt-get install -y -o Acquire::Retries=10 \
+ devscripts \
+ equivs \
+ python-is-python3 \
+ wget
+
+ADD extras/packaging/gnu-linux/scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
+
+COPY extras/packaging/gnu-linux/rules/debian-qt/control /tmp/builddeps/debian/control
+RUN /opt/prebuild-package-debian.sh qt-deps
+
+COPY extras/packaging/gnu-linux/rules/debian/control /tmp/builddeps/debian/control
+RUN /opt/prebuild-package-debian.sh jami-deps
+
+# Install CMake 3.19 for Qt 6
+ADD extras/packaging/gnu-linux/scripts/install-cmake.sh /opt/install-cmake.sh
+RUN /opt/install-cmake.sh
+# nodejs
+RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
+RUN apt install nodejs -y
+
+ADD extras/packaging/gnu-linux/scripts/build-package-debian.sh /opt/build-package-debian.sh
+CMD ["/opt/build-package-debian.sh"]
diff --git a/extras/packaging/gnu-linux/docker/Dockerfile_ubuntu_22.04 b/extras/packaging/gnu-linux/docker/Dockerfile_ubuntu_22.04
new file mode 100644
index 000000000..dbff097d9
--- /dev/null
+++ b/extras/packaging/gnu-linux/docker/Dockerfile_ubuntu_22.04
@@ -0,0 +1,22 @@
+FROM ubuntu:22.04
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN apt-get clean
+RUN apt-get update && \
+ apt-get install -y -o Acquire::Retries=10 \
+ devscripts \
+ equivs \
+ python-is-python3 \
+ wget
+
+ADD extras/packaging/gnu-linux/scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
+
+COPY extras/packaging/gnu-linux/rules/debian-qt/control /tmp/builddeps/debian/control
+RUN /opt/prebuild-package-debian.sh qt-deps
+
+COPY extras/packaging/gnu-linux/rules/debian/control /tmp/builddeps/debian/control
+RUN /opt/prebuild-package-debian.sh jami-deps
+
+ADD extras/packaging/gnu-linux/scripts/build-package-debian.sh /opt/build-package-debian.sh
+CMD ["/opt/build-package-debian.sh"]
diff --git a/extras/packaging/gnu-linux/docker/Dockerfile_ubuntu_22.10 b/extras/packaging/gnu-linux/docker/Dockerfile_ubuntu_22.10
new file mode 100644
index 000000000..406cace07
--- /dev/null
+++ b/extras/packaging/gnu-linux/docker/Dockerfile_ubuntu_22.10
@@ -0,0 +1,22 @@
+FROM ubuntu:22.10
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN apt-get clean
+RUN apt-get update && \
+ apt-get install -y -o Acquire::Retries=10 \
+ devscripts \
+ equivs \
+ python-is-python3 \
+ wget
+
+ADD extras/packaging/gnu-linux/scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
+
+COPY extras/packaging/gnu-linux/rules/debian-qt/control /tmp/builddeps/debian/control
+RUN /opt/prebuild-package-debian.sh qt-deps
+
+COPY extras/packaging/gnu-linux/rules/debian/control /tmp/builddeps/debian/control
+RUN /opt/prebuild-package-debian.sh jami-deps
+
+ADD extras/packaging/gnu-linux/scripts/build-package-debian.sh /opt/build-package-debian.sh
+CMD ["/opt/build-package-debian.sh"]
diff --git a/extras/packaging/gnu-linux/guix/channels.scm b/extras/packaging/gnu-linux/guix/channels.scm
new file mode 100644
index 000000000..6c333f7eb
--- /dev/null
+++ b/extras/packaging/gnu-linux/guix/channels.scm
@@ -0,0 +1,5 @@
+;;; Tested with this revision of GNU Guix.
+(list (channel
+ (inherit %default-guix-channel)
+ (commit
+ "f5cc7d03a778f20e2ad487e2c17cc8853bc871f0"))) ;2022-08-01
diff --git a/extras/packaging/gnu-linux/guix/guix-pack-deb.postinst b/extras/packaging/gnu-linux/guix/guix-pack-deb.postinst
new file mode 100644
index 000000000..4c6c8ca68
--- /dev/null
+++ b/extras/packaging/gnu-linux/guix/guix-pack-deb.postinst
@@ -0,0 +1,97 @@
+#!/bin/sh
+# Copyright (C) 2021 Savoir-faire Linux Inc.
+#
+# Author: Maxim Cournoyer
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+set -e
+
+# Fingerprint: A295D773307D25A33AE72F2F64CD5FA175348F84
+jami_key="\
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v2
+
+mQENBFVSdlcBCAC9zC1rp12O2K08PGozI14Y+t4qC931eHicvkuEMF1B9gAhjdRF
+aIJS+UXwgQzoamDIHenxz1Q3fXUjKCMXytjGymB/0LUKccSbtH0Rcsl8kZ2z57KN
+E+GLS7SvlP93ZOxco7eAEBWF/fvMrCsm10sNI6bW7UK0bgql9iIetd6Wrp9xXFVs
+gmoV8Av714OlswsthSNtN+xQls3ozQ/dVGsOkZEyDbBzi88/rQEtuIDztTSWyD0V
+x7WaY5+mVRwsJKzyPlgvsXpbP7A41IFykeOzPKh+vYz3k7dcLIRdOwse79oT2RXt
+2VYEyTyTZIQlCJjGNTJYsU7GVffU4LnI7p/bABEBAAG0QFJpbmcgLSBTYXZvaXIt
+RmFpcmUgTGludXgsIEluYyA8cmluZ0BsaXN0cy5zYXZvaXJmYWlyZWxpbnV4Lm5l
+dD6JATkEEwEIACMFAlVSdlcCGwMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAK
+CRBkzV+hdTSPhMqSB/9aaKXVByoE7zwPM8DDSntS/jYhhaV1CcZ78WeC1LY2UnHL
+R/yvABnDMikgqbMHBDu1R9dnjgZNntp7p0blxcT6ScxdZ6FpMZG6ZW5YNZIVctnF
+jdExStcdpcbbycW8GeCmQdVcKLBl8G55mick02ayVNOH5ETtWahPwBvMWk5hSaH3
+E18yvnmdqa9nCEST4UKvBOpmn58mwJDIR2YLdEFcL8z4FkxQUNkx/hiHSn+YLorZ
+H3iBrf9y9vSYhQ5pxx7seWkoaGAQBgfktRCUKvVY6E1oSZ/WR1WsR1ftDO/RD0E8
+APKzibVynUEQrCcQX16uDOa/YgavVkts9HmR7Vf7iQEcBBABCAAGBQJVUoJZAAoJ
+EFZ3uE+o8K8j0RkH/2sv4L3X0hPIwAzf3CUJZQuHihUOPRAoru5RqW/5nWqsroa1
+WChJq79uDEecDAizTA1MvaTFmLxTjCkJso+5UHMSHi6LARvYXSOeBPFizEJT4qZZ
+CXti5zh9d5z1u6L986mrnArA39IZ2F+9wV2q0VIDnq1Tt6+cJ745zSeZmbM6jip4
+oEBsKbCkAhq78sqCc7DIilsGbd2tgrLsh3fitvamEJCTCYKdDMog3TP0+EekQTA2
+Qp4jG0Uf7Gg1YvDDcsawXyNDrMBXEFPVhBNnRisX+YQBRWgDE58+fpsQfeTkblL5
+UaLWhDGlyfAc1ebL3InzhUWJswjt0BN3GPoP55m5AQ0EVVJ2VwEIAMXhg0w1IM0C
+rGXMGayaJ3EWd9YXkqq0sAN7b75tD0cOimyPNafnzChG9//3tt82aPRm8fG5Lk5U
+fwCS2MSt2Ml8UZeujmEBnvU9hsJBWcGgzXhtBQwZqzmV2vQg8436nTFY5L24TFBc
+QNOUJNzSy/dqps0SxcYleE57o24KHlW6ICBaEhz0JoZHv5+7GtYz6XN2D7pkwTPY
+UIahyt4dY3geFrkuMzZdTS4qyFb8EE/Ypi/WgewO9ib53kt7FBrxmm0l+d9GR4jH
+CKGqaYjm8xzTsNa3m2C0Cf/C13bOaQVicgntfQ32IjjZdaDMlRLQluYNQ0ETA1FE
+9+EVvrQYZ+kAEQEAAYkBHwQYAQgACQUCVVJ2VwIbDAAKCRBkzV+hdTSPhMIaB/9D
+CrIZBDy7YOK3gdnNm57jemJRz6Cum7RTUiqCQ8ivSmEgv1KmMIqMpjmnKKP43iHO
+mR4i7XDml6RBGynPys6cQcAlBWSuhOv9PGpRCaGyjJ4vmQUsYhyD/+tCDZVdBuGg
+CxteSMbawxtMHESqX7dDlctc+njDjBcbcGj73sj36qoFIjorjymZlT5IdK39oXVM
+Hi1TssiWPOU0hQgn4BIreYnEZUA6xuFX10C7k2DVRFZrXF7lpNgPQ8eNZTnQBIuw
+HUFCGSHO3/kzxSlkE1PBUX3IZ8PSFijyopBnWUhlSXuyRjte8OR7Fl/Rlf0IaOD1
+4sRdAfS333T4Uifq4uOu
+=s2aQ
+-----END PGP PUBLIC KEY BLOCK-----"
+
+# System paths and generated variables.
+apt_file=/etc/apt/sources.list.d/jami.list
+update_manager_path=/etc/update-manager/release-upgrades.d/
+jami_update_manager_id=jami
+jami_update_manager_cfg=${jami_update_manager_id}.cfg
+update_manager_cfg_path=$update_manager_path/$jami_update_manager_cfg
+jami_repo_url=https://dl.jami.net/nightly/guix-deb-pack
+
+case "$1" in
+ configure)
+ command -v apt-key > /dev/null \
+ || (echo 'could not run postinst: apt-key is missing' && exit 1)
+
+ # Add the key to the trusted keyring.
+ echo "$jami_key" | apt-key add - > /dev/null 2>&1
+
+ # Additionally, if update manager is installed we inform it about
+ # the repository so it doesn't get scrapped after system updates
+ if [ -d /etc/update-manager ]; then
+ mkdir -p "$update_manager_path"
+ cat > "$update_manager_cfg_path" < "$apt_file"
+ ;;
+esac
+
+# Local Variables:
+# mode: sh
+# End:
diff --git a/extras/packaging/gnu-linux/guix/guix-pack-manifest.scm b/extras/packaging/gnu-linux/guix/guix-pack-manifest.scm
new file mode 100644
index 000000000..8337247f6
--- /dev/null
+++ b/extras/packaging/gnu-linux/guix/guix-pack-manifest.scm
@@ -0,0 +1,98 @@
+;;; Copyright (C) 2021 Savoir-faire Linux Inc.
+;;;
+;;; Author: Maxim Cournoyer
+;;;
+;;; This program is free software: you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation, either version 3 of the License, or
+;;; (at your option) any later version.
+;;;
+;;; This program is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with this program. If not, see .
+;;;
+;;; This GNU Guix manifest is used along the Makefile to build the
+;;; latest Jami as a Guix pack.
+
+(use-modules (gnu packages certs)
+ (gnu packages jami)
+ (gnu packages python)
+ (guix base32)
+ (guix gexp)
+ (guix packages)
+ (guix transformations)
+ (guix store)
+ (guix utils))
+
+;;; XXX: Below is a rather strenuous way to specify something that
+;;; would have been nicer if it could have been specified via:
+;;;
+;;; --with-source=libjami=$(RELEASE_TARBALL_FILENAME) \
+;;; --with-source=jami=$(RELEASE_TARBALL_FILENAME) in the Makefile.
+;;;
+;;; The above doesn't currently rewrite the dependency graph
+;;; recursively, hence why it is not sufficient.
+
+(define %release-version (getenv "RELEASE_VERSION"))
+
+(define %release-file-name (getenv "RELEASE_TARBALL_FILENAME"))
+
+(unless %release-version
+ (error "RELEASE_VERSION environment variable is not set"))
+
+(unless %release-file-name
+ (error "RELEASE_TARBALL_FILENAME environment variable is not set"))
+
+;;; Add the source tarball to the store and retrieve its hash. The
+;;; hash is useful to turn the origin record into a fixed-output
+;;; derivation, which means the Jami packages will only get built once
+;;; for a given source tarball.
+(define %release-file-hash
+ (with-store store
+ (let ((source (add-to-store store (basename %release-file-name) #f
+ "sha256" %release-file-name)))
+ (bytevector->nix-base32-string (query-path-hash store source)))))
+
+(define %jami-sources/latest
+ (origin
+ (inherit (@@ (gnu packages jami) %jami-sources))
+ (uri %release-file-name)
+ (sha256 %release-file-hash)))
+
+(define (with-latest-sources name)
+ (options->transformation
+ `((with-source . ,(format #f "~a@~a=~a" name
+ %release-version %release-file-name)))))
+
+(define libjami/latest ((with-latest-sources "libjami") libjami))
+
+(define with-libjami/latest
+ (package-input-rewriting `((,libjami . ,libjami/latest))))
+
+;;; Bundling the TLS certificates with Jami enables a fully
+;;; functional, configuration-free experience, useful in the context
+;;; of Guix packs.
+(define jami-with-certs
+ (package/inherit jami
+ (inputs (modify-inputs (package-inputs jami)
+ (append nss-certs)))
+ (arguments
+ (substitute-keyword-arguments (package-arguments jami)
+ ((#:phases phases '%standard-phases)
+ #~(modify-phases #$phases
+ (add-after 'qt-wrap 'wrap-ssl-cert-dir
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (substitute* (search-input-file outputs "bin/jami")
+ (("^exec.*" exec-line)
+ (format #f "export SSL_CERT_DIR=~a~%"
+ (search-input-directory inputs "etc/ssl/certs")
+ exec-line)))))))))))
+
+(define jami-with-certs/latest
+ ((with-latest-sources "jami") jami-with-certs))
+
+(packages->manifest (list jami-with-certs/latest))
diff --git a/extras/packaging/gnu-linux/guix/manifest.scm b/extras/packaging/gnu-linux/guix/manifest.scm
new file mode 100644
index 000000000..59f2a831f
--- /dev/null
+++ b/extras/packaging/gnu-linux/guix/manifest.scm
@@ -0,0 +1,116 @@
+;;; To use with the GNU Guix package manager.
+;;; Available at https://guix.gnu.org/.
+;;;
+;;; Commentary:
+;;;
+;;; A full-blown development environment that can be used to build the
+;;; whole project. The sensitive (i.e., patched) dependencies are
+;;; consciously omitted from this list so that the bundled libraries
+;;; are the ones used, which is usually what is desired for
+;;; development purposes.
+
+;;; The build.py script makes use of it to build Jami in a Linux
+;;; container with the dependencies below when Guix is detected (and
+;;; no /etc/os-release file exists) or when explicitly specified,
+;;; e.g.:
+;;;
+;;; $ ./build.py --distribution=guix --install
+;;;
+;;; It can also be invoked directly to spawn a development environment, like so:
+;;;
+;;; $ guix shell --pure --manifest=guix/manifest.scm
+
+(specifications->manifest
+ (list
+ ;; Minimal requirements of the daemon contrib build system.
+ "coreutils"
+ "gcc-toolchain"
+ "git-minimal"
+ "grep"
+ "gzip"
+ "make"
+ "nss-certs"
+ "pkg-config"
+ "python"
+ "sed"
+ "tar"
+ "util-linux"
+ "wget"
+ "xz"
+
+ ;; For the daemon and its contribs.
+ "alsa-lib"
+ "autoconf"
+ "automake"
+ "bash"
+ "bzip2"
+ "cmake"
+ "dbus"
+ ;; Bundled because broken with GCC 7 upstream (unmaintained). When
+ ;; attempting to use it, it would cause confusing errors such as
+ ;; "ld: ../src/.libs/libring.a(libupnpcontrol_la-upnp_context.o): in
+ ;; function `jami::upnp::UPnPContext::updateMappingList(bool)':
+ ;; upnp_context.cpp:(.text+0xa4be): undefined reference to
+ ;; `std::__cxx11::basic_ostringstream,
+ ;; std::allocator >::basic_ostringstream()'
+ ;;"dbus-c++" ;for dbusxx-xml2cpp
+ "diffutils"
+ "doxygen"
+ "eudev" ;udev library
+ "expat"
+ "findutils"
+ "gawk"
+ "gettext"
+ "gnutls"
+ ;;"ffmpeg" ;bundled because patched
+ "gmp"
+ "gsm"
+ "gtk-doc"
+ "http-parser"
+ "jsoncpp"
+ "libarchive"
+ "libgit2"
+ "libnatpmp"
+ "libupnp"
+ "libsecp256k1"
+ "libtool"
+ "libva" ;vaapi
+ "libvdpau"
+ "libx264"
+ "nasm"
+ "nettle"
+ "openssl"
+ "opus"
+ "patch"
+ "pcre"
+ "perl"
+ ;;"pjproject" ;bundled because patched
+ "pulseaudio"
+ "speex"
+ "speexdsp"
+ "which"
+ "yaml-cpp"
+ "yasm"
+
+ ;; For the Qt client.
+ "libxkbcommon"
+ "network-manager" ;libnm
+ "qrencode"
+ "qtbase"
+ "qt5compat"
+ "qtdeclarative"
+ "qtmultimedia"
+ "qtnetworkauth"
+ "qtpositioning"
+ "qtsvg"
+ "qttools"
+ "qtwebchannel"
+ "qtwebengine"
+ "vulkan-headers"
+
+ ;; For tests and debugging.
+ "file"
+ "gdb"
+ "googletest"
+ "ltrace"
+ "strace"))
diff --git a/extras/packaging/gnu-linux/guix/minimal-manifest.scm b/extras/packaging/gnu-linux/guix/minimal-manifest.scm
new file mode 100644
index 000000000..c970c696b
--- /dev/null
+++ b/extras/packaging/gnu-linux/guix/minimal-manifest.scm
@@ -0,0 +1,27 @@
+;;; To use with the GNU Guix package manager.
+;;; Available at https://guix.gnu.org/.
+;;;
+;;; Commentary:
+;;;
+;;; This Guix manifest can be used to create an environment that
+;;; satisfies the minimal requirements of the the contrib build system
+;;; of the daemon. For example, it is used by the CI to build the
+;;; source release tarball in a controlled environment.
+
+(specifications->manifest
+ (list
+ "bash"
+ "coreutils"
+ "gcc-toolchain"
+ "git-minimal"
+ "grep"
+ "gzip"
+ "make"
+ "nss-certs"
+ "pkg-config"
+ "python"
+ "sed"
+ "tar"
+ "util-linux"
+ "wget"
+ "xz"))
diff --git a/extras/packaging/gnu-linux/rules/debian-qt/compat b/extras/packaging/gnu-linux/rules/debian-qt/compat
new file mode 100644
index 000000000..9a037142a
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/debian-qt/compat
@@ -0,0 +1 @@
+10
\ No newline at end of file
diff --git a/extras/packaging/gnu-linux/rules/debian-qt/control b/extras/packaging/gnu-linux/rules/debian-qt/control
new file mode 100644
index 000000000..d337bfbd6
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/debian-qt/control
@@ -0,0 +1,390 @@
+Source: libqt-jami
+Section: libs
+Priority: optional
+Maintainer: The Jami project
+Rules-Requires-Root: no
+Standards-Version: 4.5.1
+Build-Depends: debhelper (>= 9),
+# =====================================================
+# the following list of deps was gathered with help
+# from https://salsa.debian.org/qt-kde-team/qt repos
+# =====================================================
+#
+# ======
+# qtbase
+# ======
+# debhelper-compat (= 13),
+# debhelper,
+ default-libmysqlclient-dev,
+ dh-exec,
+# dpkg-dev (>= 1.17.14),
+ dpkg-dev,
+ firebird-dev [kfreebsd-any linux-any],
+ freetds-dev,
+ libasound2-dev [linux-any],
+ libatspi2.0-dev,
+ libcups2-dev,
+ libdbus-1-dev,
+ libdouble-conversion-dev,
+ libdrm-dev [linux-any],
+ libfontconfig1-dev,
+ libfreetype6-dev,
+ libgbm-dev [linux-any kfreebsd-any],
+ libgl-dev,
+# libgles-dev, (not available in buster)
+ libglib2.0-dev,
+# libglu1-mesa-dev | libglu-dev,
+ libgtk-3-dev,
+ libharfbuzz-dev (>= 1.6.0~),
+ libicu-dev,
+ libinput-dev [linux-any],
+ libjpeg-dev,
+ libkrb5-dev,
+# libmd4c-dev, (not in buster)
+ libmtdev-dev [linux-any],
+ libpcre2-dev,
+ libpng-dev,
+ libpq-dev,
+ libproxy-dev,
+ libpulse-dev,
+ libsqlite3-dev,
+ libssl-dev,
+ libudev-dev [linux-any],
+ libvulkan-dev [linux-any],
+ libx11-dev,
+ libx11-xcb-dev,
+ libxcb-glx0-dev,
+ libxcb-icccm4-dev,
+ libxcb-image0-dev,
+ libxcb-keysyms1-dev,
+ libxcb-randr0-dev,
+ libxcb-render-util0-dev,
+ libxcb-render0-dev,
+ libxcb-shape0-dev,
+ libxcb-shm0-dev,
+ libxcb-sync-dev,
+ libxcb-util0-dev,
+ libxcb-xfixes0-dev,
+ libxcb-xinerama0-dev,
+ libxcb-xinput-dev,
+ libxcb-xkb-dev,
+ libxcb1-dev,
+ libxext-dev,
+ libxi-dev,
+ libxkbcommon-dev,
+ libxkbfile-dev,
+ libxkbcommon-x11-dev,
+ libxrender-dev,
+ libzstd-dev,
+ libxshmfence-dev,
+ pkg-config,
+# pkg-kde-tools (>= 0.15.17~),
+ publicsuffix,
+# qt5-qmake-bin ,
+ unixodbc-dev,
+ zlib1g-dev,
+# =============
+# qtdeclarative
+# =============
+# debhelper-compat (= 13),
+# dpkg-dev (>= 1.20.0),
+ libgl1-mesa-dri,
+# pkg-kde-tools (>= 0.15.17~),
+ python3:any,
+# qtbase5-private-dev (>= 5.15.2+dfsg~),
+ xauth ,
+ xvfb ,
+# ==================
+# qtgraphicaleffects
+# ==================
+# debhelper-compat (= 13),
+# dpkg-dev (>= 1.16.1),
+# pkg-kde-tools (>= 0.15.26~),
+# qml-module-qtquick-window2 (>= 5.15.2+dfsg~),
+# qml-module-qtquick2 (>= 5.15.2+dfsg~),
+# qtbase5-dev (>= 5.15.2+dfsg~),
+# qtbase5-private-dev (>= 5.15.2+dfsg~),
+# qtdeclarative5-dev-tools (>= 5.15.2+dfsg~),
+# qtdeclarative5-private-dev (>= 5.15.2+dfsg~),
+# ============
+# qtmultimedia
+# ============
+# debhelper-compat (= 13),
+# libasound2-dev [linux-any],
+ libgstreamer-plugins-base1.0-dev,
+ libgstreamer1.0-dev,
+ libopenal-dev,
+# libpulse-dev,
+# libqt5opengl5-dev (>= 5.15.2+dfsg~),
+# pkg-kde-tools,
+# qml-module-qtquick2,
+# qml-module-qttest,
+# qtbase5-dev (>= 5.15.2+dfsg~),
+# qtbase5-private-dev (>= 5.15.2+dfsg~),
+# qtdeclarative5-dev (>= 5.15.2+dfsg~),
+# xauth ,
+# xvfb ,
+# zlib1g-dev,
+# =========================
+# qtlocation (for qtwebkit)
+# =========================
+# debhelper-compat (= 13),
+ libboost-dev,
+# libicu-dev,
+ libprotozero-dev (>= 1.5.2),
+# libqt5opengl5-dev (>= 5.15.2+dfsg~),
+# pkg-kde-tools,
+# qml-module-qttest (>= 5.15.2+dfsg~),
+# qtbase5-private-dev (>= 5.15.2+dfsg~),
+# qtdeclarative5-private-dev (>= 5.15.2+dfsg~),
+ rapidjson-dev (>= 1.1.0),
+# xauth ,
+# xvfb ,
+# zlib1g-dev,
+# ===============
+# qtquickcontrols
+# ===============
+# debhelper-compat (= 13),
+# dpkg-dev (>= 1.17.14),
+# pkg-kde-tools (>= 0.15.26~),
+# qml-module-qt-labs-folderlistmodel (>= 5.15.2+dfsg~),
+# qml-module-qt-labs-settings (>= 5.15.2+dfsg~),
+# qml-module-qtgraphicaleffects (>= 5.15.2~),
+# qml-module-qtqml (>= 5.15.2+dfsg~),
+# qml-module-qtqml-models2 (>= 5.15.2+dfsg~),
+# qml-module-qtquick-layouts (>= 5.15.2+dfsg~),
+# qml-module-qtquick-window2 (>= 5.15.2+dfsg~),
+# qml-module-qttest (>= 5.15.2+dfsg~),
+# qtbase5-dev (>= 5.15.2+dfsg~),
+# qtbase5-private-dev (>= 5.15.2+dfsg~),
+# qtdeclarative5-dev-tools (>= 5.15.2+dfsg~),
+# qtdeclarative5-private-dev (>= 5.15.2+dfsg~),
+# xauth ,
+# xvfb ,
+# ========================
+# qtsensors (for qtwebkit)
+# ========================
+# debhelper-compat (= 13),
+# pkg-kde-tools,
+# qtbase5-private-dev (>= 5.15.2+dfsg~),
+# qtdeclarative5-dev (>= 5.15.2+dfsg~),
+# xauth ,
+# xvfb ,
+# ================
+# qtquickcontrols2
+# ================
+# debhelper-compat (= 13),
+# dpkg-dev (>= 1.16.1),
+# pkg-kde-tools (>= 0.15.29~),
+# qml-module-qtgraphicaleffects (>= 5.15.2~),
+# qml-module-qtquick-layouts (>= 5.15.2+dfsg~),
+# qml-module-qtquick-window2 (>= 5.15.2+dfsg~),
+# qml-module-qttest (>= 5.15.2+dfsg~),
+# qtbase5-dev (>= 5.15.2+dfsg~),
+# qtbase5-private-dev (>= 5.15.2+dfsg~),
+# qtdeclarative5-dev-tools (>= 5.15.2+dfsg~),
+# qtdeclarative5-private-dev (>= 5.15.2+dfsg~),
+# xauth ,
+# xvfb ,
+# =====
+# qtsvg
+# =====
+ dbus,
+# debhelper-compat (= 13),
+# dpkg-dev (>= 1.17.14),
+# libqt5opengl5-dev (>= 5.15.2+dfsg~),
+# pkg-kde-tools (>= 0.15.17),
+# qtbase5-dev (>= 5.15.2+dfsg~),
+# qtbase5-private-dev (>= 5.15.2+dfsg~),
+# zlib1g-dev,
+# =======
+# qttools
+# =======
+# debhelper-compat (= 13),
+ libclang-dev (>= 1:3.9~) [amd64 arm64 armel armhf hurd-i386 i386 mips mips64 mips64el mips64r6 mips64r6el mipsel mipsr6 mipsr6el powerpc ppc64 ppc64el riscv64 s390x sparc64],
+# libqt5opengl5-dev (>= 5.15.2+dfsg~),
+# libqt5sql5-sqlite (>= 5.15.2+dfsg~),
+# libqt5webkit5-dev (>= 5.212.0~alpha4-8~) [alpha amd64 arm64 armel armhf i386 mips64el mipsel ppc64 ppc64el riscv64 s390x sh4 x32],
+ llvm-dev (>= 1:3.9~) [amd64 arm64 armel armhf hurd-i386 i386 mips mips64 mips64el mips64r6 mips64r6el mipsel mipsr6 mipsr6el powerpc ppc64 ppc64el riscv64 s390x sparc64],
+# pkg-kde-tools,
+# qtbase5-private-dev (>= 5.15.2+dfsg~),
+# qtdeclarative5-private-dev (>= 5.15.2+dfsg~),
+# zlib1g-dev,
+# =========
+# qtwayland
+# =========
+# dbus ,
+# debhelper-compat (= 13),
+# dpkg-dev (>= 1.17.14),
+ libegl1-mesa-dev,
+ libfontconfig1-dev,
+# libglib2.0-dev,
+# libinput-dev,
+# libmtdev-dev [linux-any],
+# libudev-dev [linux-any],
+ libwayland-dev (>= 1.8.0),
+ libwayland-egl1-mesa | libwayland-egl1,
+ libxcomposite-dev,
+# libxkbcommon-dev (>= 0.2.0),
+# libxrender-dev,
+# pkg-config,
+# pkg-kde-tools,
+# qtbase5-dev (>= 5.15.2+dfsg~),
+# qtbase5-dev:native (>= 5.15.2+dfsg~),
+# qtbase5-private-dev (>= 5.15.2+dfsg~),
+# qtdeclarative5-private-dev (>= 5.15.2+dfsg~),
+# xauth ,
+# xvfb ,
+# ============
+# qtwebchannel
+# ============
+# debhelper-compat (= 13),
+# libqt5websockets5-dev (>= 5.15.2~),
+# pkg-kde-tools,
+# qml-module-qttest (>= 5.15.2+dfsg~),
+# qtbase5-dev (>= 5.15.2+dfsg~),
+# qtbase5-private-dev (>= 5.15.2+dfsg~),
+# qtdeclarative5-dev (>= 5.15.2+dfsg~),
+# ===========
+# qtwebengine
+# ===========
+# binutils (>= 2.32-8~),
+ binutils,
+ bison,
+ chrpath,
+ closure-compiler,
+# debhelper-compat (= 13),
+ flex,
+ gperf,
+ khronos-api,
+# libasound2-dev [linux-any],
+ libavcodec-dev (>= 7:3.4.8~),
+ libavformat-dev (>= 7:3.4.8~),
+ libavutil-dev (>= 7:3.4.8~),
+ libcap-dev [linux-any],
+# libdbus-1-dev,
+# libegl1-mesa-dev,
+ libevent-dev,
+ libflac-dev,
+# libfontconfig1-dev,
+# libgl-dev (>= 1.3) [!armel !armhf],
+# libgl1-mesa-dri,
+# libgles-dev [armel armhf],
+# libglib2.0-dev,
+ libglu1-mesa-dev [!armel !armhf] | libglu-dev [!armel !armhf],
+# libgstreamer-plugins-base1.0-dev,
+# libgstreamer1.0-dev,
+# libharfbuzz-dev,
+# libicu-dev (>= 64~),
+# libjpeg-dev,
+ libjsoncpp-dev,
+ liblcms2-dev,
+ libminizip-dev,
+ libnss3-dev,
+# libopus-dev (>= 1.3.1),
+ libopus-dev,
+ libpci-dev,
+# libpng-dev,
+ libprotobuf-dev,
+# libpulse-dev,
+# libqt5opengl5-dev (>= 5.15.2+dfsg~),
+# libqt5svg5-dev (>= 5.15.2~),
+# libqt5webchannel5-dev (>= 5.15.2~),
+ libre2-dev,
+ libsnappy-dev,
+# libsqlite3-dev,
+ libusb-1.0-0-dev,
+# libvpx-dev (>= 1.8),
+ libvpx-dev,
+ libwebp-dev,
+# libx11-xcb-dev,
+ libxcb-dri3-dev,
+# libxcomposite-dev,
+ libxcursor-dev,
+ libxdamage-dev,
+ libxml2-dev,
+ libxnvctrl-dev,
+ libxrandr-dev,
+# libxrender-dev,
+ libxslt1-dev,
+ libxss-dev,
+ libxtst-dev,
+ mesa-common-dev,
+ ninja-build,
+ nodejs (>= 10.19),
+# pkg-config,
+# pkg-kde-tools,
+ protobuf-compiler,
+ python2 | python,
+# qtbase5-dev (>= 5.15.2+dfsg~),
+# qtbase5-private-dev (>= 5.15.2+dfsg~),
+# qtdeclarative5-private-dev (>= 5.15.2+dfsg~),
+# qtpositioning5-dev (>= 5.15.2+dfsg~),
+# qtquickcontrols2-5-dev (>= 5.15.2+dfsg~),
+# qttools5-dev (>= 5.15.2~),
+ re2c,
+ ruby,
+# xauth,
+# xvfb,
+ yasm [amd64 i386],
+ yui-compressor,
+# =======================================
+# qtwebkit (currently mainly for qttools)
+# =======================================
+# bison,
+ cmake (>= 2.8.12),
+# debhelper-compat (= 13),
+# flex,
+# gperf,
+# libfontconfig1-dev,
+ libgl1-mesa-dev [!armel !armhf] | libgl-dev [!armel !armhf],
+ libgles2-mesa-dev [armel armhf] | libgles2-dev [armel armhf],
+# libglib2.0-dev,
+# libglu1-mesa-dev [!armel !armhf] | libglu-dev [!armel !armhf],
+# libgstreamer-plugins-base1.0-dev,
+# libgstreamer1.0-dev,
+ libhyphen-dev,
+# libicu-dev,
+# libjpeg-dev,
+# libpng-dev,
+# libqt5opengl5-dev (>= 5.15.2+dfsg~),
+# libqt5sensors5-dev (>= 5.15.2~),
+# libqt5webchannel5-dev (>= 5.15.2~),
+# libsqlite3-dev,
+# libwebp-dev,
+ libwoff-dev,
+ libclang-dev,
+ gperf,
+ x11-utils,
+# libxcomposite-dev,
+# libxml2-dev,
+# libxrender-dev,
+# libxslt1-dev,
+# ninja-build,
+# pkg-config,
+# pkg-kde-tools (>= 0.6.4),
+# python3:native,
+# qtbase5-private-dev (>= 5.15.2+dfsg~),
+# qtdeclarative5-private-dev (>= 5.15.2+dfsg~),
+# qtpositioning5-dev (>= 5.15.2+dfsg~),
+# ruby:native,
+# xauth ,
+# xvfb ,
+# ===============================
+# qtwebsockets (for qtwebchannel)
+# ===============================
+# debhelper-compat (= 13),
+# pkg-kde-tools,
+# qml-module-qtquick2 (>= 5.15.2+dfsg~),
+# qml-module-qttest (>= 5.15.2+dfsg~),
+# qtbase5-private-dev (>= 5.15.2+dfsg~),
+# qtdeclarative5-dev (>= 5.15.2+dfsg~),
+# qtdeclarative5-private-dev (>= 5.15.2+dfsg~),
+# xauth,
+# xvfb,
+
+
+Package: libqt-jami
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Custom build of Qt framework used by the Jami Qt client.
diff --git a/extras/packaging/gnu-linux/rules/debian-qt/libqt-jami-env.sh b/extras/packaging/gnu-linux/rules/debian-qt/libqt-jami-env.sh
new file mode 100755
index 000000000..6324f0fed
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/debian-qt/libqt-jami-env.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+
+QT_JAMI_PREFIX=/usr/lib/libqt-jami
+
+export PATH="${QT_JAMI_PREFIX}/bin:${PATH}"
+export LD_LIBRARY_PATH="${QT_JAMI_PREFIX}/lib:${LD_LIBRARY_PATH}"
+export PKG_CONFIG_PATH="${QT_JAMI_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}"
+export CMAKE_PREFIX_PATH="${QT_JAMI_PREFIX}/lib/cmake:${CMAKE_PREFIX_PATH}"
diff --git a/extras/packaging/gnu-linux/rules/debian-qt/libqt-jami.install b/extras/packaging/gnu-linux/rules/debian-qt/libqt-jami.install
new file mode 100644
index 000000000..39543c60b
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/debian-qt/libqt-jami.install
@@ -0,0 +1,2 @@
+usr/lib/libqt-jami
+debian/libqt-jami-env.sh usr/lib/libqt-jami/bin/
diff --git a/extras/packaging/gnu-linux/rules/debian-qt/patches/0001-qtbug-101201-fatal-error-getcurrenkeyboard.patch b/extras/packaging/gnu-linux/rules/debian-qt/patches/0001-qtbug-101201-fatal-error-getcurrenkeyboard.patch
new file mode 100644
index 000000000..90a0bfaec
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/debian-qt/patches/0001-qtbug-101201-fatal-error-getcurrenkeyboard.patch
@@ -0,0 +1,59 @@
+Subject: [PATCH] Fix fatal error in getCurrentKeyboardLayout()
+
+FATAL:xkb_keyboard_layout_engine.cc(640)] Keymap file failed to load: dk(polytonic)
+
+Remove unnecessary tokenization of XKB layout.
+Parsing of layout configuration is already handled by
+XkbKeyboardLayoutEngine::ParseLayoutName().
+
+Fixes: QTBUG-101201
+Task-number: QTBUG-92971
+Pick-to: 6.2 6.3
+Change-Id: Ia4f09ed99eb82064a3b12e14eda69a6e0e12b0dd
+Reviewed-by: Peter Varga
+Reviewed-by: Allan Sandfeld Jensen
+---
+ .../src/core/ozone/ozone_platform_qt.cpp | 24 ++++---------------
+ 1 file changed, 5 insertions(+), 19 deletions(-)
+
+diff --git a/qtwebengine/src/core/ozone/ozone_platform_qt.cpp b/qtwebengine/src/core/ozone/ozone_platform_qt.cpp
+index 33d7bd992b..543e4bd371 100644
+--- a/qtwebengine/src/core/ozone/ozone_platform_qt.cpp
++++ b/qtwebengine/src/core/ozone/ozone_platform_qt.cpp
+@@ -184,29 +184,15 @@ static std::string getCurrentKeyboardLayout()
+ if (XkbRF_GetNamesProp(dpy, nullptr, &vdr) == 0)
+ return std::string();
+
+- char *layout = strtok(vdr.layout, ",");
+- for (int i = 0; i < state.group; i++) {
+- layout = strtok(nullptr, ",");
+- if (layout == nullptr)
+- return std::string();
+- }
++ if (!vdr.layout)
++ return std::string();
+
+ if (!vdr.variant)
+- return layout;
+-
+- char *variant = strtok(vdr.variant, ",");
+- if (!variant)
+- return layout;
+-
+- for (int i = 0; i < state.group; i++) {
+- variant = strtok(nullptr, ",");
+- if (variant == nullptr)
+- return layout;
+- }
++ return std::string(vdr.layout);
+
+- std::string layoutWithVariant = layout;
++ std::string layoutWithVariant = vdr.layout;
+ layoutWithVariant = layoutWithVariant.append("-");
+- layoutWithVariant = layoutWithVariant.append(variant);
++ layoutWithVariant = layoutWithVariant.append(vdr.variant);
+ return layoutWithVariant;
+ }
+ #endif // BUILDFLAG(USE_XKBCOMMON)
+--
+2.35.3
\ No newline at end of file
diff --git a/extras/packaging/gnu-linux/rules/debian-qt/patches/series b/extras/packaging/gnu-linux/rules/debian-qt/patches/series
new file mode 100644
index 000000000..5cd7cfb4a
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/debian-qt/patches/series
@@ -0,0 +1 @@
+0001-qtbug-101201-fatal-error-getcurrenkeyboard.patch
diff --git a/extras/packaging/gnu-linux/rules/debian-qt/rules b/extras/packaging/gnu-linux/rules/debian-qt/rules
new file mode 100755
index 000000000..4c37d26f5
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/debian-qt/rules
@@ -0,0 +1,33 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+# export DH_VERBOSE = 1
+
+%:
+ dh $@
+
+override_dh_auto_configure:
+ # Qt 6.2 build for gcc 8
+ sed -i 's,->GetProperty({,->GetProperty(GetPropertyRequest{,g' qtwebengine/src/3rdparty/chromium/ui/gfx/x/property_cache.cc
+ sed -i 's/max(),/max()/g' qtwebengine/src/3rdparty/chromium/ui/gfx/x/property_cache.cc
+ sed -i 's,PresentPixmap({,PresentPixmap(x11::Present::PresentPixmapRequest{,g' qtwebengine/src/3rdparty/chromium/components/viz/service/display_embedder/output_presenter_x11.cc
+ sed -i 's/last_target_msc_,/last_target_msc_/g' qtwebengine/src/3rdparty/chromium/components/viz/service/display_embedder/output_presenter_x11.cc
+ # Avoid MakeFlatSet
+ sed -i 's,const auto& GetNeverSniffedMimeTypes,/*const auto& GetNeverSniffedMimeTypes{,g' qtwebengine/src/3rdparty/chromium/services/network/public/cpp/cross_origin_read_blocking.cc
+ sed -i '1,/\/\/ static/{s/\/\/ static/*\/\}\/\/ static/;}' qtwebengine/src/3rdparty/chromium/services/network/public/cpp/cross_origin_read_blocking.cc
+ cp qtwebengine/src/3rdparty/chromium/services/network/public/cpp/cross_origin_read_blocking.cc temp
+ tac temp | sed '1,/return MimeType::kOthers/{s/return MimeType::kOthers/*\/return MimeType::kOthers/;}' | tac > qtwebengine/src/3rdparty/chromium/services/network/public/cpp/cross_origin_read_blocking.cc
+ rm temp -f
+ sed -i 's,if (base::Contains,/*if (base::Contains,g' qtwebengine/src/3rdparty/chromium/services/network/public/cpp/cross_origin_read_blocking.cc
+ CXXFLAGS="-flto -flto-partition=none" CFLAGS="-flto -flto-partition=none" ./configure \
+ -opensource \
+ -confirm-license \
+ -nomake examples \
+ -nomake tests \
+ -prefix "${QT_JAMI_PREFIX}"
+
+override_dh_auto_build:
+ cmake --build . --parallel
+
+override_dh_auto_install:
+ cmake --install . --prefix $(CURDIR)/debian/tmp/${QT_JAMI_PREFIX}
diff --git a/extras/packaging/gnu-linux/rules/debian-qt/source/format b/extras/packaging/gnu-linux/rules/debian-qt/source/format
new file mode 100644
index 000000000..163aaf8d8
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/debian-qt/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/extras/packaging/gnu-linux/rules/debian/README.Debian b/extras/packaging/gnu-linux/rules/debian/README.Debian
new file mode 100644
index 000000000..cab237084
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/debian/README.Debian
@@ -0,0 +1,35 @@
+# Differences and compatibility with official debian.org package
+
+This source package also provides binary package jami-all. jami-all is an
+all-in-one package that is it ships both the Jami Daemon and the GNOME
+client. This package is not available in the debian.org repositories (not
+needed in the Debian case).
+
+jami-all allows easy installation of Jami as a single package from jami.net.
+The reason is that one cannot register a repository in source.list.d and
+directly use it to fetch the dependencies. As a consequence it is not
+possible to have a one-click installation with two binary packages. That's
+why we build jami-all.
+
+jami-all conflicts with jami and jami-daemon since they are distributing the
+same files.
+
+# Notes
+
+## Importing a new version
+
+1- Prepare the new changelog entry mentioning the new version.
+ (the version on the changelog will be used to determine what to download).
+ Releases are available here: https://dl.jami.net/release/tarballs/
+
+2- Run debian/rules get-orig-source
+
+3- Import the tarball with gbp import-orig
+
+## tarballs-unpacked
+
+We need those tarballs in tarballs-unpacked.
+The rest should be excluded.
+ - msgpack-c-cpp-1.2.0.tar.gz
+ - opendht-281b62dfd529a226e94d0da19e01acf07871a797.tar.gz
+ - pjproject-2.4.5.tar.bz2
diff --git a/extras/packaging/gnu-linux/rules/debian/compat b/extras/packaging/gnu-linux/rules/debian/compat
new file mode 100644
index 000000000..ec635144f
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/extras/packaging/gnu-linux/rules/debian/control b/extras/packaging/gnu-linux/rules/debian/control
new file mode 100644
index 000000000..38ecdaac4
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/debian/control
@@ -0,0 +1,119 @@
+Source: jami
+Section: comm
+Priority: optional
+Maintainer: The Jami project
+Build-Depends: debhelper (>= 9),
+ autoconf,
+ automake,
+ libtool,
+ autotools-dev,
+# qt client
+ libqt-jami,
+ python3,
+ libnm-dev,
+ libnotify-dev,
+ libqrencode-dev,
+ libayatana-appindicator3-dev | libappindicator3-dev,
+# daemon
+ libdbus-1-dev,
+ libdbus-c++-dev,
+ libupnp-dev,
+ libgnutls28-dev,
+ libpulse-dev,
+ libasound2-dev,
+ libexpat1-dev,
+ libpcre3-dev,
+ libyaml-cpp-dev,
+ libboost-dev,
+ libxext-dev,
+ libxfixes-dev,
+ libspeex-dev,
+ libspeexdsp-dev,
+ uuid-dev,
+ libavcodec-dev,
+ libavutil-dev,
+ libavformat-dev,
+ libswscale-dev,
+ libavdevice-dev,
+ libopus-dev,
+ libudev-dev,
+ libgsm1-dev,
+ libjsoncpp-dev,
+ libnatpmp-dev,
+ libva-dev,
+ libcrypto++-dev,
+ libvdpau-dev,
+ libssl-dev,
+ libargon2-dev | libargon2-0-dev,
+# other
+ nasm,
+ yasm,
+Standards-Version: 4.1.5
+Homepage: https://jami.net
+Vcs-Git: https://git.jami.net/savoirfairelinux/jami-client-qt.git
+Vcs-Browser: https://git.jami.net/savoirfairelinux/jami-client-qt
+
+# The jami-all package is used as the "one-click install" package
+# offered on the Jami website. The following relationships ensure
+# that installing the jami-all package replaces version of the other
+# individual Jami packages. This is so that users can fix any
+# installation problem on their side by simply reinstalling as per the
+# website instructions.
+#
+Package: jami-all
+Architecture: any
+Depends: gnupg,
+ ${shlibs:Depends},
+ ${misc:Depends}
+Replaces: jami,
+ jami-libclient,
+ jami-daemon,
+ libqt-jami (>= 6.2.3),
+Conflicts: jami,
+ jami-libclient,
+ jami-libclient-gnome,
+ jami-daemon,
+ jami-gnome,
+ libqt-jami
+Description: One-click install package for Jami
+ This package only exists to provide an easy installation user experience.
+ To install the default client, install the 'jami' package.
+
+Package: jami
+Architecture: any
+Depends: ${shlibs:Depends},
+ ${misc:Depends},
+ jami-daemon (=${binary:Version}),
+ libqt-jami (>= 6.2.3)
+Provides: jami-qt
+Replaces: jami-all,
+ jami-libclient (<= 20220516.0214.9b42ad3~dfsg1-1)
+Breaks: jami-libclient (<= 20220516.0214.9b42ad3~dfsg1-1)
+Conflicts: jami-all
+Description: Secure and distributed voice, video and chat platform - desktop client
+ Jami (jami.net) is a secure and distributed voice, video and chat communication
+ platform that requires no centralized server and leaves the power of privacy
+ in the hands of the user.
+ .
+ This package contains the jami-qt desktop client.
+
+# Made into a transitional package on 2022-06-21, after libjamiclient
+# was merged into src/libclient under jami-client-qt.git, to provide
+# an upgrade path to existing users. Feel free to remove this package
+# later into the future, some time after 2023-06-21 perhaps.
+Package: jami-libclient
+Architecture: any
+Description: transitional package for jami
+ This is a transitional package. Jami libclient has been merged into
+ the jami-qt client code-base, and this package can be safely removed.
+
+Package: jami-daemon
+Architecture: any
+Depends: ${shlibs:Depends},
+ ${misc:Depends}
+Description: Secure and distributed voice, video and chat platform - daemon
+ Jami (jami.net) is a secure and distributed voice, video and chat communication
+ platform that requires no centralized server and leaves the power of privacy
+ in the hands of the user.
+ .
+ This package contains the Jami daemon: jamid.
diff --git a/extras/packaging/gnu-linux/rules/debian/copyright b/extras/packaging/gnu-linux/rules/debian/copyright
new file mode 100644
index 000000000..1b2220deb
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/debian/copyright
@@ -0,0 +1,212 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: jami
+Upstream-Contact: Alexandre Viau
+Source: https://dl.jami.net/release/tarballs/
+Files: *
+Copyright: 2004-2021 Savoir-faire Linux Inc.
+License: GPL-3+
+Comment: Upstream embeds everything that is needed to build Jami inside the release tarball.
+ Everything that is already in Debian has been removed.
+ .
+ OpenDHT was kept and not packaged independently. OpenDHT was written for Jami and is a moving
+ target. It is best to wait until it is more mature before packaging it separately.
+ .
+ Msgpack was kept because the version available in Debian is currently too old for Jami to build.
+ The Debian version of Msgpack cannot be updated at the moment because of reverse dependencies which
+ are not ready.
+ .
+ Pjproject was kept because it is heavily patched by Jami developers. None of the patches were merged
+ upstream and Jami developers are still waiting for a reaction from Pjproject developers.
+ See the relevant threads:
+ - http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2014-October/017905.html
+ - http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2015-January/018072.html
+ - http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/2016-April/019196.html
+
+#####################
+## Start of daemon ##
+#####################
+
+Files: daemon/doc/dbus-api/tools/devhelp.xsl
+ daemon/doc/dbus-api/tools/doc-generator.py
+ daemon/doc/dbus-api/tools/doc-generator.xsl
+ daemon/doc/dbus-api/tools/specparser.py
+Copyright: 2009 Collabora Ltd.
+License: LGPL-2.1+
+
+Files: daemon/src/dlfcn.h
+ daemon/src/dlfcn.c
+Copyright: 2007 Ramiro Polla
+License: LGPL-2.1+
+
+Files: daemon/src/media/srtp.h
+ daemon/src/media/srtp.c
+Copyright: 2012 Martin Storsjo
+License: LGPL-2.1+
+
+Files: daemon/src/media/audio/opensl/audio_common.h
+ daemon/src/media/audio/opensl/audio_player.cpp
+ daemon/src/media/audio/opensl/audio_player.h
+ daemon/src/media/audio/opensl/audio_recorder.cpp
+ daemon/src/media/audio/opensl/audio_recorder.h
+ daemon/src/media/audio/opensl/buf_manager.h
+Copyright: 2015 The Android Open Source Project
+ 2015-2019 Savoir-faire Linux Inc.
+License: Apache-2.0
+
+Files: daemon/extras/tools/bootstrap
+Copyright: 2011 Rafaël Carré
+License: GPL-2+
+
+Files: daemon/extras/tools/tools.mak
+ daemon/contrib/src/main.mak
+Copyright: 2003-2011 the VideoLAN team
+License: GPL-2+
+
+Files: daemon/m4/ax_cxx_compile_stdcxx.m4
+ daemon/m4/dolt.m4
+Copyright: 2008 Benjamin Kosnik
+ 2012 Zack Weinberg
+ 2013 Roy Stogner
+ 2014-2015 Google Inc.
+ 2015 Paul Norman
+ 2015 Moritz Klammler
+ 2007-2010 Josh Triplett
+License: GNUAllPermissive
+
+Files: daemon/tools/jamidctrl/sippwrap.py
+ daemon/tools/jamidctrl/test_jamid_dbus_interface.py
+Copyright: 2012 Free Software Foundation, Inc.
+License: GPL-2+
+
+Files: daemon/tools/cpplint.py3
+Copyright: 2009 Google Inc.
+License: BSD-3-Clause
+
+###################
+## End of daemon ##
+###################
+
+##################
+## Start of lrc ##
+##################
+
+Files: lrc/*
+Copyright: 2009-2019 by Savoir-faire Linux
+License: LGPL-2.1+
+
+################
+## End of lrc ##
+################
+
+
+License: GPL-3+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ ․
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ ․
+ The complete text of the GNU General Public License version 3
+ can be found in `/usr/share/common-licenses/GPL-3`.
+
+License: GPL-2+
+ This package is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any later
+ version.
+ .
+ This package is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ details.
+ .
+ You should have received a copy of the GNU General Public License along with
+ this program. If not, see http://www.gnu.org/licenses/
+ .
+ On Debian systems, the complete text of the GNU General Public License version
+ 2 can be found in "/usr/share/common-licenses/GPL-2".
+
+License: Expat
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
+ this software and associated documentation files (the "Software"), to deal in
+ the Software without restriction, including without limitation the rights to
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ the Software, and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+License: LGPL-2.1+
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+ .
+ See /usr/share/common-licenses/LGPL-2.1 for the full license text.
+
+License: BSD-3-Clause
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ .
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+License: Apache-2.0
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ .
+ http://www.apache.org/licenses/LICENSE-2.0
+ .
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ .
+ The complete text of the Apache version 2.0 license
+ can be found in "/usr/share/common-licenses/Apache-2.0".
+
+License: GNUAllPermissive
+ Copying and distribution of this file, with or without modification, are
+ permitted in any medium without royalty provided the copyright notice
+ and this notice are preserved. This file is offered as-is, without any
+ warranty.
+
+License: LGPL-2+
+ This library is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+ .
+ See /usr/share/common-licenses/LGPL-2 for the full license text.
diff --git a/extras/packaging/gnu-linux/rules/debian/jami-all.lintian-overrides b/extras/packaging/gnu-linux/rules/debian/jami-all.lintian-overrides
new file mode 100644
index 000000000..8ab14fe9b
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/debian/jami-all.lintian-overrides
@@ -0,0 +1,3 @@
+# We are shipping a .so, but this isn't a library package
+package-name-doesnt-match-sonames
+no-symbols-control-file
diff --git a/extras/packaging/gnu-linux/rules/debian/jami-all.manpages b/extras/packaging/gnu-linux/rules/debian/jami-all.manpages
new file mode 100644
index 000000000..857be47ff
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/debian/jami-all.manpages
@@ -0,0 +1 @@
+daemon/jamid.1
diff --git a/extras/packaging/gnu-linux/rules/debian/jami-all.postinst b/extras/packaging/gnu-linux/rules/debian/jami-all.postinst
new file mode 100755
index 000000000..93e1ebece
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/debian/jami-all.postinst
@@ -0,0 +1,168 @@
+#!/bin/sh
+set -e
+
+###############################################################################
+# JAMI PACKAGE POSTINST #
+# #
+# Install Jami's package repository to the trusted sources and add Jami's #
+# release key to trusted keyring. #
+# #
+# NOTE: We follow https://wiki.debian.org/DebianRepository/UseThirdParty #
+###############################################################################
+
+
+###############################################################################
+# [1] Configuration #
+###############################################################################
+
+# All package repo urls are expected to start with this string, regardless
+# of the distribution or version. The end tag is automatically appended,
+# depending on the system the postinst script is run on. Examples:
+#
+# Ubuntu 18.04:
+# $JAMI_REPO = $JAMI_REPO_BASE/ubuntu_18.04/
+#
+# Debian 10:
+# $JAMI_REPO = $JAMI_REPO_BASE/debian_10
+#
+# To update the appended end tags, modify the switch in [2].
+JAMI_REPO_BASE="https://dl.jami.net/nightly"
+
+# Jami release key.
+JAMI_KEY_FINGERPRINT="A295D773307D25A33AE72F2F64CD5FA175348F84"
+JAMI_KEY="\
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v2
+
+mQENBFVSdlcBCAC9zC1rp12O2K08PGozI14Y+t4qC931eHicvkuEMF1B9gAhjdRF
+aIJS+UXwgQzoamDIHenxz1Q3fXUjKCMXytjGymB/0LUKccSbtH0Rcsl8kZ2z57KN
+E+GLS7SvlP93ZOxco7eAEBWF/fvMrCsm10sNI6bW7UK0bgql9iIetd6Wrp9xXFVs
+gmoV8Av714OlswsthSNtN+xQls3ozQ/dVGsOkZEyDbBzi88/rQEtuIDztTSWyD0V
+x7WaY5+mVRwsJKzyPlgvsXpbP7A41IFykeOzPKh+vYz3k7dcLIRdOwse79oT2RXt
+2VYEyTyTZIQlCJjGNTJYsU7GVffU4LnI7p/bABEBAAG0QFJpbmcgLSBTYXZvaXIt
+RmFpcmUgTGludXgsIEluYyA8cmluZ0BsaXN0cy5zYXZvaXJmYWlyZWxpbnV4Lm5l
+dD6JATkEEwEIACMFAlVSdlcCGwMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAK
+CRBkzV+hdTSPhMqSB/9aaKXVByoE7zwPM8DDSntS/jYhhaV1CcZ78WeC1LY2UnHL
+R/yvABnDMikgqbMHBDu1R9dnjgZNntp7p0blxcT6ScxdZ6FpMZG6ZW5YNZIVctnF
+jdExStcdpcbbycW8GeCmQdVcKLBl8G55mick02ayVNOH5ETtWahPwBvMWk5hSaH3
+E18yvnmdqa9nCEST4UKvBOpmn58mwJDIR2YLdEFcL8z4FkxQUNkx/hiHSn+YLorZ
+H3iBrf9y9vSYhQ5pxx7seWkoaGAQBgfktRCUKvVY6E1oSZ/WR1WsR1ftDO/RD0E8
+APKzibVynUEQrCcQX16uDOa/YgavVkts9HmR7Vf7iQEcBBABCAAGBQJVUoJZAAoJ
+EFZ3uE+o8K8j0RkH/2sv4L3X0hPIwAzf3CUJZQuHihUOPRAoru5RqW/5nWqsroa1
+WChJq79uDEecDAizTA1MvaTFmLxTjCkJso+5UHMSHi6LARvYXSOeBPFizEJT4qZZ
+CXti5zh9d5z1u6L986mrnArA39IZ2F+9wV2q0VIDnq1Tt6+cJ745zSeZmbM6jip4
+oEBsKbCkAhq78sqCc7DIilsGbd2tgrLsh3fitvamEJCTCYKdDMog3TP0+EekQTA2
+Qp4jG0Uf7Gg1YvDDcsawXyNDrMBXEFPVhBNnRisX+YQBRWgDE58+fpsQfeTkblL5
+UaLWhDGlyfAc1ebL3InzhUWJswjt0BN3GPoP55m5AQ0EVVJ2VwEIAMXhg0w1IM0C
+rGXMGayaJ3EWd9YXkqq0sAN7b75tD0cOimyPNafnzChG9//3tt82aPRm8fG5Lk5U
+fwCS2MSt2Ml8UZeujmEBnvU9hsJBWcGgzXhtBQwZqzmV2vQg8436nTFY5L24TFBc
+QNOUJNzSy/dqps0SxcYleE57o24KHlW6ICBaEhz0JoZHv5+7GtYz6XN2D7pkwTPY
+UIahyt4dY3geFrkuMzZdTS4qyFb8EE/Ypi/WgewO9ib53kt7FBrxmm0l+d9GR4jH
+CKGqaYjm8xzTsNa3m2C0Cf/C13bOaQVicgntfQ32IjjZdaDMlRLQluYNQ0ETA1FE
+9+EVvrQYZ+kAEQEAAYkBHwQYAQgACQUCVVJ2VwIbDAAKCRBkzV+hdTSPhMIaB/9D
+CrIZBDy7YOK3gdnNm57jemJRz6Cum7RTUiqCQ8ivSmEgv1KmMIqMpjmnKKP43iHO
+mR4i7XDml6RBGynPys6cQcAlBWSuhOv9PGpRCaGyjJ4vmQUsYhyD/+tCDZVdBuGg
+CxteSMbawxtMHESqX7dDlctc+njDjBcbcGj73sj36qoFIjorjymZlT5IdK39oXVM
+Hi1TssiWPOU0hQgn4BIreYnEZUA6xuFX10C7k2DVRFZrXF7lpNgPQ8eNZTnQBIuw
+HUFCGSHO3/kzxSlkE1PBUX3IZ8PSFijyopBnWUhlSXuyRjte8OR7Fl/Rlf0IaOD1
+4sRdAfS333T4Uifq4uOu
+=s2aQ
+-----END PGP PUBLIC KEY BLOCK-----"
+
+# System paths and generated variables
+APT_FILE="/etc/apt/sources.list.d/jami-main.list"
+UPDATE_MANAGER_PATH="/etc/update-manager/release-upgrades.d/"
+JAMI_UPDATE_MANAGER_ID="jami-main"
+
+JAMI_UPDATE_MANAGER_CFG="${JAMI_UPDATE_MANAGER_ID}.cfg"
+UPDATE_MANAGER_CFG_PATH="${UPDATE_MANAGER_PATH}/${JAMI_UPDATE_MANAGER_CFG}"
+
+
+###############################################################################
+# [2] Set package repo url depending on distribution and version #
+###############################################################################
+
+CAN_ADD_DEB_SOURCE=true
+
+# Detect currently running system using /etc/os-release
+# Debian-based systems are supposed to provide /etc/os-release so if it's not
+# the case then we simply don't want to provide automatic updates
+if [ -f /etc/os-release ]; then
+ . /etc/os-release
+
+ # Set-up Jami repository end tag
+ 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
+ ENDTAG="ubuntu_18.04"
+ elif [ "${UBUNTU_CODENAME}" = "focal" ] || [ "${ID}_${VERSION_ID}" = "ubuntu_20.04" ]; then
+ ENDTAG="ubuntu_20.04"
+ elif [ "${UBUNTU_CODENAME}" = "jammy" ] || [ "${ID}_${VERSION_ID}" = "ubuntu_22.04" ]; then
+ ENDTAG="ubuntu_22.04"
+ elif [ "${UBUNTU_CODENAME}" = "kinetic" ] || [ "${ID}_${VERSION_ID}" = "ubuntu_22.10" ]; then
+ ENDTAG="ubuntu_22.10"
+ elif [ "${ID}" = "debian" ] && \
+ [ "$(command -v lsb_release)" ] && \
+ [ "$(lsb_release -rs)" = "testing" ]; then
+ ENDTAG="debian_testing"
+ elif [ "${ID}" = "debian" ] && \
+ [ "$(command -v apt-cache)" ] && \
+ [ "$(command -v grep)" ] && \
+ apt-cache policy | grep -q "a=unstable" -; then
+ ENDTAG="debian_unstable"
+ else
+ # Distribution is not supported. Don't provide automatic updates.
+ CAN_ADD_DEB_SOURCE=false
+ fi
+else
+ CAN_ADD_DEB_SOURCE=false
+fi
+
+
+###############################################################################
+# [3] Maintainer script main switch #
+###############################################################################
+
+case "$1" in
+ configure)
+ if [ "`command -v apt-key`" = "" ]; then
+ # we can only add key if apt-key is present
+ CAN_ADD_DEB_SOURCE=false
+ fi
+
+ if [ "${CAN_ADD_DEB_SOURCE}" = "true" ]; then
+ JAMI_REPO="${JAMI_REPO_BASE}/${ENDTAG}"
+
+ # We first add the key to the trusted keyring.
+ apt-key add - > /dev/null 2>&1 << EOF
+$JAMI_KEY
+EOF
+
+ # Add an entry for the package repository to the trusted package
+ # sources (DEB822 format)
+ cat > $APT_FILE < $UPDATE_MANAGER_CFG_PATH < daemon/jamid.1
+
+ # Qt client configure and build
+ mkdir build && \
+ cd build && \
+ cmake \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DLIBJAMI_BUILD_DIR=$(CURDIR)/daemon/src \
+ -DENABLE_LIBWRAP=true \
+ $(CMAKE_OPTIONS) ..
+ make -C build -j$(NO_CPUS) V=1
+
+override_dh_auto_clean:
+ # Daemon clean
+ [ -f daemon/contrib/native/Makefile ] && \
+ make -C daemon/contrib/native distclean || true
+ rm -rfv daemon/contrib/native
+ rm -rfv daemon/jamid.1
+
+ # Qt client clean
+ # CMake build system has no distclean target, so use clean.
+ [ -f build/Makefile ] && make -C build clean || true
+ rm -rfv build
+
+override_dh_auto_install:
+ # Daemon install
+ cd daemon && make DESTDIR=$(CURDIR)/debian/$(JAMI_DAEMON_PKG_NAME) install
+ rm -rfv $(CURDIR)/debian/$(JAMI_DAEMON_PKG_NAME)/usr/include
+ rm -rfv $(CURDIR)/debian/$(JAMI_DAEMON_PKG_NAME)/usr/lib/*.a
+ rm -rfv $(CURDIR)/debian/$(JAMI_DAEMON_PKG_NAME)/usr/lib/*.la
+
+ # Qt client install
+ cd build && \
+ make DESTDIR=$(CURDIR)/debian/$(JAMI_CLIENT_PKG_NAME) install
+
+ ## Custom Qt package for Jami (libqt-jami)
+ ## Copy our own Qt library package content into the OCI package.
+ for file_name in $$(dpkg-query -L libqt-jami); do \
+ mkdir -p "$(OCI_INSTALL_DIR)$$(dirname $$file_name)"; \
+ test -d "$$file_name" && continue; \
+ cp "$$file_name" "$(OCI_INSTALL_DIR)$$file_name"; \
+ done
+
+ # Jami all-in-one install
+ # Daemon
+ cd daemon && make DESTDIR=$(CURDIR)/debian/$(JAMI_ALL_IN_ONE_PKG_NAME) install
+ rm -rfv $(CURDIR)/debian/$(JAMI_ALL_IN_ONE_PKG_NAME)/usr/include
+ rm -rfv $(CURDIR)/debian/$(JAMI_ALL_IN_ONE_PKG_NAME)/usr/lib/*.a
+ rm -rfv $(CURDIR)/debian/$(JAMI_ALL_IN_ONE_PKG_NAME)/usr/lib/*.la
+ # Qt client
+ cd build && \
+ make DESTDIR=$(CURDIR)/debian/$(JAMI_ALL_IN_ONE_PKG_NAME) install
+
+override_dh_shlibdeps:
+ dh_shlibdeps -- -x$(JAMI_ALL_IN_ONE_PKG_NAME)
+
+tmpdir:= $(shell mktemp -d)
+workdir:= $(shell pwd)
+PKD := $(abspath $(dir $(MAKEFILE_LIST)))
+version_to_download := $(shell dpkg-parsechangelog -ldebian/changelog | perl -ne 'print $$1 if m{^Version:\s+(?:\d+:)?(\d.*)(?:\~dfsg.+)(?:\-\d+.*)};')
diff --git a/extras/packaging/gnu-linux/rules/debian/source/format b/extras/packaging/gnu-linux/rules/debian/source/format
new file mode 100644
index 000000000..163aaf8d8
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/extras/packaging/gnu-linux/rules/debian/watch b/extras/packaging/gnu-linux/rules/debian/watch
new file mode 100644
index 000000000..c219a014f
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/debian/watch
@@ -0,0 +1,3 @@
+version=3
+opts=dversionmangle=s/\~dfsg\d*$// \
+https://dl.jami.net/release/tarballs/ jami_(\d\S*)\.tar\.gz
diff --git a/extras/packaging/gnu-linux/rules/rpm/jami-all.postinst b/extras/packaging/gnu-linux/rules/rpm/jami-all.postinst
new file mode 100755
index 000000000..04df2e52f
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/rpm/jami-all.postinst
@@ -0,0 +1,133 @@
+#!/bin/sh -e
+
+
+###############################################################################
+# JAMI PACKAGE POSTINST #
+# #
+# Install Jami's package repository to the trusted sources and add Jami's #
+# release key to trusted keyring. #
+# #
+###############################################################################
+
+
+###############################################################################
+# [1] Configuration #
+###############################################################################
+
+JAMI_REPO_BASE="https://dl.jami.net/nightly"
+
+# Jami release key.
+JAMI_KEY_FINGERPRINT="A295D773307D25A33AE72F2F64CD5FA175348F84"
+JAMI_KEY="\
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v2
+
+mQENBFVSdlcBCAC9zC1rp12O2K08PGozI14Y+t4qC931eHicvkuEMF1B9gAhjdRF
+aIJS+UXwgQzoamDIHenxz1Q3fXUjKCMXytjGymB/0LUKccSbtH0Rcsl8kZ2z57KN
+E+GLS7SvlP93ZOxco7eAEBWF/fvMrCsm10sNI6bW7UK0bgql9iIetd6Wrp9xXFVs
+gmoV8Av714OlswsthSNtN+xQls3ozQ/dVGsOkZEyDbBzi88/rQEtuIDztTSWyD0V
+x7WaY5+mVRwsJKzyPlgvsXpbP7A41IFykeOzPKh+vYz3k7dcLIRdOwse79oT2RXt
+2VYEyTyTZIQlCJjGNTJYsU7GVffU4LnI7p/bABEBAAG0QFJpbmcgLSBTYXZvaXIt
+RmFpcmUgTGludXgsIEluYyA8cmluZ0BsaXN0cy5zYXZvaXJmYWlyZWxpbnV4Lm5l
+dD6JATkEEwEIACMFAlVSdlcCGwMHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAK
+CRBkzV+hdTSPhMqSB/9aaKXVByoE7zwPM8DDSntS/jYhhaV1CcZ78WeC1LY2UnHL
+R/yvABnDMikgqbMHBDu1R9dnjgZNntp7p0blxcT6ScxdZ6FpMZG6ZW5YNZIVctnF
+jdExStcdpcbbycW8GeCmQdVcKLBl8G55mick02ayVNOH5ETtWahPwBvMWk5hSaH3
+E18yvnmdqa9nCEST4UKvBOpmn58mwJDIR2YLdEFcL8z4FkxQUNkx/hiHSn+YLorZ
+H3iBrf9y9vSYhQ5pxx7seWkoaGAQBgfktRCUKvVY6E1oSZ/WR1WsR1ftDO/RD0E8
+APKzibVynUEQrCcQX16uDOa/YgavVkts9HmR7Vf7iQEcBBABCAAGBQJVUoJZAAoJ
+EFZ3uE+o8K8j0RkH/2sv4L3X0hPIwAzf3CUJZQuHihUOPRAoru5RqW/5nWqsroa1
+WChJq79uDEecDAizTA1MvaTFmLxTjCkJso+5UHMSHi6LARvYXSOeBPFizEJT4qZZ
+CXti5zh9d5z1u6L986mrnArA39IZ2F+9wV2q0VIDnq1Tt6+cJ745zSeZmbM6jip4
+oEBsKbCkAhq78sqCc7DIilsGbd2tgrLsh3fitvamEJCTCYKdDMog3TP0+EekQTA2
+Qp4jG0Uf7Gg1YvDDcsawXyNDrMBXEFPVhBNnRisX+YQBRWgDE58+fpsQfeTkblL5
+UaLWhDGlyfAc1ebL3InzhUWJswjt0BN3GPoP55m5AQ0EVVJ2VwEIAMXhg0w1IM0C
+rGXMGayaJ3EWd9YXkqq0sAN7b75tD0cOimyPNafnzChG9//3tt82aPRm8fG5Lk5U
+fwCS2MSt2Ml8UZeujmEBnvU9hsJBWcGgzXhtBQwZqzmV2vQg8436nTFY5L24TFBc
+QNOUJNzSy/dqps0SxcYleE57o24KHlW6ICBaEhz0JoZHv5+7GtYz6XN2D7pkwTPY
+UIahyt4dY3geFrkuMzZdTS4qyFb8EE/Ypi/WgewO9ib53kt7FBrxmm0l+d9GR4jH
+CKGqaYjm8xzTsNa3m2C0Cf/C13bOaQVicgntfQ32IjjZdaDMlRLQluYNQ0ETA1FE
+9+EVvrQYZ+kAEQEAAYkBHwQYAQgACQUCVVJ2VwIbDAAKCRBkzV+hdTSPhMIaB/9D
+CrIZBDy7YOK3gdnNm57jemJRz6Cum7RTUiqCQ8ivSmEgv1KmMIqMpjmnKKP43iHO
+mR4i7XDml6RBGynPys6cQcAlBWSuhOv9PGpRCaGyjJ4vmQUsYhyD/+tCDZVdBuGg
+CxteSMbawxtMHESqX7dDlctc+njDjBcbcGj73sj36qoFIjorjymZlT5IdK39oXVM
+Hi1TssiWPOU0hQgn4BIreYnEZUA6xuFX10C7k2DVRFZrXF7lpNgPQ8eNZTnQBIuw
+HUFCGSHO3/kzxSlkE1PBUX3IZ8PSFijyopBnWUhlSXuyRjte8OR7Fl/Rlf0IaOD1
+4sRdAfS333T4Uifq4uOu
+=s2aQ
+-----END PGP PUBLIC KEY BLOCK-----"
+
+# System paths and generated variables
+# In general: you will not need to modify these variables.
+# WARNING: When modifying the paths, keep in mind that the corresponding
+# postrm paths should be modified as well
+REPO_FILE="/etc/yum.repos.d/jami-main.repo"
+GPG_FILE="/etc/pki/rpm-gpg/RPM-GPG-KEY-JAMI"
+
+is_distribution_supported() {
+
+ # Detect currently running system using /etc/os-release
+ # Redhat-based systems are supposed to provide /etc/os-release so
+ # if it's not the case then we simply don't want to provide
+ # automatic updates.
+ if ! [ -f /etc/os-release ]; then
+ return 1
+ fi
+
+ # This defines variables such as NAME, ID, VERSION_ID, etc.
+ . /etc/os-release
+
+ case ${ID} in
+ rhel*|fedora*|opensuse*)
+ return 0
+ esac
+
+ return 1
+}
+
+has_rpm() {
+ command -v rpm > /dev/null
+}
+
+is_opensuse() {
+ case ${ID} in
+ opensuse*)
+ return 0
+ esac
+ return 1
+}
+
+###############################################################################
+# [3] Maintainer script main switch #
+###############################################################################
+
+# Exit unless the following conditions are met.
+is_distribution_supported && has_rpm || exit 0
+
+# Note: the NAME and ID variables are set as a side-effect of sourcing
+# the /etc/os-release file in the above is_distribution_supported
+# call.
+
+# SUSE specifics.
+if is_opensuse; then
+ REPO_FILE=/etc/zypp/repos.d/jami-main.repo
+ GPG_FILE="/tmp/RPM-GPG-KEY-JAMI"
+fi
+
+# Add the key to the trusted keyring.
+echo "$JAMI_KEY" > "$GPG_FILE"
+rm -f /var/lib/rpm/.rpm.lock > /dev/null 2>&1
+rpm --import "$GPG_FILE" > /dev/null 2>&1
+
+jami_repo_name="$DISTRIBUTION \$releasever - \$basearch - Jami"
+jami_repo_base_url="$JAMI_REPO_BASE/$ID_\$releasever"
+
+# Add an entry for the package repository to the trusted package.
+cat > "$REPO_FILE" <= 32
+BuildRequires: NetworkManager-libnm-devel
+BuildRequires: cmake
+BuildRequires: gcc-c++
+BuildRequires: dbus-devel
+BuildRequires: expat-devel
+BuildRequires: opus-devel
+BuildRequires: pulseaudio-libs-devel
+%endif
+%if %{defined suse_version}
+BuildRequires: libdbus-c++-devel
+BuildRequires: libexpat-devel
+BuildRequires: libopus-devel
+BuildRequires: libpulse-devel
+%else
+BuildRequires: gnutls-devel
+%endif
+BuildRequires: alsa-lib-devel
+BuildRequires: jsoncpp-devel
+BuildRequires: libXext-devel
+BuildRequires: libXfixes-devel
+BuildRequires: libuuid-devel
+BuildRequires: libva-devel
+BuildRequires: libvdpau-devel
+BuildRequires: pcre-devel
+BuildRequires: uuid-devel
+BuildRequires: yaml-cpp-devel
+
+%description
+This package contains the daemon of Jami, a free software for
+universal communication which respects the freedoms and privacy of its
+users.
+
+%prep
+%setup -n client-qt
+
+%build
+CFLAGS="${CFLAGS} -fno-lto"
+CXXFLAGS="${CXXFLAGS} -fno-lto"
+# Configure the Jami bundled libraries (ffmpeg & pjproject).
+mkdir -p daemon/contrib/native
+cd %{_builddir}/client-qt/daemon/contrib/native && \
+ ../bootstrap \
+ --no-checksums \
+ --disable-ogg \
+ --disable-flac \
+ --disable-vorbis \
+ --disable-vorbisenc \
+ --disable-speex \
+ --disable-sndfile \
+ --disable-gsm \
+ --disable-speexdsp \
+ --disable-natpmp && \
+ make list && \
+ make fetch && \
+ make %{_smp_mflags} V=1 && \
+ make %{_smp_mflags} V=1 .ffmpeg
+# Configure the daemon.
+cd %{_builddir}/client-qt/daemon && \
+ ./autogen.sh && \
+ ./configure \
+ --prefix=%{_prefix} \
+ --libdir=%{_libdir}
+# Build the daemon.
+make -C %{_builddir}/client-qt/daemon %{_smp_mflags} V=1
+pod2man %{_builddir}/client-qt/daemon/man/jamid.pod \
+ > %{_builddir}/client-qt/daemon/jamid.1
+
+%install
+DESTDIR=%{buildroot} make -C daemon install
+cp %{_builddir}/client-qt/daemon/jamid.1 \
+ %{buildroot}/%{_mandir}/man1/jamid.1
+rm -rfv %{buildroot}/%{_libdir}/*.a
+rm -rfv %{buildroot}/%{_libdir}/*.la
+
+%files
+%defattr(-,root,root,-)
+%{_libdir}/libjami.so*
+%{_libdir}/pkgconfig/jami.pc
+# XXX: Use %%{_libexecdir}/jamid after there's no more OpenSUSE Leap
+# < 16 (see https://en.opensuse.org/openSUSE:Specfile_guidelines).
+/usr/libexec/jamid
+%{_datadir}/jami/ringtones
+%{_datadir}/dbus-1/services/*
+%{_datadir}/dbus-1/interfaces/*
+%doc %{_mandir}/man1/jamid*
+
+%package devel
+Summary: Development files of the Jami daemon
+
+%description devel
+This package contains the header files for using the Jami daemon as a library.
+
+%files devel
+%{_includedir}/jami
+
+%post
+/sbin/ldconfig
+
+%postun
+/sbin/ldconfig
diff --git a/extras/packaging/gnu-linux/rules/rpm/jami-libclient.spec b/extras/packaging/gnu-linux/rules/rpm/jami-libclient.spec
new file mode 100644
index 000000000..003e31161
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/rpm/jami-libclient.spec
@@ -0,0 +1,25 @@
+# Made into a transitional package on 2022-06-21, after libjamiclient
+# was merged into src/libclient under jami-client-qt.git, to provide
+# an upgrade path to existing users. Feel free to remove this package
+# later into the future, some time after 2023-06-21 perhaps.
+
+%define name jami-libclient
+%define version RELEASE_VERSION
+%define release 0
+
+Name: %{name}
+Version: %{version}
+Release: %{release}%{?dist}
+Summary: Transitional package for Jami; can be safely removed
+Group: Applications/Internet
+License: GPLv3+
+Vendor: Savoir-faire Linux
+URL: https://jami.net/
+Source: jami_%{version}.tar.gz
+
+%description
+This is a transitional package. Jami libclient has been merged into
+the jami-qt client code-base, and this package can be safely removed.
+
+# Required, otherwise no rpm is generated.
+%files
diff --git a/extras/packaging/gnu-linux/rules/rpm/jami-libqt.spec b/extras/packaging/gnu-linux/rules/rpm/jami-libqt.spec
new file mode 100644
index 000000000..5e2e3d1ea
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/rpm/jami-libqt.spec
@@ -0,0 +1,97 @@
+%define name jami-libqt
+%define version RELEASE_VERSION
+%define release 5
+
+# qtwebengine (aka chromium) takes a ton of memory per build process,
+# up to 2.3 GiB. Cap the number of jobs based on the amount of
+# available memory to try to guard against OOM build failures.
+%define min(a,b) %(echo $(( %1 < %2 ? %1 : %2 )))
+%define max(a,b) %(echo $(( %1 > %2 ? %1 : %2 )))
+
+%define cpu_count %max %(nproc) 1
+%define available_memory %(free -g | grep -E '^Mem:' | awk '{print $7}')
+# Required memory in GiB.
+%define max_parallel_builds 4
+%define memory_required_per_core 2
+%define computed_job_count_ %(echo $(( %available_memory / %memory_required_per_core / %max_parallel_builds )))
+%define computed_job_count %max %computed_job_count_ 1
+%define job_count %min %cpu_count %computed_job_count
+
+Name: %{name}
+Version: %{version}
+Release: %{release}%{?dist}
+Summary: Library for Jami-qt
+Group: Applications/Internet
+License: GPLv3+
+Vendor: Savoir-faire Linux
+URL: https://jami.net/
+Source: jami-qtlib_%{version}.tar.xz
+Patch0: 0001-qtbug-101201-fatal-error-getcurrenkeyboard.patch
+
+%global gst 0.10
+%if 0%{?fedora} || 0%{?rhel} > 7
+%global gst 1.0
+%endif
+
+# Build dependencies
+BuildRequires: autoconf
+BuildRequires: make
+# QtWebEngine
+BuildRequires: bison
+BuildRequires: gperf
+BuildRequires: flex
+BuildRequires: vulkan-devel
+%if %{defined suse_version}
+BuildRequires: ffmpeg-devel
+BuildRequires: ffmpeg
+BuildRequires: python-xml
+BuildRequires: mozilla-nss-devel
+%else
+BuildRequires: pkgconfig(gstreamer-%{gst})
+BuildRequires: pkgconfig(gstreamer-app-%{gst})
+BuildRequires: pkgconfig(gstreamer-audio-%{gst})
+BuildRequires: pkgconfig(gstreamer-base-%{gst})
+BuildRequires: pkgconfig(gstreamer-pbutils-%{gst})
+BuildRequires: pkgconfig(gstreamer-plugins-bad-%{gst})
+BuildRequires: pkgconfig(gstreamer-video-%{gst})
+%endif
+
+%description
+This package contains Qt libraries for Jami.
+
+%prep
+%setup -n qt-everywhere-src-%{version}
+%patch0 -p1
+
+%build
+echo "Building Qt using %{job_count} parallel jobs"
+# Qt 6.2 (https://wiki.linuxfromscratch.org/blfs/ticket/14729)
+sed -i 's,default=False,default=True,g' qtwebengine/src/3rdparty/chromium/third_party/catapult/tracing/tracing_build/generate_about_tracing_contents.py
+# https://bugs.gentoo.org/768261 (Qt 5.15)
+sed -i 's,#include "absl/base/internal/spinlock.h"1,#include "absl/base/internal/spinlock.h"1\n#include ,g' qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc
+sed -i 's,#include ,#include \n#include ,g' qtwebengine/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/containers/string_pool.h
+# else, break build for fedora 35
+sed -i 's/static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ);/static const size_t kSigStackSize = std::max(size_t(16384), size_t(SIGSTKSZ));/g' qtwebengine/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+# https://bugreports.qt.io/browse/QTBUG-93452 (Qt 5.15)
+sed -i 's,# include ,# include \n# include ,g' qtbase/src/corelib/global/qglobal.h
+sed -i 's,#include ,#include \n#include ,g' qtbase/src/corelib/global/qendian.h
+cat qtbase/src/corelib/global/qendian.h
+sed -i 's,#include ,#include \n#include ,g' qtbase/src/corelib/global/qfloat16.h
+sed -i 's,#include ,#include \n#include ,g' qtbase/src/corelib/text/qbytearraymatcher.h
+# recent gcc version do not like lto from qt
+CXXFLAGS="${CXXFLAGS} -fno-lto" CFLAGS="${CFLAGS} -fno-lto" ./configure \
+ -opensource \
+ -confirm-license \
+ -nomake examples \
+ -nomake tests \
+ -prefix "%{_libdir}/qt-jami"
+sed -i 's,bin/python,bin/env python3,g' qtbase/mkspecs/features/uikit/devices.py
+# Chromium is built using Ninja, which doesn't honor MAKEFLAGS.
+cmake --build . --parallel
+
+%install
+cmake --install . --prefix %{buildroot}/${QT_JAMI_PREFIX}
+
+%files
+%defattr(-,root,root,-)
+%{_libdir}/qt-jami
diff --git a/extras/packaging/gnu-linux/rules/rpm/jami-qt.spec b/extras/packaging/gnu-linux/rules/rpm/jami-qt.spec
new file mode 100644
index 000000000..5cc25e896
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/rpm/jami-qt.spec
@@ -0,0 +1,26 @@
+# Made into a transitional package on 2022-10-12, after the 'jami-qt'
+# to 'jami' rename, to provide an upgrade path to existing users.
+# Feel free to remove this package later into the future, some time
+# after 2023-10-12 perhaps.
+
+%define name jami-qt
+%define version RELEASE_VERSION
+%define release 0
+
+Name: %{name}
+Version: %{version}
+Release: %{release}%{?dist}
+Summary: Transitional package for Jami; can be safely removed
+Group: Applications/Internet
+License: GPLv3+
+Vendor: Savoir-faire Linux
+URL: https://jami.net/
+Source: jami_%{version}.tar.gz
+Requires: jami
+
+%description
+This is a transitional package. The Jami Qt client is now packaged
+under the name 'jami', and this package can be safely removed.
+
+# Required, otherwise no rpm is generated.
+%files
diff --git a/extras/packaging/gnu-linux/rules/rpm/jami.spec b/extras/packaging/gnu-linux/rules/rpm/jami.spec
new file mode 100644
index 000000000..14acb7ccc
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/rpm/jami.spec
@@ -0,0 +1,83 @@
+%define name jami
+%define version RELEASE_VERSION
+%define release 0
+
+Name: %{name}
+Version: %{version}
+Release: %{release}%{?dist}
+Summary: Qt client for Jami
+Group: Applications/Internet
+License: GPLv3+
+Vendor: Savoir-faire Linux
+URL: https://jami.net/
+Source: jami_%{version}.tar.gz
+Requires: jami-daemon = %{version}
+Requires: jami-libqt
+Provides: jami-qt = %{version}
+Obsoletes: jami-qt < 20221010.1109.641d67d-2
+Obsoletes: jami-libclient <= 20220516.0214.9b42ad3-1
+
+# Build dependencies.
+%if 0%{?fedora} >= 32
+BuildRequires: cmake
+BuildRequires: gcc-c++
+%endif
+BuildRequires: make
+
+# For generating resources.qrc in build time.
+BuildRequires: python3
+
+# Build and runtime dependencies.
+BuildRequires: qrencode-devel
+
+%description
+This package contains the Qt desktop client of Jami. Jami is a free
+software for universal communication which respects freedoms and
+privacy of its users.
+
+%prep
+%setup -n client-qt
+
+%build
+# Configure and build bundled ffmpeg (for libavutil/avframe).
+mkdir -p %{_builddir}/client-qt/daemon/contrib/native
+cd %{_builddir}/client-qt/daemon/contrib/native && \
+ ../bootstrap \
+ --no-checksums \
+ --disable-ogg \
+ --disable-flac \
+ --disable-vorbis \
+ --disable-vorbisenc \
+ --disable-speex \
+ --disable-sndfile \
+ --disable-gsm \
+ --disable-speexdsp \
+ --disable-natpmp && \
+ make list && \
+ make fetch && \
+ make %{_smp_mflags} V=1 .ffmpeg
+# Qt-related variables
+cd %{_builddir}/client-qt && \
+ mkdir build && cd build && \
+ cmake -DENABLE_LIBWRAP=true \
+ -DLIBJAMI_BUILD_DIR=%{_builddir}/client-qt/daemon/src \
+ -DCMAKE_INSTALL_PREFIX=%{_prefix} \
+ -DCMAKE_INSTALL_LIBDIR=%{_libdir} \
+ -DWITH_DAEMON_SUBMODULE=true \
+ -DCMAKE_BUILD_TYPE=Release \
+ ..
+make -C %{_builddir}/client-qt/build %{_smp_mflags} V=1
+
+%install
+DESTDIR=%{buildroot} make -C %{_builddir}/client-qt/build install
+
+%files
+%defattr(-,root,root,-)
+%{_bindir}/jami
+%{_datadir}/applications/jami.desktop
+%{_datadir}/jami/jami.desktop
+%{_datadir}/icons/hicolor/scalable/apps/jami.svg
+%{_datadir}/icons/hicolor/48x48/apps/jami.png
+%{_datadir}/pixmaps/jami.xpm
+%{_datadir}/metainfo/jami.appdata.xml
+%{_datadir}/jami/translations/*
diff --git a/extras/packaging/gnu-linux/rules/rpm/patches/0001-qtbug-101201-fatal-error-getcurrenkeyboard.patch b/extras/packaging/gnu-linux/rules/rpm/patches/0001-qtbug-101201-fatal-error-getcurrenkeyboard.patch
new file mode 100644
index 000000000..90a0bfaec
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/rpm/patches/0001-qtbug-101201-fatal-error-getcurrenkeyboard.patch
@@ -0,0 +1,59 @@
+Subject: [PATCH] Fix fatal error in getCurrentKeyboardLayout()
+
+FATAL:xkb_keyboard_layout_engine.cc(640)] Keymap file failed to load: dk(polytonic)
+
+Remove unnecessary tokenization of XKB layout.
+Parsing of layout configuration is already handled by
+XkbKeyboardLayoutEngine::ParseLayoutName().
+
+Fixes: QTBUG-101201
+Task-number: QTBUG-92971
+Pick-to: 6.2 6.3
+Change-Id: Ia4f09ed99eb82064a3b12e14eda69a6e0e12b0dd
+Reviewed-by: Peter Varga
+Reviewed-by: Allan Sandfeld Jensen
+---
+ .../src/core/ozone/ozone_platform_qt.cpp | 24 ++++---------------
+ 1 file changed, 5 insertions(+), 19 deletions(-)
+
+diff --git a/qtwebengine/src/core/ozone/ozone_platform_qt.cpp b/qtwebengine/src/core/ozone/ozone_platform_qt.cpp
+index 33d7bd992b..543e4bd371 100644
+--- a/qtwebengine/src/core/ozone/ozone_platform_qt.cpp
++++ b/qtwebengine/src/core/ozone/ozone_platform_qt.cpp
+@@ -184,29 +184,15 @@ static std::string getCurrentKeyboardLayout()
+ if (XkbRF_GetNamesProp(dpy, nullptr, &vdr) == 0)
+ return std::string();
+
+- char *layout = strtok(vdr.layout, ",");
+- for (int i = 0; i < state.group; i++) {
+- layout = strtok(nullptr, ",");
+- if (layout == nullptr)
+- return std::string();
+- }
++ if (!vdr.layout)
++ return std::string();
+
+ if (!vdr.variant)
+- return layout;
+-
+- char *variant = strtok(vdr.variant, ",");
+- if (!variant)
+- return layout;
+-
+- for (int i = 0; i < state.group; i++) {
+- variant = strtok(nullptr, ",");
+- if (variant == nullptr)
+- return layout;
+- }
++ return std::string(vdr.layout);
+
+- std::string layoutWithVariant = layout;
++ std::string layoutWithVariant = vdr.layout;
+ layoutWithVariant = layoutWithVariant.append("-");
+- layoutWithVariant = layoutWithVariant.append(variant);
++ layoutWithVariant = layoutWithVariant.append(vdr.variant);
+ return layoutWithVariant;
+ }
+ #endif // BUILDFLAG(USE_XKBCOMMON)
+--
+2.35.3
\ No newline at end of file
diff --git a/extras/packaging/gnu-linux/rules/snap/common/icons/jami.svg b/extras/packaging/gnu-linux/rules/snap/common/icons/jami.svg
new file mode 100644
index 000000000..808f1327f
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/snap/common/icons/jami.svg
@@ -0,0 +1,340 @@
+
+
+
\ No newline at end of file
diff --git a/extras/packaging/gnu-linux/rules/snap/common/scripts/jami-wrapper b/extras/packaging/gnu-linux/rules/snap/common/scripts/jami-wrapper
new file mode 100755
index 000000000..d2b999b82
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/snap/common/scripts/jami-wrapper
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+export QTWEBENGINEPROCESS_PATH="$SNAP/usr/lib/libqt-jami/libexec/QtWebEngineProcess"
+
+exec "$@"
diff --git a/extras/packaging/gnu-linux/rules/snap/jami/snapcraft.yaml b/extras/packaging/gnu-linux/rules/snap/jami/snapcraft.yaml
new file mode 100644
index 000000000..21d554d03
--- /dev/null
+++ b/extras/packaging/gnu-linux/rules/snap/jami/snapcraft.yaml
@@ -0,0 +1,367 @@
+# Copyright (C) 2019-2022 Savoir-faire Linux Inc.
+#
+# Author: Sébastien Blin
+# Author: Amin Bandali
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+
+# This file is based on earlier work by Dani Llewellyn, under the
+# Expat License (also referred to as "the MIT License"), per the
+# following notice:
+
+# Copyright (C) 2017-2020 Dani Llewellyn
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the "Software"), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+
+name: jami
+version: "RELEASE_VERSION"
+adopt-info: jami
+icon: common/icons/jami.svg
+license: GPL-3.0+
+summary: 'Privacy-oriented voice, video, chat, and conference platform and SIP phone'
+description: |
+ Jami is free software for universal communication that respects the
+ freedom and privacy of its users.
+
+ Jami is an end-to-end encrypted secure and distributed voice, video,
+ and chat communication platform. Jami requires no central server
+ for these communications and leaves the power of privacy and freedom
+ in the hands of users.
+
+ Jami provides the following key features to its users:
+
+ * Synchronized and enriched one-to-one conversations
+ * Group conversations (Beta)
+ * Audio/video calls and conferences
+ * Screen sharing in video calls and conferences
+ * Unlimited peer-to-peer file sharing
+ * Recording and sending audio/video messages
+ * Jami plugins SDK for additional functionality (green screen,
+ watermark, audio filters, and more)
+ * Use Jami as your SIP phone with a variety of media codecs
+ and VoIP providers
+
+ Client applications for GNU/Linux, Windows, macOS, iOS, Android,
+ and Android TV are available, making Jami an interoperable and
+ cross-platform communication framework.
+
+ Seamlessly deploy Jami in your organization using
+ Jami Account Management Server (JAMS). With JAMS, you can enable
+ your users to connect using their LDAP/ActiveDirectory credentials
+ or create local accounts, enabling you to manage your own
+ Jami community while taking advantage of Jami's distributed network
+ architecture. For more information, please visit https://jami.biz.
+
+confinement: strict
+grade: stable
+base: core20
+
+plugs:
+ gnome-3-38-2004:
+ interface: content
+ target: $SNAP/gnome-platform
+ default-provider: gnome-3-38-2004:gnome-3-38-2004
+ gtk-3-themes:
+ interface: content
+ target: $SNAP/data-dir/themes
+ default-provider: gtk-common-themes:gtk-3-themes
+ icon-themes:
+ interface: content
+ target: $SNAP/data-dir/icons
+ default-provider: gtk-common-themes:icon-themes
+ sound-themes:
+ interface: content
+ target: $SNAP/data-dir/sounds
+ default-provider: gtk-common-themes:sounds-themes
+
+slots:
+ dbus-jami:
+ interface: dbus
+ bus: session
+ name: net.jami.Jami
+ dbus-ring:
+ interface: dbus
+ bus: session
+ name: cx.ring.Ring
+
+layout:
+ /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/alsa-lib:
+ bind: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/alsa-lib
+ /usr/share/alsa:
+ bind: $SNAP/usr/share/alsa
+ /usr/share/X11/xkb:
+ bind: $SNAP/usr/share/X11/xkb
+
+environment:
+ XDG_CURRENT_DESKTOP: Unity
+ QT_BASE_DIR: "/usr/lib/libqt-jami"
+ LD_LIBRARY_PATH: "$LD_LIBRARY_PATH:$SNAP$QT_BASE_DIR/lib"
+
+apps:
+ jami:
+ command: usr/bin/jami
+ command-chain:
+ - bin/desktop-launch
+ - snap/command-chain/alsa-launch
+ - bin/jami-wrapper
+ autostart: jami.desktop
+ common-id: net.jami.Jami
+ desktop: usr/share/applications/jami.desktop
+ slots:
+ - dbus-jami
+ - dbus-ring
+ plugs:
+ - alsa
+ - audio-playback
+ - audio-record
+ - browser-support
+ - camera
+ - desktop
+ - desktop-legacy
+ - gsettings
+ - hardware-observe
+ - home
+ - network
+ - network-bind
+ - network-manager
+ - opengl
+ - removable-media
+ - screen-inhibit-control
+ - system-observe
+ - unity7
+ - wayland
+ - x11
+
+package-repositories:
+ - type: apt
+ components: [main]
+ suites: [jami]
+ key-id: A295D773307D25A33AE72F2F64CD5FA175348F84
+ url: https://dl.jami.net/nightly/ubuntu_20.04/
+
+parts:
+ desktop-launch:
+ source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
+ plugin: nil
+ build-packages:
+ - dpkg-dev
+ - gcc
+ - g++
+ - cmake
+ - cmake-data
+ - libqt-jami
+ - devscripts
+ - equivs
+ override-pull: |
+ snapcraftctl pull
+ sed -i -E 's|\. \$SNAP/flavor-select|USE_gtk3=true|' gtk/launcher-specific
+ sed -i -E 's|\. \$SNAP/flavor-select|USE_qt5=true|' qt/launcher-specific
+ sed -i -E 's|(append_dir GTK_PATH \$RUNTIME/usr/lib/\$ARCH/gtk-2.0)|#\1|' qt/launcher-specific
+ sed -i -E 's|\$RUNTIME|$SNAP|g' qt/launcher-specific
+ sed -i -E 's|\$WITH_RUNTIME|no|g' qt/launcher-specific
+ override-build: |
+ snapcraftctl build
+ gcc -Wall -O2 -o bindtextdomain.so -fPIC -shared src/bindtextdomain.c -ldl
+
+ echo "#!/bin/bash" > desktop-launch
+ cat common/init >> desktop-launch
+
+ cat qt/runtime-exports >> desktop-launch
+ cat gtk/runtime-exports >> desktop-launch
+
+ cat common/desktop-exports >> desktop-launch
+
+ cat qt/launcher-specific >> desktop-launch
+ cat gtk/launcher-specific >> desktop-launch
+
+ cat common/mark-and-exec >> desktop-launch
+
+ install -D -m755 desktop-launch $SNAPCRAFT_PART_INSTALL/bin/desktop-launch
+ install -D -m644 bindtextdomain.so $SNAPCRAFT_PART_INSTALL/lib/bindtextdomain.so
+
+ mkdir -pv $SNAPCRAFT_PART_INSTALL/gnome-platform
+
+ scripts:
+ plugin: dump
+ source: common/scripts
+ organize:
+ jami-wrapper: bin/jami-wrapper
+
+ alsa-mixin:
+ plugin: dump
+ source: https://github.com/diddlesnaps/snapcraft-alsa.git
+ source-subdir: snapcraft-assets
+ stage:
+ - -usr/lib/x86_64-linux-gnu/libp11-kit.so*
+ - -usr/lib/x86_64-linux-gnu/libproxy.so*
+ - -usr/share/doc/libp11-kit0/changelog.Debian.gz
+ - -usr/share/doc/libproxy1v5/changelog.Debian.gz
+ build-packages:
+ - libasound2-dev
+ stage-packages:
+ - libasound2
+ - libasound2-plugins
+ - yad
+
+ jami:
+ after: [alsa-mixin]
+ source: .
+ plugin: nil
+ parse-info: [usr/share/metainfo/jami.appdata.xml]
+ stage:
+ - -usr/lib/x86_64-linux-gnu/liblber-2.4.so*
+ - -usr/lib/x86_64-linux-gnu/libldap_r-2.4.so*
+ - -usr/share/doc/libldap-2.4-2/changelog.Debian.gz
+ - -usr/share/doc/libldap-common/changelog.Debian.gz
+ build-environment:
+ - QT_BASE_DIR: "/usr/lib/libqt-jami"
+ - PATH: "$QT_BASE_DIR/bin:$PATH"
+ - LD_LIBRARY_PATH: "$QT_BASE_DIR/lib:$LD_LIBRARY_PATH"
+ - PKG_CONFIG_PATH: "$QT_BASE_DIR/lib/pkgconfig:$PKG_CONFIG_PATH"
+ override-pull: |
+ ls
+ snapcraftctl pull
+ sed -i -E 's|(tmpName) << (PACKAGE_NAME << "_shm_")|\1 << "snap.jami." << \2|' ./daemon/src/media/video/sinkclient.cpp
+ sed -i -E 's|^Icon=.*|Icon=${SNAP}/usr/share/icons/hicolor/scalable/apps/jami.svg|' extras/data/jami.desktop
+ override-build: |
+ cd $SNAPCRAFT_PART_BUILD/daemon/contrib
+ mkdir -p native
+ cd native
+ ../bootstrap
+ make .ffmpeg
+ make
+
+ cd $SNAPCRAFT_PART_BUILD/daemon
+ ./autogen.sh
+ ./configure --prefix=/usr --without-dbus
+ make -j$SNAPCRAFT_PARALLEL_BUILD_COUNT
+ DESTDIR=$SNAPCRAFT_PART_INSTALL make install
+
+ cd $SNAPCRAFT_PART_BUILD/
+ mkdir build
+ cd build
+ cmake .. -DENABLE_LIBWRAP=true \
+ -DLIBJAMI_BUILD_DIR=$SNAPCRAFT_PART_BUILD/daemon/src \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_BUILD_TYPE=Release
+ make -j$SNAPCRAFT_PARALLEL_BUILD_COUNT
+ DESTDIR=$SNAPCRAFT_PART_INSTALL make install
+ build-packages:
+ - autoconf
+ - autoconf-archive
+ - automake
+ - autopoint
+ - bzip2
+ - curl
+ - gcc
+ - g++
+ - gettext
+ - gzip
+ - libnotify-dev
+ - libqrencode-dev
+ - libsndfile1-dev
+ - libspeex-dev
+ - python3
+ - python3-dev
+ - uuid-dev
+ - yasm
+ - wget
+ - nasm # ffmpeg
+ - libavcodec-dev
+ - libavdevice-dev
+ - libavformat-dev
+ - libswscale-dev
+ - libva-dev
+ - libvdpau-dev
+ - libargon2-0-dev # opendht
+ - libexpat1-dev
+ - libjsoncpp-dev
+ - libnm-dev # connectivityChanged()
+ - libdbus-1-dev # dbus
+ - libdbus-c++-dev
+ - libpulse-dev # pulse
+ - libudev-dev
+ - libglu1-mesa-dev # Qt 6
+ - zlib1g-dev
+ - libgl-dev
+ - libvulkan-dev
+ - libgnutls28-dev # TLS
+ - gnutls-bin
+ - libssl-dev
+ stage-packages:
+ - libgnutls30
+ - libavutil56
+ - libdouble-conversion3
+ - libegl1
+ - libgbm1
+ - libgstreamer-gl1.0-0
+ - libgstreamer-plugins-base1.0-0
+ - libgstreamer1.0-0
+ - libgudev-1.0-0
+ - libjsoncpp1
+ - libllvm12
+ - libminizip1
+ - libnm0
+ - libnotify4
+ - libnspr4
+ - libnss3
+ - libopengl0
+ - libopus0
+ - liborc-0.4-0
+ - libpcre2-16-0
+ - libqrencode4
+ - libqt-jami
+ - libsnappy1v5
+ - libspeex1
+ - libproxy1v5
+ - libwayland-server0
+ - libwebpdemux2
+ - libwebpmux3
+ - libxkbfile1
+ - libxtst6
+ - ocl-icd-libopencl1
+ - libva-drm2
+ - libva-glx2
+ - libva-wayland2
+ - libva2
+ - libvdpau-va-gl1
+ - libvdpau1
+ - va-driver-all
+ prime:
+ - -usr/lib/libqt-jami/bin/
+ - -usr/lib/libqt-jami/docs/
+ - -usr/lib/libqt-jami/examples/
+ - -usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libLLVM-*.so*
+ - -usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libclang-*.so*
+ - -usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libflite*.so*
diff --git a/extras/packaging/gnu-linux/scripts/build-package-debian.sh b/extras/packaging/gnu-linux/scripts/build-package-debian.sh
new file mode 100755
index 000000000..8257369cd
--- /dev/null
+++ b/extras/packaging/gnu-linux/scripts/build-package-debian.sh
@@ -0,0 +1,135 @@
+#!/usr/bin/env bash
+#
+# Copyright (C) 2016-2021 Savoir-faire Linux Inc.
+#
+# Author: Alexandre Viau
+# Author: Amin Bandali
+# Author: Maxim Cournoyer
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+# This script is used in the packaging containers to build packages on
+# debian-based distros.
+#
+set -e
+
+DPKG_BUILD_OPTIONS=""
+# Set the host architecture as armhf and add some specific architecture
+# options to the package builder.
+if grep -q "raspbian_10_armhf" <<< "${DISTRIBUTION}"; then
+ echo "Adding armhf as the host architecture."
+ export HOST_ARCH=arm-linux-gnueabihf
+ DPKG_BUILD_OPTIONS="${DPKG_BUILD_OPTIONS} -a armhf"
+fi
+
+cache_packaging=$TARBALLS/$DISTRIBUTION
+mkdir -p "$cache_packaging"
+
+deb_arch=$(dpkg --print-architecture)
+qt_deb_name=libqt-jami_${DEBIAN_QT_VERSION}_${deb_arch}.deb
+qt_deb_path=${cache_packaging}/${qt_deb_name}
+
+QUILT_REFRESH_ARGS="-p 1"
+
+if [ ! -f "${qt_deb_path}" ] || [ "${FORCE_REBUILD_QT}" = "true" ]; then
+ (
+ flock 9 # block until the lock file is gone
+ test -f "${qt_deb_path}" && exit 0 # check again
+
+ # Build Qt.
+ mkdir /opt/libqt-jami-build
+ cd /opt/libqt-jami-build
+
+ qt_version=${QT_MAJOR}.${QT_MINOR}.${QT_PATCH}
+ tarball_name=qt-everywhere-src-${qt_version}.tar.xz
+ cached_tarball=$TARBALLS/$tarball_name
+ qt_base_url=https://download.qt.io/archive/qt/\
+${QT_MAJOR}.${QT_MINOR}/${qt_version}/single
+
+ if [ ! -d "${TARBALLS}" ] || [ ! -w "${TARBALLS}" ]; then
+ echo "error: $TARBALLS does not exist or is not writable"
+ exit 1
+ fi
+
+ if [ ! -f "${cached_tarball}" ]; then
+ (
+ flock 8 # block until the lock file is gone
+ test -f "${cached_tarball}" && exit 0 # check again
+
+ temp_dir=$(mktemp -d)
+ cd "${temp_dir}"
+ wget "${qt_base_url}/${tarball_name}"
+ echo -n "${QT_TARBALL_CHECKSUM} ${tarball_name}" | sha256sum -c - || \
+ (echo "Qt tarball checksum mismatch; quitting" && exit 1)
+ mv "${tarball_name}" "${cached_tarball}"
+ rm -rf "${temp_dir}"
+ ) 8>"${cached_tarball}.lock"
+
+ fi
+
+ cp "${cached_tarball}" "libqt-jami_${qt_version}.orig.tar.xz"
+ tar xvf "libqt-jami_${qt_version}.orig.tar.xz"
+ mv "qt-everywhere-src-${qt_version}" "libqt-jami-${qt_version}"
+ cd "libqt-jami-${qt_version}"
+
+ # Extract the debian folder
+ tar xf "/src/$RELEASE_TARBALL_FILENAME" client-qt/extras/packaging/gnu-linux/rules/debian-qt \
+ --strip-components=5 && mv debian-qt debian
+
+ # Create the changelog file.
+ DEBEMAIL="The Jami project " dch --create \
+ --package libqt-jami \
+ --newversion "${DEBIAN_QT_VERSION}" "New libqt-jami release"
+ DEBEMAIL="The Jami project " dch --release \
+ --distribution "unstable" debian/changelog
+
+ # Build and package Qt.
+ dpkg-buildpackage -uc -us -d ${DPKG_BUILD_OPTIONS}
+
+ # Cache the built .deb.
+ mv "../${qt_deb_name}" "${qt_deb_path}"
+
+ ) 9>"${qt_deb_path}.lock"
+fi
+
+# install libqt-jami from cache
+apt-get install -y "${qt_deb_path}"
+
+# copy libqt-jami to output
+cp "${qt_deb_path}" /opt/output/
+
+# Set up work directory.
+mkdir -p /jami/work && cd /jami/work
+
+# Create a changelog file, required by dpkg-buildpackage.
+mkdir debian
+DEBEMAIL="The Jami project " dch --create --package jami \
+ --newversion "${DEBIAN_VERSION}" "Automatic nightly release"
+DEBEMAIL="The Jami project " dch --release \
+ --distribution "unstable" debian/changelog
+
+# Unpack the source tarball.
+tar -xvf /src/"$RELEASE_TARBALL_FILENAME" --strip-components=1
+
+# Expose the debian directory from here, augmented with the changelog.
+cp debian/changelog extras/packaging/gnu-linux/rules/debian
+rm -r debian
+ln -s extras/packaging/gnu-linux/rules/debian .
+
+# Create the binary packages.
+dpkg-buildpackage -b -uc -us ${DPKG_BUILD_OPTIONS}
+
+# Move the artifacts to the output.
+mv ../*deb /opt/output # .deb and .ddeb packages
+chown -R "${CURRENT_UID}:${CURRENT_UID}" /opt/output
diff --git a/extras/packaging/gnu-linux/scripts/build-package-rpm.sh b/extras/packaging/gnu-linux/scripts/build-package-rpm.sh
new file mode 100755
index 000000000..522578129
--- /dev/null
+++ b/extras/packaging/gnu-linux/scripts/build-package-rpm.sh
@@ -0,0 +1,149 @@
+#!/usr/bin/env bash
+#
+# Copyright (C) 2016-2021 Savoir-faire Linux Inc.
+#
+# Author: Alexandre Viau
+# Author: Maxim Cournoyer
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+# This script is used in the packaging containers to build packages on
+# rpm-based distros.
+#
+set -e
+
+# Import the spec file.
+mkdir -p /opt/client-qt
+cd /opt/client-qt
+tar xf "/src/$RELEASE_TARBALL_FILENAME" client-qt/extras/packaging/gnu-linux/rules/rpm \
+ --strip-components=5 && mv rpm/* . && rmdir rpm
+rm jami-libqt.spec
+
+# Prepare the build tree.
+rpmdev-setuptree
+
+# Copy the source tarball.
+cp --reflink=auto "/src/$RELEASE_TARBALL_FILENAME" /root/rpmbuild/SOURCES
+
+cp patches/0001-qtbug-101201-fatal-error-getcurrenkeyboard.patch /root/rpmbuild/SOURCES/
+
+QT_JAMI_PREFIX="/usr/lib64/qt-jami"
+PATH="${QT_JAMI_PREFIX}/bin:${PATH}"
+LD_LIBRARY_PATH="${QT_JAMI_PREFIX}/lib:${LD_LIBRARY_PATH}"
+PKG_CONFIG_PATH="${QT_JAMI_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}"
+CMAKE_PREFIX_PATH="${QT_JAMI_PREFIX}/lib/cmake:${CMAKE_PREFIX_PATH}"
+QT_MAJOR=6
+QT_MINOR=2
+QT_PATCH=3
+QT_RELEASE_PATCH=5
+
+QT_MAJOR_MINOR=${QT_MAJOR}.${QT_MINOR}
+QT_MAJOR_MINOR_PATCH=${QT_MAJOR}.${QT_MINOR}.${QT_PATCH}
+
+QT_TARBALL_URL=https://download.qt.io/archive/qt/$QT_MAJOR_MINOR/\
+$QT_MAJOR_MINOR_PATCH/single/qt-everywhere-src-$QT_MAJOR_MINOR_PATCH.tar.xz
+
+QT_TARBALL_SHA256="f784998a159334d1f47617fd51bd0619b9dbfe445184567d2cd7c820ccb12771"
+QT_TARBALL_FILE_NAME=$(basename "$QT_TARBALL_URL")
+CACHED_QT_TARBALL=$TARBALLS/$QT_TARBALL_FILE_NAME
+
+mkdir -p "$TARBALLS/$DISTRIBUTION"
+RPM_PATH=$TARBALLS/$DISTRIBUTION/jami-libqt-$QT_MAJOR_MINOR_PATCH-${QT_RELEASE_PATCH}.x86_64.rpm
+if [[ "${DISTRIBUTION:0:4}" == "rhel" ]]; then
+ RPM_PATH=$TARBALLS/${DISTRIBUTION}/jami-libqt-$QT_MAJOR_MINOR_PATCH-${QT_RELEASE_PATCH}.el8.x86_64.rpm
+fi
+
+if [ ! -f "${RPM_PATH}" ]; then
+ # The following block will only run on one build machine at a
+ # time, thanks to flock.
+ (
+ flock 9 # block until the lock is available
+ test -f "$RPM_PATH" && exit 0 # check again
+
+ mkdir /opt/qt-jami-build
+ cd /opt/qt-jami-build
+ tar xf "/src/$RELEASE_TARBALL_FILENAME" \
+ client-qt/extras/packaging/gnu-linux/rules/rpm/jami-libqt.spec \
+ --strip-components=6
+
+ # Fetch and cache the tarball, if not already available.
+ if [ ! -f "$CACHED_QT_TARBALL" ]; then
+ (
+ flock 8 # block until the lock file is gone
+ test -f "$CACHED_QT_TARBALL" && exit 0 # check again
+
+ wget "$QT_TARBALL_URL"
+ if ! echo -n ${QT_TARBALL_SHA256} "$QT_TARBALL_FILE_NAME" | sha256sum -c -
+ then
+ echo "qt tarball checksum mismatch; quitting"
+ exit 1
+ fi
+ mv "$QT_TARBALL_FILE_NAME" "$CACHED_QT_TARBALL"
+ ) 8>"${CACHED_QT_TARBALL}.lock"
+ fi
+
+ cp "$CACHED_QT_TARBALL" "/root/rpmbuild/SOURCES/jami-qtlib_$QT_MAJOR_MINOR_PATCH.tar.xz"
+ sed -i "s/RELEASE_VERSION/$QT_MAJOR_MINOR_PATCH/g" jami-libqt.spec
+ rpmdev-bumpspec --comment="Automatic nightly release" \
+ --userstring="Jenkins " jami-libqt.spec
+
+ rpmbuild --define "debug_package %{nil}" -ba jami-libqt.spec
+ # Note: try to remove with Qt > 6. Else we have a problem with $ORIGIN
+ mkdir -p "$TARBALLS/${DISTRIBUTION}"
+
+ # Cache the built Qt RPM package.
+ if [[ "${DISTRIBUTION:0:4}" == "rhel" ]]; then
+ cp /root/rpmbuild/RPMS/x86_64/jami-libqt-$QT_MAJOR_MINOR_PATCH-*.el8.x86_64.rpm "${RPM_PATH}"
+ elif [[ "${DISTRIBUTION}" == "fedora_33" ]]; then
+ cp /root/rpmbuild/RPMS/x86_64/jami-libqt-$QT_MAJOR_MINOR_PATCH-*.fc33.x86_64.rpm "${RPM_PATH}"
+ elif [[ "${DISTRIBUTION}" == "fedora_34" ]]; then
+ cp /root/rpmbuild/RPMS/x86_64/jami-libqt-$QT_MAJOR_MINOR_PATCH-*.fc34.x86_64.rpm "${RPM_PATH}"
+ elif [[ "${DISTRIBUTION}" == "fedora_35" ]]; then
+ cp /root/rpmbuild/RPMS/x86_64/jami-libqt-$QT_MAJOR_MINOR_PATCH-*.fc35.x86_64.rpm "${RPM_PATH}"
+ elif [[ "${DISTRIBUTION}" == "fedora_36" ]]; then
+ cp /root/rpmbuild/RPMS/x86_64/jami-libqt-$QT_MAJOR_MINOR_PATCH-*.fc36.x86_64.rpm "${RPM_PATH}"
+ elif [[ "${DISTRIBUTION}" == "fedora_37" ]]; then
+ cp /root/rpmbuild/RPMS/x86_64/jami-libqt-$QT_MAJOR_MINOR_PATCH-*.fc37.x86_64.rpm "${RPM_PATH}"
+ else
+ cp /root/rpmbuild/RPMS/x86_64/jami-libqt-*.rpm "${RPM_PATH}"
+ fi
+ ) 9>"${RPM_PATH}.lock"
+fi
+rpm --install "${RPM_PATH}"
+cp "${RPM_PATH}" /opt/output
+cd /opt/client-qt
+
+# Set the version and associated comment.
+sed -i "s/RELEASE_VERSION/${RELEASE_VERSION}/g" ./*.spec
+rpmdev-bumpspec --comment="Automatic nightly release" \
+ --userstring="Jenkins " ./*.spec
+
+# Build the daemon and install it.
+rpmbuild --define "debug_package %{nil}" -ba jami-daemon.spec
+rpm --install /root/rpmbuild/RPMS/x86_64/jami-daemon-*
+
+# Build the temporary transitional packages.
+rpmbuild --define "debug_package %{nil}" -ba jami-libclient.spec
+rpmbuild --define "debug_package %{nil}" -ba jami-qt.spec
+
+# Build the Qt client.
+rpmbuild --define "debug_package %{nil}" -ba jami.spec
+
+# Move the built packages to the output directory.
+mv /root/rpmbuild/RPMS/*/* /opt/output
+touch /opt/output/.packages-built
+chown -R "$CURRENT_UID:$CURRENT_UID" /opt/output
+
+# TODO: One click install: create a package that combines the already
+# built package into one.
diff --git a/extras/packaging/gnu-linux/scripts/build-package-snap.sh b/extras/packaging/gnu-linux/scripts/build-package-snap.sh
new file mode 100755
index 000000000..f6261ae18
--- /dev/null
+++ b/extras/packaging/gnu-linux/scripts/build-package-snap.sh
@@ -0,0 +1,38 @@
+#!/usr/bin/env bash
+#
+# Copyright (C) 2020-2021 Savoir-faire Linux Inc.
+#
+# Author: Amin Bandali
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+# This script is used in the packaging containers to build a snap
+# package on an ubuntu base distro.
+
+
+set -e
+
+tar xf "/src/$RELEASE_TARBALL_FILENAME" -C /opt
+cd /opt/client-qt/
+cp -r extras/packaging/gnu-linux/rules/snap/common .
+cp -r extras/packaging/gnu-linux/rules/snap/${SNAP_PKG_NAME}/snapcraft.yaml .
+
+# set the version and tarball filename
+sed -i "s/RELEASE_VERSION/${RELEASE_VERSION}/g" snapcraft.yaml
+
+snapcraft # requires snapcraft >= 4.8
+
+# move the built snap to output
+mv *.snap /opt/output/
+chown ${CURRENT_UID}:${CURRENT_GID} /opt/output/*.snap
diff --git a/extras/packaging/gnu-linux/scripts/deploy-packages.sh b/extras/packaging/gnu-linux/scripts/deploy-packages.sh
new file mode 100755
index 000000000..10c356d0b
--- /dev/null
+++ b/extras/packaging/gnu-linux/scripts/deploy-packages.sh
@@ -0,0 +1,332 @@
+#!/usr/bin/env bash
+#
+# Copyright (C) 2016-2021 Savoir-faire Linux Inc.
+#
+# Author: Alexandre Viau
+# Author: Guillaume Roguez
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+
+#
+# This script syncs and deploys packages ./extras/packaging/gnu-linux/from packages/distro.
+# It should be run from the project root directory.
+#
+# Requirements
+# - createrepo-c
+# - dpkg
+# - reprepro
+# - rpm
+# - rsync
+# - snapcraft
+
+# Exit immediately if a command exits with a non-zero status
+set -e
+
+###############################
+## Debian / Ubuntu packaging ##
+###############################
+
+function package_deb()
+{
+ DISTRIBUTION_REPOSITORY_FOLDER=$(realpath repositories)/${DISTRIBUTION}
+ mkdir -p ${DISTRIBUTION_REPOSITORY_FOLDER}
+
+ ##################################################
+ ## Create local repository for the given distro ##
+ ##################################################
+ echo "#########################"
+ echo "## Creating repository ##"
+ echo "#########################"
+
+ mkdir ${DISTRIBUTION_REPOSITORY_FOLDER}/conf
+
+ # Distributions file
+ cat << EOF > ${DISTRIBUTION_REPOSITORY_FOLDER}/conf/distributions
+Origin: jami
+Label: Jami ${DISTRIBUTION} Repository
+Codename: jami
+Architectures: i386 amd64 armhf arm64
+Components: main
+Description: This repository contains Jami ${DISTRIBUTION} packages
+SignWith: ${KEYID}
+
+# TODO: Remove when April 2024 comes.
+Origin: ring
+Label: Ring ${DISTRIBUTION} Repository
+Codename: ring
+Architectures: i386 amd64 armhf arm64
+Components: main
+Description: This repository contains Ring ${DISTRIBUTION} packages
+SignWith: ${KEYID}
+EOF
+
+ ####################################
+ ## Add packages to the repository ##
+ ####################################
+ # Note: reprepro currently only accepts .deb files as input, but
+ # Ubuntu generates their debug symbol packages as .ddeb (see:
+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=730572). As
+ # these are just regular Debian packages, simply append the .deb
+ # extension to their file name to work around this.
+ find ./extras/packaging/gnu-linux/packages -type f -name '*.ddeb' -print0 | xargs -0 -I{} mv {} {}.deb
+
+ for package in ./extras/packaging/gnu-linux/packages/${DISTRIBUTION}*/*.deb; do
+ echo "## signing: ${package} ##"
+ dpkg-sig -k ${KEYID} --sign builder ${package}
+
+ echo "## including ${package} ##"
+ package_name=$(dpkg -I ${package} | grep -m 1 Package: | awk '{print $2}')
+ package_arch=$(dpkg -I ${package} | grep -m 1 Architecture: | awk '{print $2}')
+
+ if [ ${package_arch} = "all" ]; then
+ # Removing to avoid the error of adding the same deb twice.
+ # This happens with arch all packages, which are generated in amd64 and i386.
+ reprepro --verbose --basedir ${DISTRIBUTION_REPOSITORY_FOLDER} remove jami ${package_name}
+ # TODO: Remove when April 2024 comes.
+ reprepro --verbose --basedir ${DISTRIBUTION_REPOSITORY_FOLDER} remove ring ${package_name}
+ fi
+ reprepro --verbose --basedir ${DISTRIBUTION_REPOSITORY_FOLDER} includedeb jami ${package}
+ # TODO: Remove when April 2024 comes.
+ reprepro --verbose --basedir ${DISTRIBUTION_REPOSITORY_FOLDER} includedeb ring ${package}
+ done
+
+ # Rebuild the index
+ reprepro --verbose --basedir ${DISTRIBUTION_REPOSITORY_FOLDER} export jami
+ # TODO: Remove when April 2024 comes.
+ reprepro --verbose --basedir ${DISTRIBUTION_REPOSITORY_FOLDER} export ring
+
+ # Show the contents
+ reprepro --verbose --basedir ${DISTRIBUTION_REPOSITORY_FOLDER} list jami
+ # TODO: Remove when April 2024 comes.
+ reprepro --verbose --basedir ${DISTRIBUTION_REPOSITORY_FOLDER} list ring
+
+ #######################################
+ ## create the manual download folder ##
+ #######################################
+ NAME_PATTERN=jami-all_????????.*\~dfsg*.deb
+ if ls ./extras/packaging/gnu-linux/packages/${DISTRIBUTION}/${NAME_PATTERN} &> /dev/null; then
+ DISTRIBUTION_MANUAL_DOWNLOAD_FOLDER=$(realpath manual-download)/${DISTRIBUTION}
+ mkdir -p ${DISTRIBUTION_MANUAL_DOWNLOAD_FOLDER}
+ cp ./extras/packaging/gnu-linux/packages/${DISTRIBUTION}/${NAME_PATTERN} ${DISTRIBUTION_MANUAL_DOWNLOAD_FOLDER}
+ for package in ${DISTRIBUTION_MANUAL_DOWNLOAD_FOLDER}/${NAME_PATTERN} ; do
+ package_name=$(dpkg -I ${package} | grep -m 1 Package: | awk '{print $2}')
+ package_arch=$(dpkg -I ${package} | grep -m 1 Architecture: | awk '{print $2}')
+ package_shortname=${package_name}_${package_arch}.deb
+ rm -f ${DISTRIBUTION_MANUAL_DOWNLOAD_FOLDER}/${package_shortname}
+ cp ${package} ${DISTRIBUTION_MANUAL_DOWNLOAD_FOLDER}/${package_shortname}
+ done
+ fi
+}
+
+
+######################
+## Fedora packaging ##
+######################
+
+function package_rpm()
+{
+ ##################################################
+ ## Create local repository for the given distro ##
+ ##################################################
+ echo "#########################"
+ echo "## Creating repository ##"
+ echo "#########################"
+
+ local name
+ local baseurl
+
+ DISTRIBUTION_REPOSITORY_FOLDER=$(realpath repositories)/${DISTRIBUTION}
+ mkdir -p ${DISTRIBUTION_REPOSITORY_FOLDER}
+
+ # .repo file
+ name="${DISTRIBUTION%_*} \$releasever - \$basearch - jami"
+ baseurl="https://dl.jami.net/${CHANNEL}/${DISTRIBUTION%_*}_\$releasever"
+
+ cat << EOF > ${DISTRIBUTION_REPOSITORY_FOLDER}/jami-${CHANNEL}.repo
+[jami]
+name=$name
+baseurl=$baseurl
+gpgcheck=1
+gpgkey=https://dl.jami.net/jami.pub.key
+enabled=1
+EOF
+
+ ####################################
+ ## Add packages to the repository ##
+ ####################################
+
+ # Sign the rpms
+ echo "##################"
+ echo "## signing rpms ##"
+ echo "##################"
+
+ # RPM macros
+ if [ ! -f ~/.rpmmacros ];
+ then
+ echo "%_signature gpg" > ~/.rpmmacros
+ echo "%_gpg_name ${KEYID}" >> ~/.rpmmacros
+ fi
+
+ for package in ./extras/packaging/gnu-linux/packages/${DISTRIBUTION}*/*.rpm; do
+ rpmsign --resign --key-id=${KEYID} ${package}
+ cp ${package} ${DISTRIBUTION_REPOSITORY_FOLDER}
+ done
+
+ # Create the repo
+ createrepo_c --update ${DISTRIBUTION_REPOSITORY_FOLDER}
+
+ #######################################
+ ## create the manual download folder ##
+ #######################################
+ local packages
+
+ DISTRIBUTION_MANUAL_DOWNLOAD_FOLDER=$(realpath manual-download)/${DISTRIBUTION}
+ mkdir -p ${DISTRIBUTION_MANUAL_DOWNLOAD_FOLDER}
+
+ if [ -d "./extras/packaging/gnu-linux/packages/${DISTRIBUTION}/one-click-install/" ]; then
+ packages=(./extras/packaging/gnu-linux/packages/${DISTRIBUTION}*/one-click-install/*.rpm)
+ else
+ packages=(./extras/packaging/gnu-linux/packages/${DISTRIBUTION}*/*.rpm)
+ fi
+
+ for package in "${packages[@]}"; do
+ cp ${package} ${DISTRIBUTION_MANUAL_DOWNLOAD_FOLDER}
+ package_name=$(rpm -qp --queryformat '%{NAME}' ${package})
+ package_arch=$(rpm -qp --queryformat '%{ARCH}' ${package})
+ cp ${package} ${DISTRIBUTION_MANUAL_DOWNLOAD_FOLDER}/${package_name}_${package_arch}.rpm
+ done
+}
+
+
+####################
+## Snap packaging ##
+####################
+
+function package_snap()
+{
+ echo "####################"
+ echo "## deploying snap ##"
+ echo "####################"
+
+ if [[ "${CHANNEL:0:8}" == "internal" ]]; then
+ DISTRIBUTION_REPOSITORY_FOLDER=$(realpath repositories)/${DISTRIBUTION}
+ mkdir -p ${DISTRIBUTION_REPOSITORY_FOLDER}
+ ls ./extras/packaging/gnu-linux/packages/${DISTRIBUTION}*
+ cp ./extras/packaging/gnu-linux/packages/${DISTRIBUTION}*/*.snap ${DISTRIBUTION_REPOSITORY_FOLDER}/
+ elif [[ $CHANNEL =~ nightly ]]; then
+ echo $(hostname)
+ echo $(whoami)
+ echo $(snapcraft whoami)
+ snapcraft push ./extras/packaging/gnu-linux/packages/${DISTRIBUTION}*/*.snap --release edge
+ elif [[ $CHANNEL =~ stable ]]; then
+ snapcraft push ./extras/packaging/gnu-linux/packages/${DISTRIBUTION}*/*.snap --release stable
+ fi
+}
+
+
+################################################
+## Deploy packages on given remote repository ##
+################################################
+
+function deploy()
+{
+ if [ -f "${SSH_IDENTITY_FILE}" ];
+ then
+ export RSYNC_RSH="ssh -i ${SSH_IDENTITY_FILE}"
+ fi
+
+ echo "##########################"
+ echo "## deploying repository ##"
+ echo "##########################"
+ echo "Using RSYNC_RSH='${RSYNC_RSH}'"
+ rsync --archive --recursive --verbose \
+ --delete ${DISTRIBUTION_REPOSITORY_FOLDER} \
+ ${REMOTE_REPOSITORY_LOCATION}
+
+ echo "#####################################"
+ echo "## deploying manual download files ##"
+ echo "#####################################"
+ rsync --archive --recursive --verbose \
+ --delete ${DISTRIBUTION_MANUAL_DOWNLOAD_FOLDER} \
+ ${REMOTE_MANUAL_DOWNLOAD_LOCATION}
+}
+
+
+##########################################################
+## Detect suitable packaging based on distribution name ##
+##########################################################
+
+function package()
+{
+ if [[ $DISTRIBUTION =~ debian|ubuntu|raspbian|guix-deb-pack ]]; then
+ package_deb
+ elif [[ $DISTRIBUTION =~ fedora|rhel|opensuse ]]; then
+ package_rpm
+ elif [[ $DISTRIBUTION =~ snap ]]; then
+ package_snap
+ else
+ echo "error: Distribution \"$DISTRIBUTION\" is not supported"
+ fi
+}
+
+function remove-deployed-files()
+{
+ # remove deployed files
+ rm -rf manual-download
+ rm -rf repositories
+ rm -rf ${DISTRIBUTION_REPOSITORY_FOLDER}
+}
+
+for i in "$@"
+do
+case $i in
+ --distribution=*)
+ DISTRIBUTION="${i#*=}"
+ shift
+ ;;
+ --keyid=*)
+ KEYID="${i#*=}"
+ shift
+ ;;
+ --remote-repository-location=*)
+ REMOTE_REPOSITORY_LOCATION="${i#*=}"
+ shift
+ ;;
+ --remote-manual-download-location=*)
+ REMOTE_MANUAL_DOWNLOAD_LOCATION="${i#*=}"
+ shift
+ ;;
+ --remote-ssh-identity-file=*)
+ SSH_IDENTITY_FILE="${i#*=}"
+ shift
+ ;;
+ *)
+ echo "Unrecognized option ${i}"
+ exit 1
+ ;;
+esac
+done
+
+
+if [ -z "${KEYID}" ];
+then
+ DISTRIBUTION_REPOSITORY_FOLDER=$(realpath repositories)/${DISTRIBUTION}
+ DISTRIBUTION_MANUAL_DOWNLOAD_FOLDER=$(realpath manual-download)/${DISTRIBUTION}
+ deploy
+ remove-deployed-files
+else
+ package
+ deploy
+fi
diff --git a/extras/packaging/gnu-linux/scripts/install-cmake.sh b/extras/packaging/gnu-linux/scripts/install-cmake.sh
new file mode 100755
index 000000000..db868a917
--- /dev/null
+++ b/extras/packaging/gnu-linux/scripts/install-cmake.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+
+set -e
+
+if command -v apt-get &> /dev/null
+then
+ apt-get remove cmake cmake-data -y
+fi
+
+wget https://github.com/Kitware/CMake/releases/download/v3.19.8/cmake-3.19.8-Linux-x86_64.sh \
+ -q -O /tmp/cmake-install.sh
+echo "aa5a0e0dd5594b7fd7c107a001a2bfb5f83d9b5d89cf4acabf423c5d977863ad /tmp/cmake-install.sh" | sha256sum --check
+chmod u+x /tmp/cmake-install.sh
+/tmp/cmake-install.sh --skip-license --prefix=/usr/local/
+rm /tmp/cmake-install.sh
\ No newline at end of file
diff --git a/extras/packaging/gnu-linux/scripts/prebuild-package-debian.sh b/extras/packaging/gnu-linux/scripts/prebuild-package-debian.sh
new file mode 100755
index 000000000..ba0bce80f
--- /dev/null
+++ b/extras/packaging/gnu-linux/scripts/prebuild-package-debian.sh
@@ -0,0 +1,86 @@
+#!/usr/bin/env bash
+#
+# Copyright (C) 2021 Savoir-faire Linux Inc.
+#
+# Author: Amin Bandali
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+# This script is used in the packaging containers to build packages on
+# debian-based distros.
+
+set -e
+
+DPKG_BUILD_OPTIONS=""
+# Set the host architecture as armhf and add some specific architecture
+# options to the package builder.
+if grep -q "raspbian_10_armhf" <<< "${DISTRIBUTION}"; then
+ echo "Adding armhf as the host architecture."
+ export HOST_ARCH=arm-linux-gnueabihf
+ DPKG_BUILD_OPTIONS="${DPKG_BUILD_OPTIONS} -a armhf"
+fi
+
+install_deps()
+{
+ apt-get update
+ mk-build-deps \
+ --remove --install \
+ --tool "apt-get -y --no-install-recommends -o Acquire::Retries=10" \
+ "debian/control"
+}
+
+install_dummy()
+{
+ cat < dummy-libqt-jami.equivs
+Package: libqt-jami
+Version: 1.0
+Maintainer: The Jami project
+Architecture: all
+Description: Dummy libqt-jami package
+EOF
+ equivs-build dummy-libqt-jami.equivs
+ dpkg -i libqt-jami_1.0_all.deb
+}
+
+remove_dummy()
+{
+ dpkg -r libqt-jami
+}
+
+case "$1" in
+ qt-deps)
+ (
+ cd /tmp/builddeps
+ install_deps
+ dpkg -r libqt-jami-build-deps
+ )
+ rm -rf /tmp/builddeps
+ exit 0
+ ;;
+ jami-deps)
+ (
+ cd /tmp/builddeps
+ install_dummy
+ install_deps
+ dpkg -r jami-build-deps
+ remove_dummy
+ )
+ rm -rf /tmp/builddeps
+ exit 0
+ ;;
+ *)
+ printf "Usage: %s {qt-deps|jami-deps}\n" "$0"
+ exit 1
+ ;;
+esac
diff --git a/extras/packaging/gnu-linux/tarballs.manifest b/extras/packaging/gnu-linux/tarballs.manifest
new file mode 100644
index 000000000..b3e813177
--- /dev/null
+++ b/extras/packaging/gnu-linux/tarballs.manifest
@@ -0,0 +1,16 @@
+/home/amarok/Projects/jami/daemon/contrib/tarballs/asio-asio-1-22-1.tar.gz
+/home/amarok/Projects/jami/daemon/contrib/tarballs/ffmpeg-n5.0.tar.gz
+/home/amarok/Projects/jami/daemon/contrib/tarballs/ffnvcodec-n11.1.5.1.tar.xz
+/home/amarok/Projects/jami/daemon/contrib/tarballs/fmt-9.1.0.tar.gz
+/home/amarok/Projects/jami/daemon/contrib/tarballs/gmp-6.2.1.tar.bz2
+/home/amarok/Projects/jami/daemon/contrib/tarballs/http-parser-2.9.4.tar.gz
+/home/amarok/Projects/jami/daemon/contrib/tarballs/libarchive-3.6.0.tar.xz
+/home/amarok/Projects/jami/daemon/contrib/tarballs/libgit2-v1.1.0.tar.gz
+/home/amarok/Projects/jami/daemon/contrib/tarballs/libnatpmp-20150609.tar.gz
+/home/amarok/Projects/jami/daemon/contrib/tarballs/opendht-af7d88b057fa4c84ab9096c6a1932bd5d34634ef.tar.gz
+/home/amarok/Projects/jami/daemon/contrib/tarballs/pjproject-513a3f14c44b2c2652f9219ec20dea64b236b713.tar.gz
+/home/amarok/Projects/jami/daemon/contrib/tarballs/restinio-bbaa034dbcc7555ce67df0f8a1475591a7441733.tar.gz
+/home/amarok/Projects/jami/daemon/contrib/tarballs/secp256k1-0b7024185045a49a1a6a4c5615bf31c94f63d9c4.tar.gz
+/home/amarok/Projects/jami/daemon/contrib/tarballs/pupnp-release-1.14.13.tar.gz
+/home/amarok/Projects/jami/daemon/contrib/tarballs/libvpx-v1.12.0.tar.gz
+/home/amarok/Projects/jami/daemon/contrib/tarballs/webrtc-audio-processing-v0.3.1.tar.gz