# Rust packaging cheatsheet
## Reviewable
https://fedoraproject.org/PackageReviewStatus/reviewable.html
## Review template
Package was generated with rust2rpm, simplifying the review.
- package builds and installs without errors on rawhide
- test suite is run and all unit tests pass
- latest version of the crate is packaged
- license matches upstream specification (MIT OR Apache-2.0) and is acceptable for Fedora
- [BINARY ONLY] licenses of statically linked dependencies are correctly taken into account
- license file is included with %license in %files
- package complies with Rust Packaging Guidelines
Package APPROVED.
===
Recommended post-import rust-sig tasks (use `fedora-sig-onboard onboard rust-$crate` to automate):
- add @rust-sig with "commit" access as package co-maintainer
(should happen automatically)
- set bugzilla assignee overrides to @rust-sig (optional)
- set up package on release-monitoring.org:
project: $crate
homepage: https://crates.io/crates/$crate
backend: crates.io
version scheme: semantic
version filter: alpha;beta;rc;pre
distro: Fedora
Package: rust-$crate
- track package in koschei for all built branches
(should happen automatically once rust-sig is co-maintainer)
## Review template (compat)
Compat package, looks identical to the existing rust-$crate. APPROVED
===
Recommended post-import rust-sig tasks (use `fedora-sig-onboard onboard -R rust-$crate$ver` to automate):
- add @rust-sig with "commit" access as package co-maintainer
(should happen automatically)
- set bugzilla assignee overrides to @rust-sig (optional)
- track package in koschei for all built branches
(should happen automatically once rust-sig is co-maintainer)
## License tag for the binary subpackage is missing.
source: https://bugzilla.redhat.com/show_bug.cgi?id=1990713#c4
You can use the commands / macros that are proposed here:
https://pagure.io/fedora-rust/rust2rpm/pull-request/217
For now, you can shell into the mock chroot after a successful build, and run this command in the crate's source root to generate a license summary:
`cargo tree --workspace --offline --edges no-build,no-dev,no-proc-macro --no-dedupe --target all --prefix none --format "# {l}" | sed -e "s: / :/:g" -e "s:/: OR :g" | sort -u`
Or, to generate the complete license information for all statically linked dependencies:
`cargo tree --workspace --offline --edges no-build,no-dev,no-proc-macro --no-dedupe --target all --prefix none --format "# {l}: {p}" | sed -e "s: ($(pwd))::g" -e "s: / :/:g" -e "s:/: OR :g" | sort -u`
# Testing
https://doc.rust-lang.org/stable/cargo/commands/cargo-test.html and https://doc.rust-lang.org/rustc/tests/index.html may help you