From 1f811936599f38fc71dba3462e8921d2f88465dc Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 11 May 2020 01:33:27 +0000 Subject: [PATCH] Shit's too overcomplicated for nothing, simplify some mystic mess --- chroots/make-chroots | 12 ++-- config/pbuilder/arm64.conf | 6 -- config/pbuilder/armel.conf | 6 -- config/pbuilder/armhf.conf | 6 -- config/pbuilder/nodejs.conf | 9 --- .../pbuilder/hooks/D80patch-yunohost-admin | 4 +- scripts/rebuildd/build-binaries | 66 ++++--------------- 7 files changed, 20 insertions(+), 89 deletions(-) delete mode 100644 config/pbuilder/arm64.conf delete mode 100644 config/pbuilder/armel.conf delete mode 100644 config/pbuilder/armhf.conf delete mode 100644 config/pbuilder/nodejs.conf diff --git a/chroots/make-chroots b/chroots/make-chroots index 37cd5c2..a7a2b17 100755 --- a/chroots/make-chroots +++ b/chroots/make-chroots @@ -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 diff --git a/config/pbuilder/arm64.conf b/config/pbuilder/arm64.conf deleted file mode 100644 index 9fac1e4..0000000 --- a/config/pbuilder/arm64.conf +++ /dev/null @@ -1,6 +0,0 @@ -# ARM-specific configuration - -DEBOOTSTRAP=debootstrap -#DEBOOTSTRAPOPTS=( '--variant=buildd' ) -ARCHITECTURE=arm64 - diff --git a/config/pbuilder/armel.conf b/config/pbuilder/armel.conf deleted file mode 100644 index 75d67e9..0000000 --- a/config/pbuilder/armel.conf +++ /dev/null @@ -1,6 +0,0 @@ -# ARM-specific configuration - -DEBOOTSTRAP=debootstrap -#DEBOOTSTRAPOPTS=( '--variant=buildd' ) -ARCHITECTURE=armel - diff --git a/config/pbuilder/armhf.conf b/config/pbuilder/armhf.conf deleted file mode 100644 index 635b87f..0000000 --- a/config/pbuilder/armhf.conf +++ /dev/null @@ -1,6 +0,0 @@ -# ARM-specific configuration - -DEBOOTSTRAP=debootstrap -#DEBOOTSTRAPOPTS=( '--variant=buildd' ) -ARCHITECTURE=armhf - diff --git a/config/pbuilder/nodejs.conf b/config/pbuilder/nodejs.conf deleted file mode 100644 index 1b1cc46..0000000 --- a/config/pbuilder/nodejs.conf +++ /dev/null @@ -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") diff --git a/scripts/pbuilder/hooks/D80patch-yunohost-admin b/scripts/pbuilder/hooks/D80patch-yunohost-admin index 3547bc6..1ac2ea4 100755 --- a/scripts/pbuilder/hooks/D80patch-yunohost-admin +++ b/scripts/pbuilder/hooks/D80patch-yunohost-admin @@ -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 "========================" diff --git a/scripts/rebuildd/build-binaries b/scripts/rebuildd/build-binaries index 46e65ef..a6c396e 100755 --- a/scripts/rebuildd/build-binaries +++ b/scripts/rebuildd/build-binaries @@ -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