Using a lovely Rust crate "cargo-deb", available on crates.io
Without a few extra tricks, you cannot build a Debian Package against a Workspace crate.
-
Choose an arbitrary crate in your workspace to "own" the Debian Package configuration. I choose "btu_scheduler"
-
Add this to the crate's Cargo.toml
[package.metadata.deb]
name = "BTU Scheduler"
maintainer = "Brian Pond <[email protected]>"
copyright = "2022, Brian Pond <[email protected]>"
license-file = ["../LICENSE.txt", "4"]
extended-description = """\
A simple subcommand for the Cargo package manager for \
building Debian packages from Rust projects."""
# depends = "$auto"
# section = "utility"
# priority = "optional"
assets = [
["target/release/btu", "usr/bin/", "755"],
["target/release/btu-daemon", "usr/bin/", "755"],
]
From the package root, execute 2 shell commands:
cargo build --release
cargo deb -p btu_scheduler
To try and install it, do this:
dpkg -i target/debian/btu_cli_0.3.3_amd64.deb