# ostree-rs
[![pipeline status](https://gitlab.com/fkrull/ostree-rs/badges/master/pipeline.svg)](https://gitlab.com/fkrull/ostree-rs/commits/master)
[![Crates.io](https://img.shields.io/crates/v/ostree.svg)](https://crates.io/crates/ostree)
[![master-docs](https://img.shields.io/badge/docs-master-brightgreen.svg)](https://fkrull.gitlab.io/ostree-rs/ostree)

**Rust** bindings for [libostree](https://ostree.readthedocs.io).

libostree is both a shared library and suite of command line tools that combines
a "git-like" model for committing and downloading bootable filesystem trees,
along with a layer for deploying them and managing the bootloader configuration.

> **Note**: this crate was renamed from the `libostree` crate.

## Status
The bindings are quite incomplete right now. Most of it can be autogenerated,
but I simply turned on what I needed and left the rest for later.

## Using

### Requirements
The `ostree` crate requires libostree and the libostree development headers.
On Debian/Ubuntu, they can be installed with:

```ShellSession
$ sudo apt-get install libostree-1 libostree-dev
```

### Installing
To use the crate, add it to your `Cargo.toml`:

```toml
[dependencies]
ostree = "0.2"
```

To use features from later libostree versions, you need to specify the release
version as well:

```toml
[dependencies.ostree]
version = "0.2"
features = ["v2018_7"]
```

## Developing
The `ostree` and `ostree-sys` crates can be built and tested using regular
Cargo commands.

### Generated code
Most code is generated based on the gir files using the
[gir](https://github.com/gtk-rs/gir) tool. These parts can be regenerated using
the included Makefile:

```ShellSession
$ make gir/ostree gir/ostree-sys
```

Run the following command to update the bundled gir files:

```ShellSession
$ make update-gir-files
```

### Documentation
The libostree API documentation is not included in the code by default because
of its LGPL license. This means normal `cargo doc` runs don't include API docs
for the generated code. Run the `merge-lgpl-docs` Makefile target to include
the API docs in the source so they can be consumed by `cargo doc`:

```ShellSession
$ make merge-lgpl-docs
```

Keep in mind that if you build the crate with the API docs included, it is
effectively LGPL-licensed and you need to comply with the LGPL requirements
(specifically, allowing users of your end product to swap out the LGPL'd
parts).

CI includes the LGPL docs in the documentation build.

### Releases
Releases can be done using the publish_* jobs in the pipeline. There's no
versioning helper yet so version bumps need to be done manually.

## License
The `ostree` crate is licensed under the MIT license. See the LICENSE file for
details.

libostree itself is licensed under the LGPL2+. See its
[licensing information](https://ostree.readthedocs.io#licensing) for more
information.
