Class Package

pkgxx/package.moon

Package described and built from a Recipe.

Packages dynamically inherit most of their attributes from their Recipe. As a consequence, a way to easily share values between packages is to put them inside their common Recipe.

See also
Recipe
Atom

Constructors

Package (arg) Package

Constructor.

Takes an array of named parameters to set attributes during construction. Example below.

Package
  origin: some_recipe -- Recipe object
  name: "hello-bin"
  files: {"/usr/bin/hello"}
Arguments
ArgumentTypeDescription
argtableArray of named parameters.
Return values
TypeDescription
Package

Instance

name: string | nil

Package’s name.


version: string | nil

Version of the packaged software or content.


release: number

Version of the package’s recipe itself.

@release must always be an integer. Its minimum legal value is 1.

Warning
This field might be removed from Package and left to inherit from its `@origin` Recipe.

summary: string | nil

Short (one-line) description of the packaged software or content.


description: string | nil

Long (multi-line) description of the packaged software or content.


dependencies: table

Dependencies the package needs to be installed.


conflicts: table

Packages that must not be installed at the same time as the generated package.


provides: table

Virtual packages that this package will provide.


options: table

Generic options field for build and packaging modules.


groups: table

Legacy options for some RPM-based distributions.

Warning
This option will probably never be used anymore, and might get removed in the future. Send an issue if you need its feature.

files: table

List of files that will have to be taken from the fake installation root of the recipe and saved into this package. The recipe’s first package will have an empty list of files, as it will take any file not taken by another package.

The files are represented by paths relative to their fake installation root.


import (data) nil

Imports values from another object.

arg fields

type field description
string name New name of the package.
string version Version of the packaged software.
integer release Version of the package.
table dependencies A list of Atoms representing the package’s dependencies.
table conflicts A list of conflicts for this package.
table provides A list of virtual packages provided.
table buildDependencies A list of build-time dependencies needed for this package and its recipe.
table groups Legacy option for old RPMs.
table options A list of options to pass to pkgxx modules.
string summary Short description of the packaged software.
string description Long description of the packaged software.
string license License of the packaged software.
string copyright One-line copyright statement to generate debian/copyright.
string class Package class.
Arguments
ArgumentTypeDescription
data
Return values
TypeDescription
nil

package (module) true | nil, string

Creates a package using the package manager module passed as parameter.

Checks that the package has the files it’s supposed to have in @files.

Arguments
ArgumentTypeDescription
moduleModulePackage manager module.
Return values
TypeDescription
true
nil, string

packagingDirectory ! string

Return values
TypeDescription
stringThe directory this package will be built in.
See also
Recipe\packagingDirectory

hasOption (option) boolean

Checks the Package possesses any specific option.

Arguments
ArgumentTypeDescription
optionstringAny arbitrary package option.
Return values
TypeDescription
booleanWhether the package has the given option or not.
See also
Package.options

hasFiles ! boolean

Indicates whether the package’s expected files have been built or not.

This method is meant to be used after Recipe\build has been called.

Return values
TypeDescription
booleanWhether the Package can be build with all of its files.
See also
Recipe\build

__index (key) object

Dynamic inheritance that obtains missing attributes or methods in @recipe.

The order in which values are accessed is the following: self, class, origin (Recipe).

Arguments
ArgumentTypeDescription
keyobject
See also
Recipe

__tostring ! object

Package can be transformed to a string for debug operations.