Tweak build chain to support buster builds

This commit is contained in:
Alexandre Aubin 2020-02-07 22:24:00 +00:00
parent ecb925525e
commit a573160e15
10 changed files with 49 additions and 37 deletions

View file

@ -10,7 +10,7 @@ REPO_URL="forge.yunohost.org"
# Codenames, components and architectures
AVAILABLE_CODENAMES="stretch"
AVAILABLE_CODENAMES="stretch buster"
AVAILABLE_COMPONENTS="stable testing unstable extra"
AVAILABLE_ARCH="amd64 i386 armel armhf arm64"

View file

@ -11,3 +11,17 @@ SignWith: 59A3E6FF
Tracking: all includechanges keepsources
Log: logfile
--changes --via=include /home/vinaigrette/scripts/repo/process-include
Origin: YunoHost
Label: YunoHost for Buster
Suite: stable
Codename: buster
Version: 10.0
Architectures: i386 amd64 armel armhf arm64 source
Components: stable testing unstable extra
AlsoAcceptFor: buster-stable buster-testing buster-unstable stable testing unstable
Description: YunoHost repository for Debian Buster
SignWith: 59A3E6FF
Tracking: all includechanges keepsources
Log: logfile
--changes --via=include /home/vinaigrette/scripts/repo/process-include

View file

@ -6,7 +6,7 @@ kill_timeout = 90
source_cmd = /home/vinaigrette/scripts/rebuildd/get-sources ${d} ${p} ${v}
build_cmd = /home/vinaigrette/scripts/rebuildd/build-binaries ${d} ${p} ${v} ${a}
post_build_cmd = /home/vinaigrette/scripts/rebuildd/upload-binaries ${d} ${p} ${v} ${a} ${j}
dists = stretch
dists = stretch buster
work_dir = /var/cache/rebuildd/build
database_uri = sqlite:///var/lib/rebuildd/rebuildd.db
build_more_recent = 1

View file

@ -4,5 +4,5 @@ PBUILDER_BIN=/usr/sbin/pbuilder
PBUILDER_CACHE_PATH="/var/cache/pbuilder"
PBUILDER_MIRROR=https://ftp.debian.org/debian
ARCHS="amd64 i386 armel armhf arm64"
DISTS="stretch"
DISTS="stretch buster"
ENABLE_BUILDER_MAINT=1

View file

