-
Notifications
You must be signed in to change notification settings - Fork 88
Recipe Specification
attribute | data sort | mode | description |
---|---|---|---|
arch | string | rw | The package architecture |
description | string | rw | The package description |
homepage | string | rw | The package homepage/site |
maintainer | string | rw | The package maintainer |
name | string | rw | The package name, a symbol in the package management system |
revision | string | int | The package revision; put at the end of the package name, e.g. demoproject-1.4.0-9.el6.x86_64.rpm if the revision is 9
|
section | string | rw | The package section in the package management system, useful for grouping related packages together - like a tag |
md5 | string | rw | The md5 hash of the source; an alternative to sha1 and sha256 |
sha1 | string/hexdigest | rw | A hexdigest-formatted SHA1 hash of the source data to build the package from |
sha256 | string | rw | A hexdigest-formatted SHA256 hash of the source data to build the package from |
spec | string | rw | ? |
vendor | string | rw | A name of the vendor/software company that has made the package |
version | Semver-similar version. Something like (?\d:?(?\d+)\.(?\d+)(\.(?\d+))?)
|
rw | This is the version that the package gets in the package management system |
pre_install | path/string | rw | An optional pre-install script, with path relative to the recipe.rb file. Use to run shell-scripts before installing the package. |
post_install | path/string | rw | An optional post-install script, with path relative to the recipe.rb file. Use to run shell-scripts after installing the package. |
pre_uninstall | path/string | rw | An optional pre-uninstall script, with path relative to the recipe.rb file. Use to run shell-scripts before uninstalling the package. |
post_uninstall | path/string | rw | An optional post-uninstall script, with path relative to the recipe.rb file. Use to run shell-scripts after uninstalling the package. |
license | string | rw | The license of the software being packaged. |
build_depends | name list/string list | rw | A list of packages that the build depends on as a list of strings. FPM-Cookery will ensure these packages are installed before trying to perform the build of the source. |
config_files | path list/string list | rw | A list of config files, relative to the source directory. DEB packages enjoy this list particularly, but RPM packages don't care much. |
conflicts | name list / string list | rw | The list of packages that cannot be installed at the same time as the current package. Write this to instruct the package manager to be strong and wary and guard against the packages in the list. |
depends | name list / string list | rw | A list of packages that have to be present before this package can be installed. |
exclude | path list / string list | rw | A list of files from the source folder that are not to be included in the final package. Useful for removing folders that other packages have already provided or by avoiding special cases in the install specification. Uses globbing against path relative to root of destination without leading slash. |
patches | name list / string list | rw | A list of packages that have their data modified by this package |
provides | name list / string list | rw | A list of names that this package 'makes so'. By default the name is provided, but you can further specify package names in this list. |
replaces | name list / string list | rw | A list of packages that this package replaces, i.e. packages that are first uninstalled before this package is installed. |
omnibus_package | string | rw | Enable packaging of multiple recipes into a single artifact |
omnibus_dir | string | rw | Base directory to package |
omnibus_recipes | string list | rw | List of child recipes to call before packaging operations |
omnibus_additional_paths | name list/string list | rw | DOCUMENT MEEEE |
chain_package | string | rw | #30 |
chain_recipes | string list | rw | #30 |
fpm_attributes | hash | rw | set arbitrary fpm attributes |
This gives the recipe name
A brief description of the recipe - it will show up in package managers
The name of your package - will equal to the symbol that the package manager uses for your package. No funky stuff.
The package version. 1:M.m.p is a way of specifying an epoch 1, but you can go without it.
The URL of the hosted source
A list of config files, relative to the source directory.
An alternative way of setting a package epoch. Defaults to the first epoch (1). Hint: use real versions instead - unless you write a bad package and want to 'bump' the version of the package in the package manager (but not changing the actual software).
In the case of needing to perform OS specific build or install action you can use Facts.platform.
FPM::Cookery::Facts.platform
def install
case Facts.platform
when :ubuntu
etc('init').install_p workdir('graylog2-server.upstart'), 'graylog2-server.conf'
when :debian
etc('init.d').install_p workdir('graylog2-server.initd'), 'graylog2-server'
etc('default').install_p workdir('graylog2-server.confd'), 'graylog2-server'
end
end