Revision 72432569
Added by Alexis Mousset about 7 years ago
8_reference/74_package_format.txt | ||
---|---|---|
|
||
==== File description
|
||
|
||
A Rudder package file ends with the .rpkg extension.
|
||
A Rudder package file ends with the `.rpkg` extension.
|
||
|
||
A Rudder package file is an archive file and can be managed with the 'ar' command.
|
||
|
||
The archive contains:
|
||
* A metadata file in JSON format named medatata
|
||
* A tarball file in txz format name scripts.txz that contains package setup utility scripts
|
||
* One or more tarball files in txz format that contain the package files
|
||
|
||
* A metadata file in JSON format named medatata
|
||
* A tarball file in txz format name scripts.txz that contains package setup utility scripts
|
||
* One or more tarball files in txz format that contain the package files
|
||
|
||
The metadata file is a JSON file and is named 'metadata':
|
||
```
|
||
|
||
----
|
||
|
||
{
|
||
# the only currently supported type in "plugin" (mandatory)
|
||
"type": "plugin",
|
||
... | ... | |
}
|
||
}
|
||
|
||
```
|
||
----
|
||
|
||
To see a package metadata file use:
|
||
```
|
||
|
||
----
|
||
|
||
ar p package.rpkg medatada
|
||
```
|
||
|
||
----
|
||
|
||
The scripts.txz is a tarball that can contain zero or more executable files named:
|
||
* preinst that will be run before installing the package files
|
||
* postinst that will be run after installing the package files
|
||
* prerm that will be run before removing the package files
|
||
* postrm that will be run after removing the package files
|
||
|
||
* preinst that will be run before installing the package files
|
||
* postinst that will be run after installing the package files
|
||
* prerm that will be run before removing the package files
|
||
* postrm that will be run after removing the package files
|
||
|
||
preinst and postinst take one parameter that can be 'install' or 'upgrade'. The value 'upgrade' is used when a previous version of the package is already installed.
|
||
|
||
To create the scripts.txz file use:
|
||
```
|
||
|
||
----
|
||
|
||
tar cvfJ scripts.txz preinst postinst prerm postrm
|
||
```
|
||
|
||
----
|
||
|
||
To create a Rudder package file use the ar command:
|
||
```
|
||
|
||
----
|
||
|
||
ar r mypackage-4.1-3.0.rpkg medatada scripts.txz files.txz
|
||
```
|
||
|
||
----
|
||
|
||
Note that ar r inserts or replaces files so you can create your package with incremental inserts.
|
||
|
Also available in: Unified diff
Fixes #10297: Broken formatting of plugin packaging doc