@ -2,7 +2,7 @@
readonly THISSCRIPT=$0
readonly BRANCH_NIGHTLY="unstable"
readonly DISTRIB="stretch"
readonly DISTRIBS="buster"
readonly TIMETAG="$(date +%Y%m%d%H%M)"
readonly PACKAGES="moulinette SSOwat yunohost yunohost-admin"
readonly FORCE="false"
@ -21,11 +21,13 @@ function main()
for PACKAGE in $PACKAGES;
do
for DISTRIB in $DISTRIBS;
do
echo "-------------------------------------"
echo "Looking for update in ${PACKAGE} for ${DISTRIB}... "
echo "-------------------------------------"
echo "Looking for update in ${PACKAGE} ... "
build_if_needed $PACKAGE
build_if_needed $PACKAGE $DISTRIB
done
done
echo "-------------------------------------"
@ -35,6 +37,7 @@ function main()
function build_if_needed()
{
local PACKAGE=$1
local DISTRIB=$2
cd $GIT_REPOS/$PACKAGE
@ -43,13 +46,13 @@ function build_if_needed()
# Check if there's a branch named distrib-branch (e.g. stretch-unstable)
# By default, keep just 'branch'
BRANCH_NIGHTLY_GIT="$BRANCH_NIGHTLY"
if git branch --list | tr '*' ' ' | awk '{print $1}' | grep -q "^$DISTRIB-$BRANCH_NIGHTLY$"
if git branch -ar | grep -q origin/$DISTRIB-$BRANCH_NIGHTLY
then
BRANCH_NIGHTLY_GIT="$DISTRIB-$BRANCH_NIGHTLY"
fi
# If the branch name is an alias to another branch, "resolve" the alias
if grep -q "ref: " .git/refs/heads/$BRANCH_NIGHTLY_GIT
if grep -q "ref: " .git/refs/heads/$BRANCH_NIGHTLY_GIT 2>/dev/null
then
BRANCH_NIGHTLY_GIT=$(cat .git/refs/heads/$BRANCH_NIGHTLY_GIT | tr '/' ' ' | awk '{print $4}')
fi

View file

@ -1,8 +1,10 @@
#!/bin/bash
readonly DISTRIB=stretch
# For some reason, building images for buster from stretch requires libdebian-installer4 0.119 instead of 0.110, c.f. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=904699 ... installed it by manually downloading and dpkg -i the .deb
readonly DISTRIB=buster
readonly INIT_DIR=$PWD
readonly ARCHS="amd64 i386 armhf armel arm64"
readonly ARCHS="amd64"
#readonly ARCHS="amd64 i386 armhf armel arm64"
function main()
{
@ -27,18 +29,19 @@ function build_image()
cp /usr/bin/qemu-aarch64-static $CHROOT/usr/bin/
cp /etc/resolv.conf $CHROOT/etc/resolv.conf
chroot $CHROOT apt-get update
chroot $CHROOT apt-get dist-upgrade
chroot $CHROOT apt-get install -y build-essential debhelper cmake wget devscripts
chroot $CHROOT apt update
chroot $CHROOT apt dist-upgrade
chroot $CHROOT apt install -y build-essential debhelper cmake wget devscripts
if [ "$ARCH" == "amd64" ];
then
chroot $CHROOT wget -q -O /tmp/setup_nodejs https://deb.nodesource.com/setup_4.x
#chroot $CHROOT wget -q -O /tmp/setup_nodejs https://deb.nodesource.com/setup_4.x
chroot $CHROOT wget -q -O /tmp/setup_nodejs https://deb.nodesource.com/setup_6.x
chroot $CHROOT bash /tmp/setup_nodejs
chroot $CHROOT apt-get install -y nodejs
chroot $CHROOT apt install -y nodejs
fi
chroot $CHROOT apt-get clean
chroot $CHROOT apt clean
cd $CHROOT
tar -czf $INIT_DIR/${DISTRIB}-${ARCH}.tgz ./*

View file

@ -53,7 +53,7 @@ cat $VINAIGRETTE_HOME/config/sources.list > /etc/apt/sources.list.d/vinaigrette.
sed -i "s/__REPO_URL__/$REPO_URL/g" /etc/nginx/sites-enabled/repo.conf
sed -i "s/__REPO_URL__/$REPO_URL/g" /etc/apt/sources.list.d/vinaigrette.list
echo "deb https://deb.nodesource.com/node_4.x stretch main" >> /etc/apt/sources.list
echo "deb https://deb.nodesource.com/node_6.x stretch main" >> /etc/apt/sources.list
echo "127.0.0.1 $REPO_URL" >> /etc/hosts
service nginx reload

View file

@ -26,7 +26,7 @@ Usage:
$THISSCRIPT <distrib> <branch> <folder>
Arguments:
<distrib> stretch (can only build for stretch, no jessie)
<distrib> stretch or buster
<branch> stable, testing, or unstable
<folder> the folder in which to build...
EOF
@ -50,7 +50,7 @@ function main()
function validate_arguments()
{
[[ $DISTRIB =~ ^stretch$ ]] || critical "Invalid distribution $DISTRIB"
[[ $DISTRIB =~ ^stretch|buster$ ]] || critical "Invalid distribution $DISTRIB"
[[ $BRANCH =~ ^testing|stable|unstable$ ]] || critical "Invalid branch $BRANCH"
[[ ! -z "$FOLDER" ]] || critical "Need a folder in which to build"
}

View file

@ -1,16 +0,0 @@
#!/bin/sh
set -e
if $(cat "/etc/apt/sources.list" | grep -q "wheezy-backports"); then
echo "Adding pin preferences for wheezy-backports"
cat > "/etc/apt/preferences.d/wheezy-backports" << EOF
Package: dh-python dh-systemd devscripts
Pin: release a=wheezy-backports
Pin-Priority: 999
EOF
else
if [ -f /etc/apt/preferences.d/wheezy-backports ]; then
rm -vf /etc/apt/preferences.d/wheezy-backports
fi
fi

View file

@ -7,6 +7,14 @@ changes_file=$3
source /home/vinaigrette/config/config
source /home/vinaigrette/scripts/package_helpers.sh
# Fucking ugly manual patch because when building packages for buster, the Binary: field is missing...
if ! grep -q "Binary:" $changes_file
then
# We take is from the .dsc file
DSC=$(echo $changes_file | sed 's/_source.changes/.dsc/g')
echo $(grep "Binary:" $DSC) >> $changes_file
fi
sudo reprepro -C $distribution -V -b $REPO_DIR include $codename $changes_file
RET=$?