No description
Find a file
Fabio Valentini feab8e6a41
rust2rpm: drop ExclusiveArch: %{rust_arches} on Fedora
RPM will gain a dependency on a Rust component (rpm-sequoia), so all
architectures supported by RPM will by definition be the architectures
supported by Rust, making the ExclusiveArch tag unnecessary.

c.f. https://pagure.io/fedora-rust/rust2rpm/issue/228
c.f. https://pagure.io/packaging-committee/issue/1220
2022-10-26 11:38:11 +02:00
data Add %cargo_license and %cargo_license_summary macros 2022-10-19 11:39:20 +02:00
rust2rpm rust2rpm: drop ExclusiveArch: %{rust_arches} on Fedora 2022-10-26 11:38:11 +02:00
tools Enforce consistent formatting with black 2022-07-24 18:47:09 +02:00
.gitignore
LICENSE
MANIFEST.in
NEWS Version 22 2022-07-24 18:55:35 +02:00
pyproject.toml Enforce consistent formatting with black 2022-07-24 18:47:09 +02:00
README.md Drop false claims of support Python 3.8 or 3.9 2022-07-23 19:41:48 +02:00
requirements.txt Implement simple logging; ensure rust2rpm --stdout still works 2022-07-24 11:21:30 +02:00
setup.cfg Implement simple logging; ensure rust2rpm --stdout still works 2022-07-24 11:21:30 +02:00
tox.ini Drop false claims of support Python 3.8 or 3.9 2022-07-23 19:41:48 +02:00

rust2rpm

rust2rpm is a tool for automatically generating RPM spec files for Rust crates.

rust2rpm.conf

If it is present, a rust2rpm.conf configuration file is read by rust2rpm to override some aspects of the automatic spec file generation.

This file can be committed to dist-git to ensure that these settings will be applied for future updates of a crate package, as well.

The file follows a slightly modified ini syntax. It supports sections for default settings ([DEFAULT]) and target-specific settings (i.e. [fedora]).

These configuration options are available right now:

  • all-features: enable all cargo features when generating BuildRequires, building the crate, and running cargo tests (defaults to false; setting this value to true is equivalent to supplying the --all-features CLI flag)
  • unwanted-features: features or optional dependencies for which no +feature subpackage should be generated (for example, dependencies on Rust compiler internals for crates that are also bundled with Rust itself)
  • buildrequires: additional build dependencies that must be installed for the package to build correctly (i.e., pkgconfig(foo) for the foo-sys crate)
  • lib.requires: additional build dependencies that must be installed for the crate to build correctly as a dependency of another crate (usually, this contains the same values as the buildrequires option)
  • lib+foo.requires: additional build dependencies that must be installed for the crate to build correctly as a dependency of another crate if it has enabled the optional foo feature
  • bin.requires: additional runtime dependencies of the binary application that is built from this crate
[DEFAULT]
unwanted-features =
  compiler_builtins
  rustc-dep-of-std
buildrequires =
  pkgconfig(foo) >= 1.2.3
lib.requires =
  pkgconfig(foo) >= 1.2.3

[fedora]
bin.requires =
  findutils
buildrequires =
lib.requires =
lib+default.requires =
  pkgconfig(bar) >= 2.0.0

Note that features and optional dependencies that are marked as unwanted-features must not be dependencies of other Cargo features that are not marked "unwanted" as well. Failing to consider transitive dependencies will lead to broken dependencies of generated rust-foo+bar-devel packages and / or errors when generating spec files with rust2rpm.

Testing

Invoking tox will automatically run the test suite on all python versions that should be supported.

Use python -m pytest -v or PYTHONPATH=. pytest -v in the source tree (possibly within a virtualenv) to run the tests manually.