]>
git.ipfire.org Git - people/ms/libloc.git/blob - debian/build.sh
3 ARCHITECTURES
=( amd64 arm64 i386 armhf
)
4 RELEASES
=( buster bullseye
)
10 echo "Not enough arguments" >&2
14 # Get host architecture
15 local host_arch
="$(dpkg --print-architecture)"
16 if [ -z "${host_arch}" ]; then
17 echo "Could not discover host architecture" >&2
24 # Create some temporary directory
25 local tmp
="$(mktemp -d)"
27 # Extract the sources into it
28 mkdir
-p "${tmp}/sources"
29 tar xvfa
"${sources}" -C "${tmp}/sources"
31 # Copy the tarball under the correct Debian name
32 cp -vf "${sources}" "${tmp}/sources/${package//-/_}.orig.tar.xz"
34 # Change into temporary directory
37 # Build the package for each release
39 for release
in ${RELEASES[@]}; do
40 local chroot
="${release}-${host_arch}-sbuild"
45 # Create a chroot environment
46 if [ ! -d "/etc/sbuild/chroot/${chroot}" ]; then
47 if ! sbuild-createchroot
--arch="${host_arch}" "${release}" \
48 "${CHROOT_PATH}/${chroot}"; then
49 echo "Could not create chroot for ${release} on ${host_arch}" >&2
55 # And for each architecture we want to support
57 for arch
in ${ARCHITECTURES[@]}; do
62 cp -r "${tmp}/sources" .
64 # Run the build process
65 if ! sbuild
--dist="${release}" --host="${arch}" --source "sources/${package}"; then
66 echo "Could not build package for ${release} on ${arch}" >&2
72 rm -rf "sources/${package}"
79 rm -rf "${tmp}/sources"
84 echo " You can find your Debian packages in ${tmp}"