From 9d31ed23e8430752d8246ff1bce33aef94d9abbd Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Fri, 11 Aug 2023 10:02:39 +0200 Subject: [PATCH] Added doc --- README.org | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 README.org diff --git a/README.org b/README.org new file mode 100644 index 0000000..4ca57f1 --- /dev/null +++ b/README.org @@ -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 +#+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 -- 2.38.5