# 2.Pkg

{% code overflow="wrap" %}

```yaml
#Example ONLY
pkg: "Real Name, It will be Installed & Integrated based on this Value"
pkg_id: "Unique Identifier, Based on src_url, used for identifying this .pkg"
pkg_type: "Pkg Format, if empty or nonexistent, Builder reads Magic Bytes to determine format"
```

{% endcode %}

* [x] <mark style="color:purple;">**`pkg`**</mark> is the **Canonical** name of the Package. *It will be installed as this, regardless of the actual filename*. Desktop entry will also show this name (**TYPE**: <mark style="color:red;">**ENFORCED**</mark>)
* [x] [<mark style="color:purple;">**`pkg_id`**</mark>](#user-content-fn-1)[^1] is like an **`ID`**, It is **`Unique` & `NOT SHARED`** with any other <mark style="color:purple;">**`pkg_id`**</mark> from other packages (**TYPE**: <mark style="color:green;">**`RECOMMENDED`**</mark>)

> - <mark style="color:purple;">**`pkg_id`**</mark> is to make it seamless to add multiple binaries from multiple sources for the same pkg
>
> - <mark style="color:purple;">**`pkg_id`**</mark> is just <mark style="color:purple;">**`src_url`**</mark> without <mark style="color:orange;">`http|https`</mark> schema along with some extra params
>
> - Example: <mark style="color:purple;">**`src_url`**</mark>` `` ``= ` "<mark style="color:blue;">`https://`</mark><mark style="color:orange;">`github.com`</mark><mark style="color:blue;">`/`</mark><mark style="color:yellow;">`AppImager`</mark><mark style="color:blue;">`/`</mark><mark style="color:green;">`example-appimage`</mark>" --> <mark style="color:orange;">**`github.com`**</mark><mark style="color:blue;">**`.`**</mark><mark style="color:yellow;">**`AppImager`**</mark><mark style="color:blue;">**`.`**</mark><mark style="color:green;">**`example-appimage`**</mark>
>
> - Notice how, all special chars like `/` --> `.` and `http://|https://` was removed Another example, where the repo has multiple appimages:
>
> > * **`alpha`** --> github.com.AppImager.example-appimag&#x65;**.alpha**
> > * **`latest`** --> github.com.AppImager.example-appimage.**latest**
> > * **`nightly`** --> github.com.AppImager.example-appimag&#x65;**.nightly**
> > * **`stable`** --> github.com.AppImager.example-appimag&#x65;**.stable**
>
> * It's just **`$tag`** or some other identifier added at last

{% hint style="info" %}
**If you don't specify a `pkg_id`**, the first entry of <mark style="color:purple;">**`src_url`**</mark> is auto converted & added as <mark style="color:purple;">**`pkg_id`**</mark>
{% endhint %}

* [x] <mark style="color:purple;">**`pkg_type`**</mark> is the Package Format, it can be one of the following (<mark style="color:orange;">**`lowercase`**</mark>) (**TYPE**: <mark style="color:green;">**`RECOMMENDED`**</mark>)

> - [**AppImage**](https://docs.pkgforge.dev/formats/packages/appimage) denotes it is an [AppImage](https://appimage.org/) <mark style="color:purple;">**pkg\_type**</mark>**: "**<mark style="color:orange;">**appimage**</mark>**"**
> - [**AppBundle**](https://docs.pkgforge.dev/formats/packages/appbundle) denotes it is an [AppBundle](https://github.com/xplshn/pelf/) <mark style="color:purple;">**pkg\_type**</mark>**: "**<mark style="color:orange;">**appbundle**</mark>**"**
> - [**Archive**](https://docs.pkgforge.dev/formats/packages/archive) denotes it is an archive (**SELF-EXTRACTABLE**) format: <mark style="color:purple;">`.7z .bz .bz2 .gz .lz4 .lzma .rar .sz .tar .xz .zst`</mark> or a mix-mash of these. This includes formats like [alpix](https://github.com/QaidVoid/alpix), [staticx](https://github.com/JonathonReinhart/staticx) etc. <mark style="color:purple;">**pkg\_type**</mark>**: "**<mark style="color:orange;">**archive**</mark>**"**
> - [**Dynamic**](https://docs.pkgforge.dev/formats/binaries/dynamic) denotes it is a *Dynamic Binary* <mark style="color:purple;">**pkg\_type**</mark>**: "**<mark style="color:orange;">**dynamic**</mark>**"**
> - [**FlatImage**](https://docs.pkgforge.dev/formats/packages/flatimage) denotes it is a [*FlatImage*](https://github.com/ruanformigoni/flatimage) , <mark style="color:purple;">**pkg\_type**</mark>**: "**<mark style="color:orange;">**flatimage**</mark>**"**
> - [**GameImage**](https://docs.pkgforge.dev/sbuild/specification/broken-reference) denotes it is a [*GameImage*](https://github.com/ruanformigoni/gameimage) , <mark style="color:purple;">**pkg\_type**</mark>**: "**<mark style="color:orange;">**gameimage**</mark>**"**
> - [**NixAppImage**](https://docs.pkgforge.dev/formats/packages/nixappimage) denotes it is a [*NixAppImage*](https://github.com/ralismark/nix-appimage) , <mark style="color:purple;">**pkg\_type**</mark>**: "**<mark style="color:orange;">**nixappimage**</mark>**"**
> - [**RunImage** ](https://docs.pkgforge.dev/formats/packages/runimage)denotes it is a [*RunImage*](https://github.com/VHSgunzo/runimage) , <mark style="color:purple;">**pkg\_type**</mark>**: "**<mark style="color:orange;">**runimage**</mark>**"**
> - [**Static**](https://docs.pkgforge.dev/formats/binaries/static) denotes it is a *Static Binary* , <mark style="color:purple;">**pkg\_type**</mark>**: "**<mark style="color:orange;">**static**</mark>**"**

{% hint style="info" %}
**`Runner/Linter`** will *read the magic bytes* to determine correct format in case this field is empty.
{% endhint %}

[^1]: `pkg_id` will be *auto generated* based on `src_url` **if `pkg_id` is empty**
