Rust crates to Debian packages

debcargo is the official tool for packaging Rust crates to be part of the Debian system.

It creates a Debian source package (*.dsc) from a Rust crate that follows Debian’s general packaging policy as well as the Debian Rust team’s crate packaging policy.

Features

Installation

On Debian systems, debcargo can be installed the usual way:

$ apt-get install debcargo

To build locally for development:

$ apt-get build-dep debcargo
$ cargo build debcargo

On non-Debian systems, you can try simply:

$ cargo build debcargo

and fix any build errors that come up, e.g. by installing missing libraries. Probably, this will include OpenSSL as a dependency of cargo.

Examples

To download and unpack the latest clap crate and prepare the source package:

$ debcargo package clap

To download and unpack version 2.25.0 of clap crate and prepare the source package:

$ debcargo package clap =2.25.0

To provide additional packaging-specific config for downloading and packaging latest clap crate from crates.io:

$ debcargo package --config clap-2/debian/debcargo.toml clap

See debcargo.toml.example for a sample TOML file.

Long-term package maintenance

The Debian Rust team uses this tool together with the configs and overlays in https://salsa.debian.org/rust-team/debcargo-conf/. If you are interested in contributing, please see that repository for further information and instructions on how to collaborate with us.

Building unofficial Debian packages

Debian packaging policy is quite detailed. If you just want to create Debian binary packages (*.deb) without worrying about these policies, you may want to use other tools instead that ignore and bypass these policies. For example, cargo-deb.

The trade-off is that the resulting packages integrate less well with a Debian system, and do not integrate at all with the Debian build system, which means you lose the features described earlier. Furthermore, you will be responsible for hosting and distributing those packages yourself, outside of the official Debian distribution infrastructure.

License

Debcargo is licensed under MIT/Apache-2.0. It is written by Josh Triplett and Ximin Luo, and improved by members of Debian Rust Maintainers team