32 lines
1018 B
Bash
Executable File
32 lines
1018 B
Bash
Executable File
#!/bin/sh
|
|
# This program is free software, licensed under the terms of the GNU GPL.
|
|
# See the Bongo COPYING file for full details.
|
|
# Copyright (c) 2026 Bongo Project contributors
|
|
|
|
set -eu
|
|
|
|
source_tree=${1:-/source}
|
|
output=${2:-/out}
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
|
if [ "$(id -u)" -ne 0 ]; then
|
|
echo 'Run this build helper as root inside a disposable Debian container.' >&2
|
|
exit 1
|
|
fi
|
|
if [ ! -f "$source_tree/debian/control" ]; then
|
|
echo "Debian libspf2 source tree not found: $source_tree" >&2
|
|
exit 1
|
|
fi
|
|
if ! grep -q 'Types: deb deb-src' /etc/apt/sources.list.d/debian.sources; then
|
|
sed -i 's/^Types: deb$/Types: deb deb-src/' \
|
|
/etc/apt/sources.list.d/debian.sources
|
|
fi
|
|
apt-get update
|
|
apt-get install -y --no-install-recommends build-essential devscripts equivs
|
|
mkdir -p "$output"
|
|
cp -a "$source_tree" "$output/libspf2-source"
|
|
cd "$output/libspf2-source"
|
|
mk-build-deps --install --remove \
|
|
--tool 'apt-get -y --no-install-recommends' debian/control
|
|
dpkg-buildpackage -us -uc -b
|