Skip to content

Commit b249c09

Browse files
authored
indev: make this standard-shaped
1 parent 1ec3f69 commit b249c09

1 file changed

Lines changed: 20 additions & 14 deletions

File tree

src/indev/package-tables.md

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff 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.
22

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).
44

55
## Fields
66
### `unicornSpec`
@@ -9,31 +9,33 @@ This specifies the version of the package table. This should always be set to `v
99

1010
### `name`
1111

12+
<!-- FIXME: redefine this -->
13+
1214
This should be the same as the filename without the `.lua` extension.
1315

1416
### `desc`
1517

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.
1719

1820
### `homepage`
1921

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).
2123

2224
### `maintainer`
2325

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.
2527

2628
### `licensing`
2729

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.
2931

3032
Package definitions MAY be a different license from the license of the package's contents.
3133

3234
#### SPDX extensions
3335

3436
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.
3537

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.
3739

3840
### `version`
3941

@@ -77,36 +79,40 @@ A table that contains scripts that should be called at various points in the pac
7779

7880
#### `script.preinstall`
7981

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.
8183

8284
#### `script.postinstall`
8385

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.
8587

8688
#### `script.preremove`
8789

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.
8991

9092
#### `script.postremove`
9193

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.
9395

9496
### `security`
9597

9698
A table that contains hashes and other security-related data.
9799

100+
Implementations MUST prevent packages with invalid hashes from being installed.
101+
98102
#### `security.sha256`
99103

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.
101107

102108
### `rel`
103109

104110
A table that contains information relating to other packages.
105111

106112
#### `rel.depends`
107113

108-
A table that lists required packages.
114+
An integer-indexed table that lists required packages.
109115

110116
#### `rel.conflicts`
111117

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

Comments
 (0)