package rpmfile
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=0eb303a5fa95fd0988b01735281a0ef7
sha512=7997c364529c676c7be3fa121b9d3115302d528919a4528a1f94d76ae6f0a8610fdb72e4e6cb8ce30ae7c05beae5a60d0b9a3141ae7186abae2edb5efc4dd713
doc/README.html

Rpmfile
A pure OCaml library for parsing RPM files (supports V3 and partly V4 package versions).
Quick start
You can install the rpmfile library using the OPAM package manager or any other method you prefer.
$ opam install rpmfile.1.1.0You can also get the latest version of the upstream (developer) branch.
$ opam pin rpmfile.dev https://github.com/dx3mod/rpmfile.gitIf you are using Dune, please add the rpmfile library to your dependencies.
In use
Each RPM package consists of four sections: Lead, Signature, Header, and Payload. The first three are meta information about the package. It contains a description, a dependency list, and so on.
The information in the Signature and Header sections is stored on a key-value basis, where the key is called a tag. The value can be a number, a string or an array. The Payload section usually contains a compressed Cpio archive that already contains the package's files.
For more information, please see the materials.
Below is an example of simply reading an RPM file and obtaining the package name and version.
let () =
let metadata =
In_channel.with_open_bin
"hello.rpm"
Rpmfile.metadata_from_channel
in
let name, release = Rpmfile.View.(name metadata, release metadata) in
Printf.printf "%s.%s\n" name release
(* hello.1.3 *)For more details, see API references and examples/ directory.
References
Package format specification:
Reference implementations in other languages:
- https://github.com/rpm-rs/rpm/ written in Rust
License
The project is licensed under the MIT License, which allows for all permissions. Just use it and enjoy yourself without fear. We are always open to pull requests!