]>
git.ipfire.org Git - people/ms/libloc.git/blob - debian/build.sh
5 ARCHITECTURES
=( amd64 arm64 i386 armhf
)
6 RELEASES
=( buster bullseye
)
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 mkdir
-p "${tmp}/sources"
31 tar xvfa
"${sources}" -C "${tmp}/sources"
33 # Copy the tarball under the correct Debian name
34 cp -vf "${sources}" "${tmp}/sources/${package//-/_}.orig.tar.xz"
36 # Change into temporary directory
39 # Build the package for each release
41 for release
in ${RELEASES[@]}; do
42 local chroot
="${release}-${host_arch}-sbuild"
47 # Create a chroot environment
48 if [ ! -d "/etc/sbuild/chroot/${chroot}" ]; then
49 if ! sbuild-createchroot
--arch="${host_arch}" "${release}" \
50 "${CHROOT_PATH}/${chroot}"; then
51 echo "Could not create chroot for ${release} on ${host_arch}" >&2
56 # And for each architecture we want to support
58 for arch
in ${ARCHITECTURES[@]}; do
63 cp -r "${tmp}/sources" .
65 # Run the build process
66 if ! sbuild
--dist="${release}" --host="${arch}" --source "sources/${package}"; then
67 echo "Could not build package for ${release} on ${arch}" >&2
72 rm -rf "sources/${package}"
79 rm -rf "${tmp}/sources"