package rpmfile
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=101815a0802946784201f81f0e78c748
sha512=c13ff0435543254b2517b70eb67ae8ff02ff926858ab551696cea54ce122df81ebbc4e01a86b423d7bbdc1851dec1ddd9e719c7077548b910874d924e44d67b1
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.0.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.
Theoretical minimum about RPM files
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.
In use
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.Reader.from_channel_without_payload
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!