package rpmfile

  1. Overview
  2. Docs
A pure OCaml library for parsing RPM files

Install

dune-project
 Dependency

Authors

Maintainers

Sources

1.0.0.tar.gz
md5=101815a0802946784201f81f0e78c748
sha512=c13ff0435543254b2517b70eb67ae8ff02ff926858ab551696cea54ce122df81ebbc4e01a86b423d7bbdc1851dec1ddd9e719c7077548b910874d924e44d67b1

Description

A library for processing (reading and writing) RPM files, supporting version 3.0 and partly 4.0.

Tags

rpm rpmfile

Added to opam-repository:

README

text

Rpmfile

A pure OCaml library for parsing RPM files (supports V3 and partly V4 package versions).

API references

Quick start

You can install the rpmfile library using the OPAM package manager or any other method you prefer.

$ opam install rpmfile.1.0.0

You can also get the latest version of the upstream (developer) branch.

$ opam pin rpmfile.dev https://github.com/dx3mod/rpmfile.git

If 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:

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!

Dependencies (3)

  1. dune >= "3.6"
  2. bytream >= "0.2"
  3. ocaml >= "4.14"

Dev Dependencies (1)

  1. odoc with-doc

Used by

None

Conflicts

None