Update README

Describe Cargo.toml patching.
And explain the notes to greater detail.
This commit is contained in:
Marian Csontos 2025-06-11 15:20:55 +02:00
commit afa261551b

View file

@ -1,24 +1,30 @@
# Packaging dmpd
This is mostly regular package except recent addition of rust to used languages.
This is rust package using *vendor* file for dependencies.
## rust-tools
To build the rust-tools (`make rust-tools`) one needs:
To build the package following tooling is needed:
- rust >= 1.35
- cargo with vendor subcommand (now upstream, included in latest Fedora and RHEL8)
- cargo with vendor subcommand (now upstream, included in latest Fedora and RHEL8+)
### cargo vendpr
## cargo vendor
- run `cargo vendor` in the disrectory with sources
- run `cargo vendor` in the directory with sources
- run `tar czf device-mapper-persistent-data-vendor-$VERSION.tar.gz ./vendor`
- copy the file (if version changed) and run the *fedpkg new-sources* command:
- `fedpkg new-sources v$VERSION.tar.gz device-mapper-persistent-data-vendor-$VERSION.tar.gz`
- some dependencies (at the moment only *rio*) are not using upstream from
registry, but a patched version. **After** running cargo vendor apply patch
*0001-Tweak-cargo.toml-to-work-with-vendor-directory.patch* so build does not
try to connect to internet. This dependency is being replaced by supported
crate.
## TODO/NOTES
Some of the dependencies may be already packaged by Fedora. Can we instruct *cargo vendor* to include only those which are not provided by Fedora?
Some of the dependencies are already packaged by Fedora. Can we instruct *cargo vendor* to include only those which are not provided by Fedora?
It would be possible to include these as submodules, and the rest could be used from Fedora.
For RHEL and CentOS Stream using vendor file is the recommended way.
*%cargo_install* installs by defualt in */usr/bin* but the package expects */usr/sbin*. For now I run *make install-rust-tools*.
*%cargo_install* installs by default in */usr/bin* but the package expects */usr/sbin*. For now I run *make install-rust-tools*.
Now Fedora unified the */usr/sbin* and */usr/bin* directories, to this can be "fixed" in Fedora and later in CentOS Stream.