Reproducing the tiger vnc binaries as close as possible to the Launchpad builds

Asked by stellenwolf

Hi!

I'd like to better understand how the tigervnc standalone binaries are built for Ubuntu.
From what I can tell, Ubuntu packages are built on "Launchpad" build farms?

Could you maybe point me in a direction so I can faithfully reproduce the build?
(For reference... the only build system I am a little bit familiar with is Jenkins and Jenkinsfiles...)

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu tigervnc Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Best Manfred Hampl (m-hampl) said :
#1
Revision history for this message
stellenwolf (stellenwolf) said :
#2

Thanks @m-hampl, `dpkg-buildpackage` is something I learnt about today :)

FWIW, I wrote the following build.sh file for myself to reproduce and automate the process using a docker invocation:

#!/bin/bash

echo '
cd /workdir
set -xe
WGET_BASE="https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/tigervnc/1.10.1+dfsg-3"
ORIG_FILE="tigervnc_1.10.1+dfsg.orig.tar.xz"
DEBIAN_FILE="tigervnc_1.10.1+dfsg-3.debian.tar.xz"
rm -rf "$ORIG_FILE" "$DEBIAN_FILE" tigervnc-1.10.1
wget "$WGET_BASE/$ORIG_FILE"
wget "$WGET_BASE/$DEBIAN_FILE"
tar -xf "$ORIG_FILE"
cd tigervnc-1.10.1
tar -xf ../"$DEBIAN_FILE"
mk-build-deps
mv tigervnc-build-deps*.deb ..
' > non_root_build_part1.sh
echo '
cd /workdir/tigervnc-1.10.1
dpkg-buildpackage -us -uc
' > non_root_build_part2.sh

docker run --rm -it \
  -v "$PWD":/workdir \
  -w /workdir \
  -e XUID=$(id -u) \
  -e XGID=$(id -g) \
  ubuntu:20.04 \
  bash -c '
  set -xe
  # Set up a non-root user with the same UID and GID as the host user.
  adduser --disabled-password --gecos "" --uid "$XUID" user || true
  GROUP_NAME=$(getent group "$XGID" | cut -d: -f1)
  usermod -a -G "$GROUP_NAME" user
  export DEBIAN_FRONTEND=noninteractive
  apt-get update
  apt-get install -y devscripts equivs build-essential wget
  su - user -c "bash /workdir/non_root_build_part1.sh"
  dpkg -i tigervnc-build-deps*.deb || true
  apt-get install -f -y
  su - user -c "bash /workdir/non_root_build_part2.sh"
  '