A library for parsing and creating RPM files. Forked from rpm-rs at version 0.8.1.
```rust use fez; use fez::signature::pgp::{Signer,Verifier};
let rawsecretkey = std::fs::read("/path/to/gpg.secret.key")?; let pkg = fez::RPMBuilder::new("test", "1.0.0", "MIT", "x8664", "some awesome package") .compression(fez::Compressor::fromstr("gzip")?) .withfile( "./awesome-config.toml", RPMFileOptions::new("/etc/awesome/config.toml").isconfig(), )? // file mode is inherited from source file .withfile( "./awesome-bin", RPMFileOptions::new("/usr/bin/awesome"), )? .withfile( "./awesome-config.toml", // you can set a custom mode and custom user too RPMFileOptions::new("/etc/awesome/second.toml").mode(0o100744).user("hugo"), )? .preinstallscript("echo preinst") .addchangelogentry("me", "was awesome, eh?", 123123123) .addchangelogentry("you", "yeah, it was", 12312312) .requires(Dependency::any("wget")) .buildandsign(Signer::loadfromascbytes(&rawsecret_key)?) let mut f = std::fs::File::create("./awesome.rpm")?; pkg.write(&mut f)?;
// reading let rawpubkey = std::fs::read("/path/to/gpg.key.pub")?; let rpmfile = std::fs::File::open("testassets/389-ds-base-devel-1.3.8.4-15.el7.x8664.rpm")?; let mut bufreader = std::io::BufReader::new(rpmfile); let pkg = fez::RPMPackage::parse(&mut bufreader)?; // verifying pkg.verifysignature(Verifier::loadfromascbytes(&rawpubkey)?)?; ```
Before this was forked, the goals and non-goals of this package were: