> For the complete documentation index, see [llms.txt](https://docs.pkgforge.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pkgforge.dev/sbuild/specification/13.license.md).

# 13.License

* [x] This is Optional & can be left empty or removed completely (**TYPE**: <mark style="color:blue;">**`NON_ENFORCED`**</mark>)
* [x] Is copied (installed) as [<mark style="color:orange;">**$APP\_PATH**</mark>](#user-content-fn-1)[^1]<mark style="color:orange;">**/**</mark><mark style="color:blue;">**LICENSE**</mark>
* [x] Use [**repology/projects/$pkg/information**](https://repology.org/projects/) to quickly fetch this Information
* [x] If used, it can only contain (One of these):

{% hint style="success" %}

* [x] <mark style="color:purple;">**`url`**</mark> : Is always preferred as the **1st Choice**, & **CAN NOT BE** used with others.
* [x] This refers to a raw url containing a <mark style="color:blue;">**`LICENSE`**</mark> file & is downloaded + saved at: <mark style="color:orange;">**`${SBUILD_OUTDIR}/LICENSE`**</mark>
* [x] If used, **only ONE entry is supported**

<pre class="language-yaml" data-overflow="wrap"><code class="lang-yaml">#Example ONLY
<strong>license:
</strong>  - id: "MIT"
    url: "https://raw.githubusercontent.com/pkgforge/soar/refs/heads/main/LICENSE" #Would be downloaded &#x26; saved as ${SBUILD_OUTDIR}/LICENSE
</code></pre>

{% endhint %}

{% hint style="success" %}

* [x] <mark style="color:purple;">**`file`**</mark> : Is ONLY preferred, if <mark style="color:purple;">**`url`**</mark> was NOT USED ( <mark style="color:orange;">**non-existent/empty**</mark>), as the **2nd Choice**
* [x] This refers to a direct path to a <mark style="color:blue;">**`LICENSE`**</mark> file produced during an sbuild.
* [x] While Multiple Entries are supported, the builder will stop checking upon the first successful find
* [x] The first valid <mark style="color:blue;">**`LICENSE`**</mark> file is copied to <mark style="color:orange;">**`${SBUILD_OUTDIR}/LICENSE`**</mark>

{% code overflow="wrap" %}

```yaml
#Example ONLY
# (All paths are assumed to be inside ${SBUILD_OUTDIR} i.e ${SBUILD_OUTDIR} == /
license:
  - id: "MIT"
    file: "/MIT.license" #Is assumed as ${SBUILD_OUTDIR}/MIT.license & copied to ${SBUILD_OUTDIR}/LICENSE
  - id: "GPL3"  
    file: "/SBUILD_TMPDIR/foo/bar.license" #Is assumed as ${SBUILD_OUTDIR}/SBUILD_TMPDIR/foo/bar.license & copied to ${SBUILD_OUTDIR}/LICENSE, IF & ONLY IF ${SBUILD_OUTDIR}/MIT.license wasn't found
```

{% endcode %}
{% endhint %}

{% hint style="warning" %}
If you can't find a direct URL to the <mark style="color:blue;">**`LICENSE`**</mark> file & it's also not produced during build anywhere inside <mark style="color:orange;">**`${SBUILD_OUTDIR}`**</mark> , then you may use:

* [x] [<mark style="color:purple;">**`spdx-identifier`**</mark>](https://spdx.org/licenses/): Any (or Multiple if applicable) of the identifiers listed at: <https://spdx.org/licenses/>, as the **3rd & Final Choice**

```yaml
#Example ONLY
license:
  - "GPL-2+"
  - "GPL-2.0"
  - "GPL-2.0-only"
  - "GPL-2.0-or-later"
  - "GPL2"
  - "GPLv3"
  - "Unfree"
```

{% endhint %}

[^1]: $APP\_PATH refers to the directory soar installs the respective APP
