Shit's too overcomplicated for nothing, simplify some mystic mess

This commit is contained in:
Alexandre Aubin 2020-05-11 01:33:27 +00:00
parent 827ef9e423
commit 1f81193659
7 changed files with 20 additions and 89 deletions

View file

@ -3,9 +3,9 @@
# 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=buster
readonly INIT_DIR=$PWD
#readonly ARCHS="amd64"
readonly ARCHS="amd64"
#readonly ARCHS="i386 armhf armel arm64"
readonly ARCHS="arm64"
#readonly ARCHS="arm64"
function main()
{
@ -32,14 +32,12 @@ function build_chroot()
chroot $CHROOT apt update
chroot $CHROOT apt dist-upgrade
chroot $CHROOT apt install -y build-essential debhelper cmake wget devscripts
chroot $CHROOT apt install -y build-essential debhelper cmake wget devscripts git
if [ "$ARCH" == "amd64" ];
then
chroot $CHROOT wget https://github.com/tj/n/archive/v4.1.0.tar.gz
chroot $CHROOT tar -xvzf v4.1.0.tar.gz
chroot $CHROOT /bin/bash -c "cd n-4.1.0; make install"
chroot $CHROOT n 10 # We take nodjes version 10 because idk
# This is for building yunohost-admin
chroot $CHROOT apt install npm nodejs
fi
chroot $CHROOT apt clean

View file

@ -1,6 +0,0 @@
# ARM-specific configuration
DEBOOTSTRAP=debootstrap
#DEBOOTSTRAPOPTS=( '--variant=buildd' )
ARCHITECTURE=arm64

View file

@ -1,6 +0,0 @@
# ARM-specific configuration
DEBOOTSTRAP=debootstrap
#DEBOOTSTRAPOPTS=( '--variant=buildd' )
ARCHITECTURE=armel

View file

@ -1,6 +0,0 @@
# ARM-specific configuration
DEBOOTSTRAP=debootstrap
#DEBOOTSTRAPOPTS=( '--variant=buildd' )
ARCHITECTURE=armhf

View file

@ -1,9 +0,0 @@
# NodeJS-specific configuration
[[ -n ${OTHERMIRROR} ]] && OTHERMIRROR+=" | "
OTHERMIRROR+="deb https://deb.nodesource.com/node_4.x ${DISTRIBUTION} main"
[[ -n ${EXTRAPACKAGES} ]] && EXTRAPACKAGES+=" "
EXTRAPACKAGES+="apt-transport-https ca-certificates"
APTKEYRINGS=("${APTKEYRINGS[@]}" "/etc/pbuilder/keyrings/nodesource.gpg")

View file

@ -13,9 +13,6 @@ then
if [ "$DIST" != "buster" ]
then
/usr/bin/apt-get install git nodejs -y
else
/usr/bin/apt-get install git -y
fi
echo "========================"
echo "Patching debian/rules ..."
echo "========================"
@ -44,6 +41,7 @@ index b031511..477f27c 100755
rm -rf src/dist
EOF
patch -p1 < rules.patch
fi
echo "========================"
echo "Starting npm install ..."
echo "========================"

View file

@ -10,72 +10,34 @@ sendxmpppy "Starting build ${package}/${version} for arch=$arch ..."
source /home/vinaigrette/config/config
source /home/vinaigrette/scripts/package_helpers.sh
# Build only binary-only limited to architecture dependent packages
DEBBUILDOPTS="-B"
if [[ $arch == all ]]; then arch=$DEFAULT_ARCH; fi
if [[ $arch == $DEFAULT_ARCH ]]; then
# Build architecture independent packages too
DEBBUILDOPTS="-b"
elif [[ $arch == all ]]; then
# Build architecture independent packages too on default arch
arch=$DEFAULT_ARCH
DEBBUILDOPTS="-b"
else
# Build only binary-only limited to architecture dependent packages
DEBBUILDOPTS="-B"
fi
## Retrieve the number of processors for parallel building
## N.B. : disabled by Alex on Feb 12 2020 because this makes some build fail on buster for some reason..
#if [ -x /usr/bin/getconf ]; then
# JOBS=`getconf _NPROCESSORS_CONF`
#else
# JOBS=1
#fi
#DEBBUILDOPTS="$DEBBUILDOPTS -j$JOBS"
# Format needed pbuilder arguments
DSC_FILE="${package}_${version}.dsc"
BASE_TGZ="${PBUILDER_CHROOTS}/${codename}-${arch}.tgz"
echo "######################"
echo " Starting build ... "
echo "######################"
# Format needed pbuilder arguments
DSC_FILE="${package}_${version}.dsc"
BASE_TGZ="${PBUILDER_CHROOTS}/${codename}-${arch}.tgz"
EXTRA_OPTS=()
CONFIGFILE=""
echo "Running 'pbuilder build --basetgz $BASE_TGZ --debbuildopts $DEBBUILDOPTS $DSC_FILE"
# Use specific conf for nodejs builds
if [[ $package == "yunohost-admin" ]];
then
CONFIGFILE="--configfile $PBUILDER_CONF/nodejs.conf"
fi
if [[ $arch == "armhf" ]];
then
CONFIGFILE="--configfile $PBUILDER_CONF/armhf.conf"
fi
if [[ $arch == "armel" ]];
then
CONFIGFILE="--configfile $PBUILDER_CONF/armel.conf"
fi
if [[ $arch == "arm64" ]];
then
CONFIGFILE="--configfile $PBUILDER_CONF/arm64.conf"
fi
echo "Running 'pbuilder build --basetgz "${BASE_TGZ}" --debbuildopts "${DEBBUILDOPTS}" ${CONFIGFILE} "${EXTRA_OPTS[@]}" $DSC_FILE"
pbuilder build \
--basetgz "${BASE_TGZ}" \
--debbuildopts "${DEBBUILDOPTS}" \
${CONFIGFILE} \
"${EXTRA_OPTS[@]}" \
$DSC_FILE
pbuilder build \
--basetgz "$BASE_TGZ" \
--architecture $arch \
--debbuildopts "$DEBBUILDOPTS" \
$DSC_FILE
exit_code=$?
if [[ $exit_code != 0 ]];
then
sendxmpppy "Building ${package}/${version} for arch=$arch failed ?!"
fi
[[ $exit_code == 0 ]] || sendxmpppy "Building ${package}/${version} for arch=$arch failed ?!"
exit $exit_code