Build a simple package

In this example, we will demonstrate how to build a package for the sbs(simple background setter) tool.

Begin by preparing the necessary files for building sbs.

mkdir sbs_build_template
cd sbs_build_template

mkdir stage0
touch stage0/init
touch stage0/build
touch stage0/install_files

touch template

Copy the following content into stage0/init

curl -L https://github.com/onur-ozkan/sbs/archive/refs/tags/v1.0.0.tar.gz > sbs.tar.gz
validate_checksum "sbs.tar.gz" "aa4da5b2315046fc2059599b19c530f08bb870e63ed17111a55991b1ae911367"
tar -xvzf sbs.tar.gz --strip 1 -C $SRC

Copy the following content into stage0/build

make sbs

Copy the following content into stage0/install_files

install_to_package sbs /usr/bin/sbs

Copy the following content into template

{
    "name": "sbs",
    "description": "Simple background setter",
    "maintainer": "Lpm Core Maintainer <contact@onurozkan.dev>",
    "source_repository": "https://github.com/onur-ozkan/sbs",
    "homepage": "https://github.com/onur-ozkan/sbs",
    "arch": "amd64",
    "kind": "util",
    "file_checksum_algo": "sha256",
    "tags": [
        "x11",
        "background-setter"
    ],
    "version": {
        "readable_format": "1.0.0",
        "major": 1,
        "minor": 0,
        "patch": 0
    },
    "license": "MIT"
}

Now, you can run the following command to generate the sbs.lod package along with its repository index (a patch for the LPM repository database):

lpm --module builder --build .

Refer to the package-builds to examine more package templates created for the linux-amd64-default repository.