Scroll to navigation

man(8) pkgos-debcrate man page man(8)

NAME

pkgos-debcrate - create a template Debian package out of a crates.io crate.

SYNOPSIS

pkgos-debcrate [-u URL] <crate_name> [<version>]

DESCRIPTION

pkgos-debcrate creates a template Debian package out of a crates.io crate. It queries the crates.io API for the crate metadata, clones the upstream git repository and generates debian/control (with the Rust dependencies of the crate and the feature based Provides), debian/rules, debian/copyright and debian/watch. The packages are built with the dh-rust buildsystem (dh-sequence-rust), which supports Cargo workspaces: one binary package (librust-<crate>-dev) is generated per member crate of a workspace. The source package is named after the upstream git repository for workspaces (ex: rust-amq-protocol), and after the crate otherwise.

The upstream repository is cloned, reset to the tag of the wanted version (trying the v-prefixed tag first), which is also tagged with the Debian upstream version (as expected by the gen-orig-xz target), and the debian/unstable branch is created, with the generated debian folder committed as "Initial packaging". The source tree of the git tag is used as-is for the orig tarball, which is regenerated with debian/rules gen-orig-xz. When the clone isn't possible, the crate archive is downloaded and imported into a fresh git repository instead.

The script also reports which Rust dependencies are missing from Debian, or incompatible with the version requirements of the crate (needing either a version bump of the Debian package, or a parallel package for an older major), so that they can be packaged as well.

At the end, the ITP text is saved as itp.txt, and a new terminal window is opened running reportbug against wnpp with the ITP pre-filled, so that it only needs to be reviewed and sent. If there is no X display, the ITP text is displayed instead.

Once this script has run, make sure it did what you expected, then use the newly created source package as a template. Make sure you correct the debian/copyright file before publishing any package.

OPTIONS

-u URL: download the crate archive from the specified URL instead of https://static.crates.io, and import it into git instead of cloning the upstream repository.

The salsa subgroup of the OpenStack team is double-guessed from the directory the script is started from: the path component right after an "openstack" component is used (ex: working under ~/salsa/openstack/vector packages for the vector subgroup).

The following environment variables can be used for non interactive use: PKGOS_DEBCRATE_TEAM (the salsa subgroup of the OpenStack team, ex: third-party, overriding the directory based guess), PKGOS_DEBCRATE_LICENSE (the license string, ex: 'MIT OR Apache-2.0') and PKGOS_DEBCRATE_SOURCE (the source package name for workspace packages, default: rust-<git repo basename>).

SEE ALSO

pkgos-debpypi(8), uscan(1)

BUGS

No known bugs.

AUTHOR

Script and man page are written by Thomas Goirand <zigo@debian.org>

3 Oct 2026 149