Cargo helper command to generate a binary RPM package (.rpm) from Cargo project.
This command does not depend on rpmbuild
and generates an RPM package file without a spec file by using rpm-rs.
sh
cargo install cargo-generate-rpm
sh
cargo build --release
strip -s target/release/XXX
cargo generate-rpm
Upon run cargo generate-rpm
on your cargo project, a binary RPM package file will be created in target/generate-rpm/XXX.rpm
.
You can change the RPM package file location using -o
option.
In advance, run cargo run --release
and strip the debug symbols (strip -s target/release/XXX
), because these are not run upon cargo generate-rpm
as of now.
This command obtains RPM metadata from the Cargo.toml
file:
[package.metadata.generate-rpm]
optionspackage.name
is used.package.version
is used.package.license
is used.package.description
is used.target/release/XXX
)/usr/bin/XXX
)755
to indicate -rwxr-xr-x
)