#!/bin/bash echo "SCRIPT IS STILL WIP, DO NOT RUN" BASEDIR=~/.local/src/bookworm-sffs/ BUILDDIR=~/.local/src/bookworm-sffs/src/ REPODIR=~/.local/src/bookworm-sffs/repo/pool/ JOBS=1 CHROOT=bookworm-ppc64el-sbuild OPTS= RELEASE=bookworm # To be changed to the full list LIST=(adduser apt apt-utils base-files base-passwd bash bc bsdutils coreutils cpio cron cron-daemon-common dash debconf debconf-i18n debian-archive-keyring debianutils diffutils dmsetup dpkg e2fsprogs fdisk findutils gcc-12-base gpgv grep gzip hostname ifupdown init init-system-helpers iproute2 iputils-ping isc-dhcp-client isc-dhcp-common kmod less libacl1 libapparmor1 libapt-pkg6.0 libargon2-1 libattr1 libaudit-common libaudit1 libblkid1 libbpf1 libbsd0 libbz2-1.0 libc-bin libc6 libcap-ng0 libcap2 libcap2-bin libcom-err2 libcrypt1 libcryptsetup12 libdb5.3 libdebconfclient0 libdevmapper1.02.1 libedit2 libelf1 libext2fs2 libfdisk1 libffi8 libgcc-s1 libgcrypt20 libgmp10 libgnutls30 libgpg-error0 libgssapi-krb5-2 libhogweed6 libidn2-0 libip4tc2 libjansson4 libjson-c5 libk5crypto3 libkeyutils1 libkmod2 libkrb5-3 libkrb5support0 liblocale-gettext-perl liblz4-1 liblzma5 libmd0 libmnl0 libmount1 libncursesw6 libnettle8 libnewt0.52 libnftables1 libnftnl11 libnuma1 libp11-kit0 libpam-modules libpam-modules-bin libpam-runtime libpam0g libpcre2-8-0 libpopt0 libproc2-0 libreadline8 librtas2 librtasevent2 libseccomp2 libselinux1 libsemanage-common libsemanage2 libsepol2 libslang2 libsmartcols1 libss2 libssl3 libstdc++6 libsystemd-shared libsystemd0 libtasn1-6 libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl libtinfo6 libtirpc-common libtirpc3 libudev1 libunistring2 libuuid1 libxtables12 libxxhash0 libzstd1 login logrotate logsave mawk mount nano ncurses-base ncurses-bin netbase nftables passwd perl-base powerpc-ibm-utils powerpc-utils procps readline-common sed sensible-utils systemd systemd-sysv sysvinit-utils tar tasksel tasksel-data tzdata udev usr-is-merged util-linux util-linux-extra vim-common vim-tiny whiptail zlib1g ) for pkg in $LIST do mkdir -p $BUILDDIR/${pkg:0:1} done cd $BUILDDIR # This will loop over every package in the list and attempt to rebuild # If it succeeds, it will move the .deb files to their respective directory # in $REPODIR/$LETTER/$PKG/ for preparation to create the repo later # and add that package to the $BASEDIR/success file # if not, it will add it to $BASEDIR/failed file # The build logs will reside in $BUILDDIR/$LETTER/$PKG/*.log for pkg in $LIST do cd $BUILDDIR/${pkg:0:1}/ mkdir -p $pkg && cd $BUILDDIR/${pkg:0:1}/$pkg apt source $pkg if sbuild -d $RELEASE -c $CHROOT $OPTS -j$JOBS *.dsc; then echo Build successful echo $pkg >> $BASEDIR/success mkdir -p $REPODIR/${pkg:0:1}/$pkg/ mv *.deb $REPODIR/${pkg:0:1}/$pkg/ else echo Build failed echo $pkg >> $BASEDIR/failed fi done