aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2020-11-10 09:14:28 -0800
committerEric Biggers <ebiggers@google.com>2021-06-30 13:34:07 -0700
commit454cb5fba7aab9286e57878b173c73f841767561 (patch)
tree5261fbd816d39d73eaf79d0a7e969b23a9427e8d
parent925ab758761ced0828045e5553d957fbbdc1b404 (diff)
downloadf2fs-tools-debian-package.tar.gz
Add build-debs.shdebian-package
Signed-off-by: Eric Biggers <ebiggers@google.com>
-rwxr-xr-xbuild-debs.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/build-debs.sh b/build-debs.sh
new file mode 100755
index 0000000..759cef7
--- /dev/null
+++ b/build-debs.sh
@@ -0,0 +1,39 @@
+#!/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}*