All Projects → Richterrettich → rpm-rs

Richterrettich / rpm-rs

Licence: other
A pure rust library for building and parsing RPM's

Programming Languages

rust
11053 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to rpm-rs

foreman-packaging
Packaging files (RPMs, debs) for Foreman and its dependencies
Stars: ✭ 38 (+18.75%)
Mutual labels:  packaging, rpm
elementary-nightly-rpms
nightly Pantheon DE + elementary applications packages for fedora (unofficial)
Stars: ✭ 34 (+6.25%)
Mutual labels:  packaging, rpm
deezer-linux
An universal linux port of deezer, supporting both Flatpak and AppImage
Stars: ✭ 141 (+340.63%)
Mutual labels:  packaging, rpm
Jenkins Bootstrap Shared
Jenkins as immutable infrastructure made easy. A repository of shared scripts meant to be used as a git submodule. Packing Jenkins, plugins, and scripts into immutable packages and images.
Stars: ✭ 270 (+743.75%)
Mutual labels:  packaging, rpm
Fpm Within Docker
Leverage fpm inside pre-baked docker images in order to build and test native DEB and RPM packages.
Stars: ✭ 80 (+150%)
Mutual labels:  packaging, rpm
obs-service-go modules
OBS Source Service to download, verify, and vendor Go module dependency sources
Stars: ✭ 18 (-43.75%)
Mutual labels:  packaging, rpm
package-build
A toolset for building system packages using Docker and fpm-cookery
Stars: ✭ 36 (+12.5%)
Mutual labels:  packaging, rpm
Docker Rpm Builder
Build native RPM packages for Centos/RHEL/Fedora from any Linux distro or even OSX, by leveraging docker capabilities.
Stars: ✭ 366 (+1043.75%)
Mutual labels:  packaging, rpm
Open Build Service
Build and distribute Linux packages from sources in an automatic, consistent and reproducible way #obs
Stars: ✭ 599 (+1771.88%)
Mutual labels:  packaging, rpm
Rpmvenv
RPM packager for Python virtualenv.
Stars: ✭ 128 (+300%)
Mutual labels:  packaging, rpm
rabbitmq-server-release
RabbitMQ packaging and release engineering bits that do not belong to the Concourse pipelines.
Stars: ✭ 13 (-59.37%)
Mutual labels:  packaging, rpm
pybin
Cross-platform tool to put Python's user bin in PATH, no sudo/runas required!
Stars: ✭ 21 (-34.37%)
Mutual labels:  packaging
nim-package-directory
Nim package directory - documentation builder
Stars: ✭ 47 (+46.88%)
Mutual labels:  packaging
sdia-python
Python course material - SDIA Python
Stars: ✭ 16 (-50%)
Mutual labels:  packaging
pkutils
A Python packaging utility library
Stars: ✭ 19 (-40.62%)
Mutual labels:  packaging
awx-rpm
RPM specs for ansible-awx project
Stars: ✭ 41 (+28.13%)
Mutual labels:  rpm
craft
The universal Sentry release CLI 🚀
Stars: ✭ 117 (+265.63%)
Mutual labels:  packaging
rpmlint
Tool for checking common errors in rpm packages
Stars: ✭ 112 (+250%)
Mutual labels:  rpm
Winepak
Flatpak-ing Microsoft Windows applications with Wine
Stars: ✭ 242 (+656.25%)
Mutual labels:  packaging
Scikit Build
Improved build system generator for CPython C, C++, Cython and Fortran extensions
Stars: ✭ 234 (+631.25%)
Mutual labels:  packaging

RPM-RS

A pure rust library for parsing and creating RPM files.

Goals

  • Easy to use API
  • Pure rust to make it easy to use in larger Projects
  • Independence of Spec files. Pure programmatic interface for Packaging.
  • Compatibility to Centos 7 / Fedora (I may extend test cases for SUSE)

Non Goals

RPM has a lot of cryptic features. I do not want to re-implement all of them. This library focuses on the ones that I assume as useful. This library does not build software like rpmbuild. It is meant for finished artifacts that need to be packaged as RPM.

Status

  • RPM Creation
  • Basic RPM Reading
  • RPM Signing and Signature Verification
  • High Level API for RPM Reading

Examples

use rpm;
use rpm::signature::pgp::{Signer,Verifier};

let raw_secret_key = std::fs::read("/path/to/gpg.secret.key")?;
let pkg = rpm::RPMBuilder::new("test", "1.0.0", "MIT", "x86_64", "some awesome package")
            .compression(rpm::Compressor::from_str("gzip")?)
            .with_file(
                "./awesome-config.toml",
                RPMFileOptions::new("/etc/awesome/config.toml").is_config(),
            )?
            // file mode is inherited from source file
            .with_file(
                "./awesome-bin",
                RPMFileOptions::new("/usr/bin/awesome"),
            )?
             .with_file(
                "./awesome-config.toml",
                // you can set a custom mode and custom user too
                RPMFileOptions::new("/etc/awesome/second.toml").mode(0o100744).user("hugo"),
            )?
            .pre_install_script("echo preinst")
            .add_changelog_entry("me", "was awesome, eh?", 123123123)
            .add_changelog_entry("you", "yeah, it was", 12312312)
            .requires(Dependency::any("wget"))
            .build_and_sign(Signer::load_from_asc_bytes(&raw_secret_key)?)
let mut f = std::fs::File::create("./awesome.rpm")?;
pkg.write(&mut f)?;

// reading
let raw_pub_key = std::fs::read("/path/to/gpg.key.pub")?;
let rpm_file = std::fs::File::open("test_assets/389-ds-base-devel-1.3.8.4-15.el7.x86_64.rpm")?;
let mut buf_reader = std::io::BufReader::new(rpm_file);
let pkg = rpm::RPMPackage::parse(&mut buf_reader)?;
// verifying
pkg.verify_signature(Verifier::load_from_asc_bytes(&raw_pub_key)?)?;
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].