You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/indev/package-tables.md
+20-14Lines changed: 20 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
**Package tables** are the primary way of setting up packages with unicornpkg. They are a Lua table or a function that returns a Lua table.
1
+
**Package tables** are the primary way of setting up packages with unicornpkg. They MUST be a Lua table. The fields `name`, `pkgType`, and `unicornSpec` MUST be defined.
2
2
3
-
The only required fields are `name` and `pkgType`, but more are recommended if you want your package to be useful.
3
+
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC 2119](https://datatracker.ietf.org/doc/html/rfc2119).
4
4
5
5
## Fields
6
6
### `unicornSpec`
@@ -9,31 +9,33 @@ This specifies the version of the package table. This should always be set to `v
9
9
10
10
### `name`
11
11
12
+
<!-- FIXME: redefine this -->
13
+
12
14
This should be the same as the filename without the `.lua` extension.
13
15
14
16
### `desc`
15
17
16
-
A description of the contents of the package table. Can be single-line or multiline.
18
+
A description of the contents of the package table, as a string. Can be single-line or multiline.
17
19
18
20
### `homepage`
19
21
20
-
A link to the program's homepage, if it has one.
22
+
A link to the program's homepage, if it has one. If set, this MUST be an [absolute-URL string](https://url.spec.whatwg.org/#url-writing) as defined by the [WHATWG URL Standard](https://url.spec.whatwg.org).
21
23
22
24
### `maintainer`
23
25
24
-
The name or pseudonym of the maintainer of the package table.
26
+
The name or pseudonym of the maintainer of the package table. This MUST be expressed as a string, if set.
25
27
26
28
### `licensing`
27
29
28
-
The license of the package's contents, expressed as an [SPDX License Expression](https://spdx.github.io/spdx-spec/v3.0.1/annexes/spdx-license-expressions/) as defined in the SPDX Specification, v3.0.1.
30
+
The license of the package's contents. This MUST be expressed as an [SPDX License Expression](https://spdx.github.io/spdx-spec/v3.0.1/annexes/spdx-license-expressions/) as defined in the SPDX Specification, v3.0.1.
29
31
30
32
Package definitions MAY be a different license from the license of the package's contents.
31
33
32
34
#### SPDX extensions
33
35
34
36
Packages MAY use `CCPL` and `MMPL` in license expressions to refer to the ComputerCraft Public License and Minecraft Mod Public License, respectively. New projects SHOULD refrain from using these licenses. If `CCPL` or `MMPL` ever become defined in the SPDX License List, those definitions MUST take precedence.
35
37
36
-
Other than the exceptions above, implementations SHOULD avoid other extensions to the SPDX License List.
38
+
Other than the exceptions above, implementations SHOULD avoid bespoke extensions to the SPDX License List.
37
39
38
40
### `version`
39
41
@@ -77,36 +79,40 @@ A table that contains scripts that should be called at various points in the pac
77
79
78
80
#### `script.preinstall`
79
81
80
-
A block of Lua source code that is called before the package table is installed.
82
+
This value, if set, MUST be a string of Lua source code. It SHOULD be executed before the package is installed.
81
83
82
84
#### `script.postinstall`
83
85
84
-
A block of Lua source code that is called after the package table is installed.
86
+
This value, if set, MUST be a string of Lua source code. It SHOULD be executed after the package is installed.
85
87
86
88
#### `script.preremove`
87
89
88
-
A block of Lua source code that is called before the package is removed.
90
+
This value, if set, MUST be a string of Lua source code. It SHOULD be executed before the package is removed.
89
91
90
92
#### `script.postremove`
91
93
92
-
A block of Lua source code that is called after the package is removed.
94
+
This value, if set, MUST be a string of Lua source code. It SHOULD be executed after the package is removed.
93
95
94
96
### `security`
95
97
96
98
A table that contains hashes and other security-related data.
97
99
100
+
Implementations MUST prevent packages with invalid hashes from being installed.
101
+
98
102
#### `security.sha256`
99
103
100
-
A table that contains a name of the installed file (e.g. `/bin/some-nonexistent-program.lua`) and the corresponding SHA-256 hash (e.g. `00000000000000000000000000000000000000000000000000000000000000000`).
104
+
A table that contains a name of the installed file (e.g. `/bin/some-nonexistent-program.lua`) and the corresponding SHA-256 hash represented as a 256-bit hexadecimal string.
105
+
106
+
SHA-256 hashes MUST be generated by a compliant implementation of [FIPS 180-4, Secure Hash Standard (SHS)](https://csrc.nist.gov/pubs/fips/180-4/upd1/final), or a later revision of that standard.
101
107
102
108
### `rel`
103
109
104
110
A table that contains information relating to other packages.
105
111
106
112
#### `rel.depends`
107
113
108
-
A table that lists required packages.
114
+
An integer-indexed table that lists required packages.
109
115
110
116
#### `rel.conflicts`
111
117
112
-
A numbered table that lists packages which break when they are installed with this package.
118
+
An integer-indexed table that lists packages which break when they are installed with this package.
0 commit comments