]> git.proxmox.com Git - mirror_zfs.git/blobdiff - scripts/debian-packaging.sh
Add native Debian Packaging for Linux
[mirror_zfs.git] / scripts / debian-packaging.sh
diff --git a/scripts/debian-packaging.sh b/scripts/debian-packaging.sh
new file mode 100755 (executable)
index 0000000..9cd042f
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+#
+# This script can be used to invoke OpenZFS build from native Debian
+# packaging.
+#
+
+print_help ()
+{
+       echo "Usage: $(basename $0) [OPTIONS]"
+       echo
+       echo "Options:"
+       echo " -b, --build              Build OpenZFS from Debian Packaging"
+       echo " -c, --clean              Clean the workspace"
+}
+
+if [ "$#" -ne 1 ]; then
+       print_help
+       exit 1
+fi
+
+case $1 in
+       -b|--build)
+               cp -r contrib/debian debian
+               debuild -i -us -uc -b && fakeroot debian/rules override_dh_binary-modules
+               ;;
+       -c|--clean)
+               fakeroot debian/rules override_dh_auto_clean
+               rm -rf debian
+               ;;
+       *)
+               print_help
+               ;;
+esac
+
+exit 0