~comcloudway/cabin

9d31ed23e8430752d8246ff1bce33aef94d9abbd — Jakob Meier 1 year, 3 months ago 7f1a4e4
Added doc
1 files changed, 62 insertions(+), 0 deletions(-)

A README.org
A README.org => README.org +62 -0
@@ 0,0 1,62 @@
* Cabin
Simple alpine package builder with dependency resolution.

While ~abuild~ has the option to automatically install dependencies,
it does not have the option to automatically build them.
This makes it difficult to build packages for a custom mirror from scratch.
(Without using upstream packages)
Cabin aims to simplify this by making dependency resolution easier.

In theory Cabin should also make it possible
to use the [[gitlab.alpinelinux.org/alpine/aports/][offical aports repo]] somewhat like ~portage~ repos on Gentoo,
by indexing and compiling packages locally.

** Usage
First of all,
you have to generate a database file for the ~aports~ directory.
#+begin_src bash
cabin scan
#+end_src
This will automatically scan the current folder (~.~),
and all child-folders recursively and save the database to ~db.yml~.

Now you're essentially done,
try ~list~-ing all available packages,
or ~search~-ing for a specific one.
Maybe use ~cabin help~ for more option.

To build a given package in the repo,
run the following command:
#+begin_src bash
cabin build <package>
#+end_src.
Keep in mind,
that you have to add ~$HOME/packages~ to ~/etc/apk/repositories~
if you want to use the dependency resolution / auto build feature.

Also you have to rerun the ~scan~ command every time the ~aports~ change.

** Dependencies
*** Compile-time
- ~cargo~
- ~rust~

~rustup~ can setup the compile-time dependencies for you,
just follow [[https://rustup.rs/][the official setup instructions]].
*** Runtime
- ~apk~ (to install packages)
- ~abuild~ (to build packages)

Assuming you are running [[alpinelinux.org/][Alpine Linux]],
you can use the following command to install ~abuild~
#+begin_src bash
apk add abuild
#+end_src
However you also have to configure ~abuild~ to use a ~rsa~ key-pair,
luckily the steps are documented on the [[https://wiki.alpinelinux.org/wiki/Creating_an_Alpine_package][Alpine Wiki]].

** Building
You can use ~cargo~ to build ~cabin~ and its dependencies:
#+begin_src bash
cargo build --release
#+end_src