Sugar Network/Recipe Specification: Difference between revisions
| Line 242: | Line 242: | ||
== Recipes == | == Recipes == | ||
In some cases, e.g., to save storage space or bandwidth, it is useful to split packaged application into several parts when some parts will be common. Most usual is having any-arch data and binaries sub- | In some cases, e.g., to save storage space or bandwidth, it is useful to split packaged application into several parts when some parts will be common. Most usual is having any-arch data and binaries sub-packages, i.e., the final service will depend on data sub-package (one implementation per application release) and sub-packages with binaries (implementations per arch per application release). But it's not possible to always use sub-packages. Applications could assume that data is placed in a particular relative path from launched binaries, and if there is no way to set data location via environment bindings, sub-packages are useless and recipes will help. | ||
Use ''recipe'' option to declare a | Use ''recipe'' option to declare a (sub)packages as a recipe: | ||
[ | [Package] | ||
recipe = <component-name> [; ...] | recipe = <component-name> [; ...] | ||
| Line 254: | Line 254: | ||
... | ... | ||
Being a recipe, package section cannot contain files related options (since package itself does not contain any tarballs directly, only via recipe components), these options could be set only in components: | |||
* prefix | |||
* langs | * langs | ||
* arch | * arch | ||
| Line 264: | Line 265: | ||
* slots | * slots | ||
The same component could a part of different recipes. In that case, different (sub) | The same component could a part of different recipes. In that case, different (sub)package implementations will contain the same recipe component tarball. | ||
The final | The final package implementation will contain tarball per component. All these tarballs will be unpacked to the same root directory. For example, having the following lines and invoking ''0sugar build'' on two platforms - x86 and x86_64 platforms, two (per arch) implementations will be created and they will use three tarballs - x86 and x86_64 tarballs from ''[binary]'' section and one common for both implementations ''[data]'' tarball. | ||
[ | [Package] | ||
recipe = data, binary | recipe = data, binary | ||
[data] | [data] | ||
include = share/* | include = share/** | ||
[binary] | [binary] | ||
include = bin/*, lib/* | include = bin/**, lib/** | ||
main = bin/launch | main = bin/launch | ||
arch = build | arch = build | ||