mirror of
https://github.com/YunoHost/vinaigrette.git
synced 2024-09-03 20:06:11 +02:00
64 lines
2 KiB
Bash
Executable file
64 lines
2 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
# For some reason, building chroots 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=bullseye
|
|
readonly INIT_DIR=$PWD
|
|
readonly ARCHS="amd64"
|
|
#readonly ARCHS="i386 armhf armel arm64"
|
|
#readonly ARCHS="arm64"
|
|
|
|
function main()
|
|
{
|
|
for ARCH in $ARCHS
|
|
do
|
|
build_chroot $ARCH
|
|
done
|
|
}
|
|
|
|
function build_chroot()
|
|
{
|
|
local ARCH=$1
|
|
local CHROOT=chroot-${DISTRIB}-${ARCH}
|
|
|
|
echo ""
|
|
echo "Starting build for $ARCH"
|
|
echo ""
|
|
|
|
cd /tmp/
|
|
cdebootstrap --arch=${ARCH} --foreign ${DISTRIB} ./$CHROOT http://deb.debian.org/debian/
|
|
cp /usr/bin/qemu-arm-static $CHROOT/usr/bin/
|
|
cp /usr/bin/qemu-aarch64-static $CHROOT/usr/bin/
|
|
cp /etc/resolv.conf $CHROOT/etc/resolv.conf
|
|
|
|
chroot $CHROOT apt update
|
|
chroot $CHROOT apt dist-upgrade
|
|
chroot $CHROOT apt install -y build-essential debhelper cmake wget devscripts git aptitude
|
|
|
|
# Install build depends for yunohost etc
|
|
chroot $CHROOT apt install -y debhelper devscripts dh-python python3-all python3-yaml python3-jinja2 python3-setuptools python3-psutil
|
|
chroot $CHROOT apt install -y lua5.1 liblua5.1-dev libidn11-dev libssl-dev txt2man quilt
|
|
|
|
if [ "$ARCH" == "amd64" ];
|
|
then
|
|
# This is for building yunohost-admin
|
|
chroot $CHROOT apt install -y npm nodejs
|
|
# Don't ask me why, but stupid nodejs wants to look for stuff inside /lib instead of /usr/lib ...
|
|
# This only happens when building those chroot ... I don't know why ...
|
|
chroot $CHROOT ln -s /usr/lib/nodejs /lib/nodejs
|
|
chroot $CHROOT npm install -g npm@latest
|
|
fi
|
|
|
|
chroot $CHROOT apt clean
|
|
|
|
cd $CHROOT
|
|
echo "Now creating tarball with the filesystem ..."
|
|
tar -czf $INIT_DIR/${DISTRIB}-${ARCH}.tgz ./*
|
|
|
|
echo ""
|
|
echo "Output chroot archive should be available as $INIT_DIR/${DISTRIB}-${ARCH}.tgz"
|
|
echo ""
|
|
}
|
|
|
|
main
|