#!/bin/bash if [ "$EUID" -ne 0 ] then echo "Please run as root" exit fi # This should not be changed until we want to build a future release RELEASE=bookworm apt-get update -y # Following lines are from the Debian wiki page with some options disabled # https://wiki.debian.org/sbuild # They setup sbuild with their recommended options, please do # not deviate unless you know what you're doing! apt-get install -y sbuild schroot debootstrap apt-cacher-ng devscripts piuparts tee /home/$SUDO_USER/.sbuildrc << EOF ############################################################################## # PACKAGE BUILD RELATED (additionally produce _source.changes) ############################################################################## # -d \$distribution = '$RELEASE'; # -A \$build_arch_all = 1; # -s \$build_source = 0; # --source-only-changes (applicable for dput. irrelevant for dgit push-source). \$source_only_changes = 1; # -v \$verbose = 1; # parallel build \$ENV{'DEB_BUILD_OPTIONS'} = 'parallel=1'; ############################################################################## # POST-BUILD RELATED (turn off functionality by setting variables to 0) ############################################################################## # We are not running lintian, piuparts, and autopkgtest for now to speed # up builds. Will be enabled in the future when necessary. \$run_lintian = 0; \$lintian_opts = ['-i', '-I']; \$run_piuparts = 0; \$piuparts_opts = ['--schroot', '%r-%a-sbuild', '--no-eatmydata']; \$run_autopkgtest = 0; \$autopkgtest_root_args = ''; \$autopkgtest_opts = [ '--', 'schroot', '%r-%a-sbuild' ]; ############################################################################## # PERL MAGIC ############################################################################## 1; EOF sbuild-adduser $SUDO_USER ln -sf /home/SUDO_USER/.sbuildrc /root/.sbuildrc # end of lines from Debian Wiki page.