1.4 KiB
1.4 KiB
Packaging dmpd
This is rust package using vendor file for dependencies.
To build the package following tooling is needed:
- rust >= 1.35
- cargo with vendor subcommand (now upstream, included in latest Fedora and RHEL8+)
cargo vendor
- run
cargo vendorin 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 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 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.