| #!/bin/bash |
| |
| set -e -u -o pipefail |
| |
| # DSTDIR needs to be set to the directory into which the Debian packages will be |
| # installed. The default is below. |
| : "${DSTDIR:=$HOME/src/xfstests-bld/kvm-xfstests/test-appliance/debs/}" |
| |
| # CHROOT needs to be set to the name of a chroot that was set up by the |
| # setup-buildchroot script from xfstests-bld. The default is buster-amd64. |
| # |
| # Also, /etc/schroot/xfstests-bld/fstab needs to contain an entry which lists |
| # the parent directory of this f2fs-tools directory. E.g.: |
| # |
| # $HOME/src/f2fs-tools-schroot $HOME/src/f2fs-tools-schroot none rw,bind 0 0 |
| # |
| # ... where this "f2fs-tools" directory is $HOME/src/f2fs-tools-schroot/f2fs-tools. |
| |
| : "${CHROOT:=buster-amd64}" |
| |
| cd "$(dirname "$0")" |
| DEB_OUT_DIR=$(dirname "$(pwd -P)") |
| |
| # Delete old packages, if any. |
| rm -vf -- "$DEB_OUT_DIR"/*.{deb,udeb,buildinfo,changes} |
| |
| # Clean. |
| git checkout -f |
| git clean -fdx |
| |
| # Build the packages. |
| schroot -c "$CHROOT" -- dpkg-buildpackage --build=binary --no-sign |
| |
| # Install the packages into the xfstests-bld directory. |
| if [ ! -e "$DSTDIR" ]; then |
| mkdir "$DSTDIR" |
| fi |
| mv -v -- "$DEB_OUT_DIR"/*.deb "$DSTDIR" |
| rm -vf -- "$DSTDIR"/*{dbgsym,-dev_,dbg_,fuse}* |