5 ARCHITECTURES
=( amd64 arm64 i386 armhf riscv64
)
12 echo "Not enough arguments" >&2
16 # Get host architecture
17 local host_arch
="$(dpkg --print-architecture)"
18 if [ -z "${host_arch}" ]; then
19 echo "Could not discover host architecture" >&2
26 # Create some temporary directory
27 local tmp
="$(mktemp -d)"
29 # Extract the sources into it
30 tar xvfa
"${sources}" -C "${tmp}"
32 # Copy the tarball under the correct Debian name
33 cp -vf "${sources}" "${tmp}/${package//-/_}.orig.tar.xz"
35 # Change into source directory
36 pushd "${tmp}/${package}"
38 # Prepare the build environment
39 #if ! debuild -us -uc; then
40 # echo "Could not prepare build environment" >&2
44 # Build the package for each release
46 for release
in ${RELEASES[@]}; do
47 local chroot
="${release}-${host_arch}-sbuild"
49 # Create a chroot environment
50 if [ ! -d "/etc/sbuild/chroot/${chroot}" ]; then
51 if ! sbuild-createchroot
--arch="${host_arch}" "${release}" \
52 "${CHROOT_PATH}/${chroot}"; then
53 echo "Could not create chroot for ${release} on ${host_arch}" >&2
58 # And for each architecture we want to support
60 for arch
in ${ARCHITECTURES[@]}; do
61 # Run the build process
62 if ! sbuild
--dist="${release}" --host="${arch}"; then
63 echo "Could not build package for ${release} on ${arch}" >&2