From 37a6c682b5cc2885f941c7e99153986c8674d226 Mon Sep 17 00:00:00 2001 From: Arsen Musayelyan Date: Fri, 23 Dec 2022 18:09:27 -0800 Subject: [PATCH] Restructure and add more documentation --- docs/README.md | 8 +++--- docs/packages/README.md | 5 ++++ docs/{ => packages}/adding-packages.md | 0 docs/{ => packages}/build-scripts.md | 0 docs/packages/conventions.md | 36 ++++++++++++++++++++++++++ 5 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 docs/packages/README.md rename docs/{ => packages}/adding-packages.md (100%) rename docs/{ => packages}/build-scripts.md (100%) create mode 100644 docs/packages/conventions.md diff --git a/docs/README.md b/docs/README.md index fb90331..e0c027d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,8 @@ # LURE Docs -- [Build Scripts](build-scripts.md) -- [Usage](usage.md) - [Configuration](configuration.md) -- [Adding Packages to LURE's repo](adding-packages.md) \ No newline at end of file +- [Usage](usage.md) +- [Packages](packages) + - [Build Scripts](packages/build-scripts.md) + - [Package Conventions](packages/conventions.md) + - [Adding Packages to LURE's repo](packages/adding-packages.md) \ No newline at end of file diff --git a/docs/packages/README.md b/docs/packages/README.md new file mode 100644 index 0000000..a8187e8 --- /dev/null +++ b/docs/packages/README.md @@ -0,0 +1,5 @@ +# LURE Docs > Packages + +- [Build Scripts](build-scripts.md) +- [Package Conventions](conventions.md) +- [Adding Packages to LURE's repo](adding-packages.md) \ No newline at end of file diff --git a/docs/adding-packages.md b/docs/packages/adding-packages.md similarity index 100% rename from docs/adding-packages.md rename to docs/packages/adding-packages.md diff --git a/docs/build-scripts.md b/docs/packages/build-scripts.md similarity index 100% rename from docs/build-scripts.md rename to docs/packages/build-scripts.md diff --git a/docs/packages/conventions.md b/docs/packages/conventions.md new file mode 100644 index 0000000..2367562 --- /dev/null +++ b/docs/packages/conventions.md @@ -0,0 +1,36 @@ +# Package Conventions + +## General + +Packages should have the name(s) of what they contain in their `provides` and `conflicts` arrays. That way, they can be installed by users without needing to know the full package name. For example, there are two LURE packages for ITD: `itd-bin`, and `itd-git`. Both of them have provides and conflicts arrays specifying the two commands they install: `itd`, and `itctl`. This means that if a user wants to install ITD, they simply have to type `lure in itd` and LURE will prompt them for which one they want to install. + +## Binary packages + +Packages that install download and install precompiled binaries should have a `-bin` suffix. + +## Git packages + +Packages that build and install programs from source code cloned directly from Git should have a `-git` suffix. + +The versions of these packages should consist of the amount of revisions followed by the current revision, separated by a period. For example: `183.80187b0`. Note that unlike the AUR, there is no `r` at the beginning. This is because some package managers refuse to install packages whose version numbers don't start with a digit. + +This version number can be obtained using the following command: + +```bash +printf "%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +``` + +The `version()` function for such packages should use the LURE-provided `git-version` helper command, like so: + +```bash +version() { + cd "$srcdir/$name" + git-version +} +``` + +This uses LURE's embedded Git implementation, which ensures that the user doesn't need Git installed on their system in order to install `-git` packages. + +## Other packages + +Packages that download sources for a specific version of a program should not have any suffix, even if those sources are downloaded from Git. \ No newline at end of file