summaryrefslogtreecommitdiffstats
path: root/lib/cmd
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-08-29 10:11:46 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-08-29 10:11:46 (EDT)
commita6d86dd88d54d9599fb960d322faa89a93481c2c (patch)
tree0b9283aef897dc3f74714119c38d50ec7609ece5 /lib/cmd
parent864dd3b2cb85188b59f820a0d9e1cf14693dee03 (diff)
build: Make stub build dependencies package
Diffstat (limited to 'lib/cmd')
-rw-r--r--lib/cmd/build.sh28
1 files changed, 27 insertions, 1 deletions
diff --git a/lib/cmd/build.sh b/lib/cmd/build.sh
index 77efce0..4a33b2d 100644
--- a/lib/cmd/build.sh
+++ b/lib/cmd/build.sh
@@ -62,16 +62,21 @@ cmd_build_main()
rand
dir="/prokit/build.${rand_x}"
uname_s="$( (uname -s) 2>/dev/null)" || uname_s='unknown'
- mkdir -p "${root}${dir}/pkg"
+ mkdir -p "${root}${dir}/pkg" "${root}${dir}/builddeps/control" \
+ "${root}${dir}/builddeps/data"
case "${uname_s}" in
'Linux')
mount -o bind "${prev_arg}" "${root}${dir}/pkg"
;;
esac
+ cmd_build_make_deps_pkg "${root}${dir}" "${rand_x}"
+
chroot_exec "${root}" sh <<-EOF
cd '${dir}/pkg'
+ opkg install ../builddeps.opk
opkbuild ${@}
+ opkg remove prokit-builddeps-${rand_x}
EOF
case "${uname_s}" in
@@ -86,3 +91,24 @@ cmd_build_main()
done
rmdir "${root}${dir}"
}
+
+cmd_build_make_deps_pkg()
+{
+ local build_dir="${1}"
+ local build_id="${2}"
+
+ printf '2.0\n' >"${build_dir}/builddeps/debian-binary"
+ cat >"${build_dir}/builddeps/control/control" <<-EOF
+ Package: prokit-builddeps-${build_id}
+ Source: prokit
+ Version: 1.0
+ Architecture: all
+ Platform: all
+ Description: Build dependencies metapackage generated by prokit
+ EOF
+ (cd "${build_dir}/builddeps/data"; tar -czf ../data.tar.gz .)
+ (cd "${build_dir}/builddeps/control"; tar -czf ../control.tar.gz .)
+ (cd "${build_dir}/builddeps"; tar -czf ../builddeps.opk \
+ 'debian-binary' 'data.tar.gz' 'control.tar.gz')
+ rm -Rf "${build_dir}/builddeps"
+}