Skip to content
Snippets Groups Projects
Commit 027bd5e2 authored by Amin Bandali's avatar Amin Bandali Committed by Sébastien Blin
Browse files

packaging: simplify build of libqt-jami deb packages

Since the introduction of libqt-jami deb packages, they were built
using quite an ugly hack on the Jenkins side.  This patch reworks all
of that so that libqt-jami is built for each distro version if it was
not already previously built, or if a force rebuild is specified.

Change-Id: Ib74b747628a007cd0d61b068e0ff9ed80006b93d
parent 8b900aa8
No related branches found
No related tags found
No related merge requests found
Showing
with 211 additions and 376 deletions
......@@ -5,29 +5,21 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean
RUN apt-get update && \
apt-get install -y -o Acquire::Retries=10 \
ca-certificates \
devscripts \
dirmngr \
gnupg \
equivs \
wget
RUN wget -O - https://dl.jami.net/public-key.gpg | \
tee /usr/share/keyrings/jami-archive-keyring.gpg > /dev/null
RUN sh -c "echo 'deb [signed-by=/usr/share/keyrings/jami-archive-keyring.gpg] https://dl.jami.net/nightly/debian_10_qt/ jami main' > /etc/apt/sources.list.d/libqt-jami.list"
# add deb-src entries (needed for next step)
RUN sed -n '/^deb\s/s//deb-src /p' /etc/apt/sources.list > /etc/apt/sources.list.d/deb-src.list
RUN apt-get clean && apt-get update
ADD scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
COPY packaging/rules/debian-qt/* /tmp/builddeps/debian/
RUN /opt/prebuild-package-debian.sh qt-deps
COPY packaging/rules/debian/* /tmp/builddeps/debian/
RUN cd /tmp/builddeps && \
apt-get update; \
mk-build-deps \
--remove --install \
--tool "apt-get -y --no-install-recommends -o Acquire::Retries=10" \
"debian/control"; \
cd / && rm -rf /tmp/builddeps
RUN /opt/prebuild-package-debian.sh jami-deps
ADD scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD /opt/build-package-debian.sh
FROM debian:buster
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean
RUN apt-get update && \
apt-get install -y -o Acquire::Retries=10 \
devscripts \
wget
# add/enable src repos (needed for next step)
RUN sed -n '/^deb\s/s//deb-src /p' /etc/apt/sources.list > /etc/apt/sources.list.d/deb-src.list
RUN apt-get clean && apt-get update
COPY packaging/rules/debian-qt/* /tmp/builddeps/debian/
RUN cd /tmp/builddeps && \
apt-get update; \
mk-build-deps \
--remove --install \
--tool "apt-get -y --no-install-recommends -o Acquire::Retries=10" \
"debian/control"; \
cd / && rm -rf /tmp/builddeps
ADD scripts/build-package-debian-qt.sh /opt/build-package-debian-qt.sh
CMD /opt/build-package-debian-qt.sh
......@@ -5,29 +5,21 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean
RUN apt-get update && \
apt-get install -y -o Acquire::Retries=10 \
ca-certificates \
devscripts \
dirmngr \
gnupg \
equivs \
wget
RUN wget -O - https://dl.jami.net/public-key.gpg | \
tee /usr/share/keyrings/jami-archive-keyring.gpg > /dev/null
RUN sh -c "echo 'deb [signed-by=/usr/share/keyrings/jami-archive-keyring.gpg] https://dl.jami.net/nightly/debian_testing_qt/ jami main' > /etc/apt/sources.list.d/libqt-jami.list"
# add deb-src entries (needed for next step)
RUN sed -n '/^deb\s/s//deb-src /p' /etc/apt/sources.list > /etc/apt/sources.list.d/deb-src.list
RUN apt-get clean && apt-get update
ADD scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
COPY packaging/rules/debian-qt/* /tmp/builddeps/debian/
RUN /opt/prebuild-package-debian.sh qt-deps
COPY packaging/rules/debian/* /tmp/builddeps/debian/
RUN cd /tmp/builddeps && \
apt-get update; \
mk-build-deps \
--remove --install \
--tool "apt-get -y --no-install-recommends -o Acquire::Retries=10" \
"debian/control"; \
cd / && rm -rf /tmp/builddeps
RUN /opt/prebuild-package-debian.sh jami-deps
ADD scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD /opt/build-package-debian.sh
FROM debian:testing
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean
RUN apt-get update && \
apt-get install -y -o Acquire::Retries=10 \
devscripts \
wget
# add/enable src repos (needed for next step)
RUN sed -n '/^deb\s/s//deb-src /p' /etc/apt/sources.list > /etc/apt/sources.list.d/deb-src.list
RUN apt-get clean && apt-get update
COPY packaging/rules/debian-qt/* /tmp/builddeps/debian/
RUN cd /tmp/builddeps && \
apt-get update; \
mk-build-deps \
--remove --install \
--tool "apt-get -y --no-install-recommends -o Acquire::Retries=10" \
"debian/control"; \
cd / && rm -rf /tmp/builddeps
ADD scripts/build-package-debian-qt.sh /opt/build-package-debian-qt.sh
CMD /opt/build-package-debian-qt.sh
......@@ -5,29 +5,21 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean
RUN apt-get update && \
apt-get install -y -o Acquire::Retries=10 \
ca-certificates \
devscripts \
dirmngr \
gnupg \
equivs \
wget
RUN wget -O - https://dl.jami.net/public-key.gpg | \
tee /usr/share/keyrings/jami-archive-keyring.gpg > /dev/null
RUN sh -c "echo 'deb [signed-by=/usr/share/keyrings/jami-archive-keyring.gpg] https://dl.jami.net/nightly/debian_unstable_qt/ jami main' > /etc/apt/sources.list.d/libqt-jami.list"
# add deb-src entries (needed for next step)
RUN sed -n '/^deb\s/s//deb-src /p' /etc/apt/sources.list > /etc/apt/sources.list.d/deb-src.list
RUN apt-get clean && apt-get update
ADD scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
COPY packaging/rules/debian-qt/* /tmp/builddeps/debian/
RUN /opt/prebuild-package-debian.sh qt-deps
COPY packaging/rules/debian/* /tmp/builddeps/debian/
RUN cd /tmp/builddeps && \
apt-get update; \
mk-build-deps \
--remove --install \
--tool "apt-get -y --no-install-recommends -o Acquire::Retries=10" \
"debian/control"; \
cd / && rm -rf /tmp/builddeps
RUN /opt/prebuild-package-debian.sh jami-deps
ADD scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD /opt/build-package-debian.sh
FROM debian:unstable
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean
RUN apt-get update && \
apt-get install -y -o Acquire::Retries=10 \
devscripts \
wget
# add/enable src repos (needed for next step)
RUN sed -n '/^deb\s/s//deb-src /p' /etc/apt/sources.list > /etc/apt/sources.list.d/deb-src.list
RUN apt-get clean && apt-get update
COPY packaging/rules/debian-qt/* /tmp/builddeps/debian/
RUN cd /tmp/builddeps && \
apt-get update; \
mk-build-deps \
--remove --install \
--tool "apt-get -y --no-install-recommends -o Acquire::Retries=10" \
"debian/control"; \
cd / && rm -rf /tmp/builddeps
ADD scripts/build-package-debian-qt.sh /opt/build-package-debian-qt.sh
CMD /opt/build-package-debian-qt.sh
......@@ -5,35 +5,26 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean
RUN apt-get update && \
apt-get install -y -o Acquire::Retries=10 \
ca-certificates \
devscripts \
dirmngr \
equivs \
gcc-8 \
g++-8 \
gnupg \
wget
RUN wget -O - https://dl.jami.net/public-key.gpg | \
tee /usr/share/keyrings/jami-archive-keyring.gpg > /dev/null
RUN sh -c "echo 'deb [signed-by=/usr/share/keyrings/jami-archive-keyring.gpg] https://dl.jami.net/nightly/ubuntu_18.04_qt/ jami main' > /etc/apt/sources.list.d/libqt-jami.list"
# add deb-src entries (needed for next step)
RUN sed -n '/^deb\s/s//deb-src /p' /etc/apt/sources.list > /etc/apt/sources.list.d/deb-src.list
RUN apt-get clean && apt-get update
ADD scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
COPY packaging/rules/debian-qt/* /tmp/builddeps/debian/
RUN /opt/prebuild-package-debian.sh qt-deps
COPY packaging/rules/debian/* /tmp/builddeps/debian/
RUN cd /tmp/builddeps && \
apt-get update; \
mk-build-deps \
--remove --install \
--tool "apt-get -y --no-install-recommends -o Acquire::Retries=10" \
"debian/control"; \
cd / && rm -rf /tmp/builddeps
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
ADD scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD /opt/build-package-debian.sh
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 \
wget
# add/enable src repos (needed for next step)
RUN sed -n '/^deb\s/s//deb-src /p' /etc/apt/sources.list > /etc/apt/sources.list.d/deb-src.list
RUN apt-get clean && apt-get update
COPY packaging/rules/debian-qt/* /tmp/builddeps/debian/
RUN cd /tmp/builddeps && \
apt-get update; \
mk-build-deps \
--remove --install \
--tool "apt-get -y --no-install-recommends -o Acquire::Retries=10" \
"debian/control"; \
cd / && rm -rf /tmp/builddeps
ADD scripts/build-package-debian-qt.sh /opt/build-package-debian-qt.sh
CMD /opt/build-package-debian-qt.sh
......@@ -5,30 +5,21 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean
RUN apt-get update && \
apt-get install -y -o Acquire::Retries=10 \
ca-certificates \
devscripts \
dirmngr \
equivs \
gnupg \
wget
RUN wget -O - https://dl.jami.net/public-key.gpg | \
tee /usr/share/keyrings/jami-archive-keyring.gpg > /dev/null
RUN sh -c "echo 'deb [signed-by=/usr/share/keyrings/jami-archive-keyring.gpg] https://dl.jami.net/nightly/ubuntu_20.04_qt/ jami main' > /etc/apt/sources.list.d/libqt-jami.list"
# add deb-src entries (needed for next step)
RUN sed -n '/^deb\s/s//deb-src /p' /etc/apt/sources.list > /etc/apt/sources.list.d/deb-src.list
RUN apt-get clean && apt-get update
ADD scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
COPY packaging/rules/debian-qt/* /tmp/builddeps/debian/
RUN /opt/prebuild-package-debian.sh qt-deps
COPY packaging/rules/debian/* /tmp/builddeps/debian/
RUN cd /tmp/builddeps && \
apt-get update; \
mk-build-deps \
--remove --install \
--tool "apt-get -y --no-install-recommends -o Acquire::Retries=10" \
"debian/control"; \
cd / && rm -rf /tmp/builddeps
RUN /opt/prebuild-package-debian.sh jami-deps
ADD scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD /opt/build-package-debian.sh
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 \
wget
# add/enable src repos (needed for next step)
RUN sed -n '/^deb\s/s//deb-src /p' /etc/apt/sources.list > /etc/apt/sources.list.d/deb-src.list
RUN apt-get clean && apt-get update
COPY packaging/rules/debian-qt/* /tmp/builddeps/debian/
RUN cd /tmp/builddeps && \
apt-get update; \
mk-build-deps \
--remove --install \
--tool "apt-get -y --no-install-recommends -o Acquire::Retries=10" \
"debian/control"; \
cd / && rm -rf /tmp/builddeps
ADD scripts/build-package-debian-qt.sh /opt/build-package-debian-qt.sh
CMD /opt/build-package-debian-qt.sh
......@@ -5,30 +5,21 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean
RUN apt-get update && \
apt-get install -y -o Acquire::Retries=10 \
ca-certificates \
devscripts \
dirmngr \
equivs \
gnupg \
wget
RUN wget -O - https://dl.jami.net/public-key.gpg | \
tee /usr/share/keyrings/jami-archive-keyring.gpg > /dev/null
RUN sh -c "echo 'deb [signed-by=/usr/share/keyrings/jami-archive-keyring.gpg] https://dl.jami.net/nightly/ubuntu_20.10_qt/ jami main' > /etc/apt/sources.list.d/libqt-jami.list"
# add deb-src entries (needed for next step)
RUN sed -n '/^deb\s/s//deb-src /p' /etc/apt/sources.list > /etc/apt/sources.list.d/deb-src.list
RUN apt-get clean && apt-get update
ADD scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
COPY packaging/rules/debian-qt/* /tmp/builddeps/debian/
RUN /opt/prebuild-package-debian.sh qt-deps
COPY packaging/rules/debian/* /tmp/builddeps/debian/
RUN cd /tmp/builddeps && \
apt-get update; \
mk-build-deps \
--remove --install \
--tool "apt-get -y --no-install-recommends -o Acquire::Retries=10" \
"debian/control"; \
cd / && rm -rf /tmp/builddeps
RUN /opt/prebuild-package-debian.sh jami-deps
ADD scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD /opt/build-package-debian.sh
FROM ubuntu:20.10
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean
RUN apt-get update && \
apt-get install -y -o Acquire::Retries=10 \
devscripts \
equivs \
wget
# add/enable src repos (needed for next step)
RUN sed -n '/^deb\s/s//deb-src /p' /etc/apt/sources.list > /etc/apt/sources.list.d/deb-src.list
RUN apt-get clean && apt-get update
COPY packaging/rules/debian-qt/* /tmp/builddeps/debian/
RUN cd /tmp/builddeps && \
apt-get update; \
mk-build-deps \
--remove --install \
--tool "apt-get -y --no-install-recommends -o Acquire::Retries=10" \
"debian/control"; \
cd / && rm -rf /tmp/builddeps
ADD scripts/build-package-debian-qt.sh /opt/build-package-debian-qt.sh
CMD /opt/build-package-debian-qt.sh
......@@ -5,30 +5,21 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean
RUN apt-get update && \
apt-get install -y -o Acquire::Retries=10 \
ca-certificates \
devscripts \
dirmngr \
equivs \
gnupg \
wget
RUN wget -O - https://dl.jami.net/public-key.gpg | \
tee /usr/share/keyrings/jami-archive-keyring.gpg > /dev/null
RUN sh -c "echo 'deb [signed-by=/usr/share/keyrings/jami-archive-keyring.gpg] https://dl.jami.net/nightly/ubuntu_21.04_qt/ jami main' > /etc/apt/sources.list.d/libqt-jami.list"
# add deb-src entries (needed for next step)
RUN sed -n '/^deb\s/s//deb-src /p' /etc/apt/sources.list > /etc/apt/sources.list.d/deb-src.list
RUN apt-get clean && apt-get update
ADD scripts/prebuild-package-debian.sh /opt/prebuild-package-debian.sh
COPY packaging/rules/debian-qt/* /tmp/builddeps/debian/
RUN /opt/prebuild-package-debian.sh qt-deps
COPY packaging/rules/debian/* /tmp/builddeps/debian/
RUN cd /tmp/builddeps && \
apt-get update; \
mk-build-deps \
--remove --install \
--tool "apt-get -y --no-install-recommends -o Acquire::Retries=10" \
"debian/control"; \
cd / && rm -rf /tmp/builddeps
RUN /opt/prebuild-package-debian.sh jami-deps
ADD scripts/build-package-debian.sh /opt/build-package-debian.sh
CMD /opt/build-package-debian.sh
\ No newline at end of file
CMD /opt/build-package-debian.sh
FROM ubuntu:21.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get clean
RUN apt-get update && \
apt-get install -y -o Acquire::Retries=10 \
devscripts \
equivs \
wget
# add/enable src repos (needed for next step)
RUN sed -n '/^deb\s/s//deb-src /p' /etc/apt/sources.list > /etc/apt/sources.list.d/deb-src.list
RUN apt-get clean && apt-get update
COPY packaging/rules/debian-qt/* /tmp/builddeps/debian/
RUN cd /tmp/builddeps && \
apt-get update; \
mk-build-deps \
--remove --install \
--tool "apt-get -y --no-install-recommends -o Acquire::Retries=10" \
"debian/control"; \
cd / && rm -rf /tmp/builddeps
ADD scripts/build-package-debian-qt.sh /opt/build-package-debian-qt.sh
CMD /opt/build-package-debian-qt.sh
......@@ -3,6 +3,8 @@
# Copyright (C) 2016-2021 Savoir-faire Linux Inc.
#
# Author: Alexandre Viau <alexandre.viau@savoirfairelinux.com>
# Author: Amin Bandali <amin.bandali@savoirfairelinux.com>
# Author: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
#
# 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
......@@ -31,7 +33,71 @@ if grep -q "raspbian_10_armhf" <<< "${DISTRIBUTION}"; then
DPKG_BUILD_OPTIONS="${DPKG_BUILD_OPTIONS} -a armhf"
fi
# Setup work directory.
cache_packaging=/opt/cache-packaging/${DISTRIBUTION}
deb_arch=$(dpkg --print-architecture)
qt_deb_name=libqt-jami_${DEBIAN_QT_VERSION}_${deb_arch}.deb
qt_deb_path=${cache_packaging}/${qt_deb_name}
if [ ! -f "${qt_deb_path}" ] || [ "${FORCE_REBUILD_QT}" = "true" ]; then
# we need to build Qt
cache_dir=/opt/ring-contrib
temp_dir=$(mktemp -d)
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="${cache_dir}/${tarball_name}"
qt_base_url=https://download.qt.io/archive/qt/${QT_MAJOR}.${QT_MINOR}/${qt_version}/single
if [ ! -d "${cache_dir}" ] || [ ! -w "${cache_dir}" ]; then
echo "error: $cache_dir does not exist or is not writable"
exit 1
fi
if [ ! -f "${cached_tarball}" ]; then
(
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)
flock "${cached_tarball}.lock" mv "${tarball_name}" "${cached_tarball}"
)
rm -rf "${temp_dir}"
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}
# import the debian folder
cp --verbose -r /opt/ring-project-ro/packaging/rules/debian-qt debian
# create changelog file
DEBEMAIL="The Jami project <jami@gnu.org>" dch --create \
--package libqt-jami \
--newversion ${DEBIAN_QT_VERSION} "New libqt-jami release"
DEBEMAIL="The Jami project <jami@gnu.org>" dch --release \
--distribution "unstable" debian/changelog
# build and package qt
dpkg-buildpackage -uc -us ${DPKG_BUILD_OPTIONS}
# copy the built deb to cache
mkdir -p ${cache_packaging}/
cp ../${qt_deb_name} ${qt_deb_path}
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.
......
......@@ -31,39 +31,10 @@ set -e
## Debian / Ubuntu packaging ##
###############################
function fetch_qt_deb()
{
if [ -f "${SSH_IDENTITY_FILE}" ];
then
export RSYNC_RSH="ssh -i ${SSH_IDENTITY_FILE}"
fi
echo "#####################"
echo "## fetching qt deb ##"
echo "#####################"
echo "Using RSYNC_RSH='${RSYNC_RSH}'"
rsync --archive --verbose \
${REMOTE_REPOSITORY_LOCATION}/${DISTRIBUTION}_qt/pool/main/libq/libqt-jami/*.deb \
${DISTRIBUTION_REPOSITORY_FOLDER}_qt/
}
# True if $DISTRIBUTION ends by _qt
is_distribution_qt() {
[[ $DISTRIBUTION =~ _qt$ ]]
}
function package_deb()
{
DISTRIBUTION_REPOSITORY_FOLDER=$(realpath repositories)/${DISTRIBUTION}
mkdir -p ${DISTRIBUTION_REPOSITORY_FOLDER}
mkdir -p ${DISTRIBUTION_REPOSITORY_FOLDER}_qt
###########################################################
## fetch qt deb (if not currently building a qt package) ##
###########################################################
if ! is_distribution_qt; then
fetch_qt_deb
fi
##################################################
## Create local repository for the given distro ##
......@@ -98,9 +69,6 @@ EOF
## Add packages to the repository ##
####################################
packages="packages/${DISTRIBUTION}*/*.deb"
if ! is_distribution_qt; then
packages+=" ${DISTRIBUTION_REPOSITORY_FOLDER}_qt/*.deb"
fi
for package in ${packages}; do
# Sign the deb
......
......@@ -51,6 +51,7 @@ PACKAGE_%(distribution)s_DOCKER_RUN_COMMAND = docker run \\
-e RELEASE_VERSION=$(RELEASE_VERSION) \\
-e RELEASE_TARBALL_FILENAME=$(RELEASE_TARBALL_FILENAME) \\
-e DEBIAN_VERSION=%(version)s \\
-e DEBIAN_QT_VERSION=%(version_qt)s \\
-e CURRENT_UID=$(CURRENT_UID) \\
-e CURRENT_GID=$(CURRENT_GID) \\
-e DISTRIBUTION=%(distribution)s \\
......@@ -91,32 +92,32 @@ RPM_BASED_SYSTEMS_DOCKER_RUN_OPTIONS = (
'--privileged')
DPKG_BASED_SYSTEMS_DOCKER_RUN_OPTIONS = (
'-e QT_JAMI_PREFIX=$(QT_JAMI_PREFIX) '
'--privileged '
'--security-opt apparmor=docker-default ')
DPKG_BASED_SYSTEMS_DOCKER_RUN_OPTIONS_QT = (
'-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) '
'-v /opt/ring-contrib:/opt/ring-contrib '
'--privileged --security-opt apparmor=docker-default')
'--privileged '
'--security-opt apparmor=docker-default ')
def generate_target(distribution, output_file, options='', docker_image='',
version='', docker_build_args=''):
version='', version_qt='', docker_build_args=''):
if (docker_image == ''):
docker_image = distribution
if (version == ''):
version = "$(DEBIAN_VERSION)"
if (version_qt == ''):
version_qt = "$(DEBIAN_QT_VERSION)"
return target_template % {
"distribution": distribution,
"docker_image": docker_image,
"output_file": output_file,
"options": options,
"version": version,
"version_qt": version_qt,
"docker_build_args": docker_build_args,
}
......@@ -126,7 +127,8 @@ def run_generate(parsed_args):
parsed_args.output_file,
parsed_args.options,
parsed_args.docker_image,
parsed_args.version))
parsed_args.version,
parsed_args.version_qt))
def run_generate_all(parsed_args):
......@@ -137,34 +139,16 @@ def run_generate_all(parsed_args):
"output_file": "$(DEBIAN_DSC_FILENAME)",
"options": DPKG_BASED_SYSTEMS_DOCKER_RUN_OPTIONS,
},
{
"distribution": "debian_10_qt",
"output_file": "$(DEBIAN_QT_DSC_FILENAME)",
"options": DPKG_BASED_SYSTEMS_DOCKER_RUN_OPTIONS_QT,
"version": "$(DEBIAN_QT_VERSION)",
},
{
"distribution": "debian_testing",
"output_file": "$(DEBIAN_DSC_FILENAME)",
"options": DPKG_BASED_SYSTEMS_DOCKER_RUN_OPTIONS,
},
{
"distribution": "debian_testing_qt",
"output_file": "$(DEBIAN_QT_DSC_FILENAME)",
"options": DPKG_BASED_SYSTEMS_DOCKER_RUN_OPTIONS_QT,
"version": "$(DEBIAN_QT_VERSION)",
},
{
"distribution": "debian_unstable",
"output_file": "$(DEBIAN_DSC_FILENAME)",
"options": DPKG_BASED_SYSTEMS_DOCKER_RUN_OPTIONS,
},
{
"distribution": "debian_unstable_qt",
"output_file": "$(DEBIAN_QT_DSC_FILENAME)",
"options": DPKG_BASED_SYSTEMS_DOCKER_RUN_OPTIONS_QT,
"version": "$(DEBIAN_QT_VERSION)",
},
# Raspbian
{
"distribution": "raspbian_10_armhf",
......@@ -175,47 +159,23 @@ def run_generate_all(parsed_args):
{
"distribution": "ubuntu_18.04",
"output_file": "$(DEBIAN_DSC_FILENAME)",
"options": "-e QT_JAMI_PREFIX=$(QT_JAMI_PREFIX)",
},
{
"distribution": "ubuntu_18.04_qt",
"output_file": "$(DEBIAN_QT_DSC_FILENAME)",
"options": DPKG_BASED_SYSTEMS_DOCKER_RUN_OPTIONS_QT,
"version": "$(DEBIAN_QT_VERSION)",
"options": DPKG_BASED_SYSTEMS_DOCKER_RUN_OPTIONS,
},
{
"distribution": "ubuntu_20.04",
"output_file": "$(DEBIAN_DSC_FILENAME)",
"options": DPKG_BASED_SYSTEMS_DOCKER_RUN_OPTIONS,
},
{
"distribution": "ubuntu_20.04_qt",
"output_file": "$(DEBIAN_QT_DSC_FILENAME)",
"options": DPKG_BASED_SYSTEMS_DOCKER_RUN_OPTIONS_QT,
"version": "$(DEBIAN_QT_VERSION)",
},
{
"distribution": "ubuntu_20.10",
"output_file": "$(DEBIAN_DSC_FILENAME)",
"options": DPKG_BASED_SYSTEMS_DOCKER_RUN_OPTIONS,
},
{
"distribution": "ubuntu_20.10_qt",
"output_file": "$(DEBIAN_QT_DSC_FILENAME)",
"options": DPKG_BASED_SYSTEMS_DOCKER_RUN_OPTIONS_QT,
"version": "$(DEBIAN_QT_VERSION)",
},
{
"distribution": "ubuntu_21.04",
"output_file": "$(DEBIAN_DSC_FILENAME)",
"options": DPKG_BASED_SYSTEMS_DOCKER_RUN_OPTIONS,
},
{
"distribution": "ubuntu_21.04_qt",
"output_file": "$(DEBIAN_QT_DSC_FILENAME)",
"options": DPKG_BASED_SYSTEMS_DOCKER_RUN_OPTIONS_QT,
"version": "$(DEBIAN_QT_VERSION)",
},
# Fedora
{
"distribution": "fedora_32",
......@@ -284,6 +244,7 @@ def parse_args():
ap.add_argument('--options', default='')
ap.add_argument('--docker_image', default='')
ap.add_argument('--version', default='')
ap.add_argument('--version_qt', default='')
parsed_args = ap.parse_args()
......
......@@ -17,66 +17,70 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# This script is used in the packaging containers to build a snap
# package on an ubuntu base distro.
# This script is used in the packaging containers to build packages on
# debian-based distros.
set -e
PKG_DIR="packaging/rules/debian-qt"
cache_dir=/opt/ring-contrib
temp_dir=$(mktemp -d)
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=$cache_dir/$tarball_name
qt_base_url=https://download.qt.io/archive/qt/${QT_MAJOR}.${QT_MINOR}/${qt_version}/single
if ! [[ -d $cache_dir && -w $cache_dir ]]; then
echo "error: $cache_dir does not exist or is not writable"
exit 1
fi
if ! [ -f "$cached_tarball" ]; then
(
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)
flock "${cached_tarball}.lock" mv "$tarball_name" "$cached_tarball"
)
rm -rf "$temp_dir"
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}
# import the debian folder
cp --verbose -r /opt/ring-project-ro/${PKG_DIR} debian
# create changelog file
DEBEMAIL="The Jami project <jami@gnu.org>" dch --create --package libqt-jami --newversion ${DEBIAN_VERSION} "New libqt-jami release"
DEBEMAIL="The Jami project <jami@gnu.org>" dch --release --distribution "unstable" debian/changelog
DPKG_BUILD_OPTIONS=""
# Set the host architecture as armhf and add some specific architecture
# options to the package builder.
if grep -q "raspbian_10_qt_armhf" <<< "${DISTRIBUTION}"; then
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
# build and package qt
dpkg-buildpackage -uc -us ${DPKG_BUILD_OPTIONS}
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 <<EOF > dummy-libqt-jami.equivs
Package: libqt-jami
Version: 1.0
Maintainer: The Jami project <jami@gnu.org>
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
}
# move the artifacts to output
cd ..
mv *.orig.tar* *.debian.tar* *deb *changes *dsc /opt/output
chown -R ${CURRENT_UID}:${CURRENT_GID} /opt/output/
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment