RBM_CONFIG(7)
β¨ rbm_config β the manual page for RBM_CONFIG(7) β¨
okay bestie, sit down, grab a boba, because we're about to learn the entire configuration system of rbm and honestly? it's giving organized. π
πΈ NAME πΈ
rbm_config β the rbm configuration, aka the whole vibe of how rbm knows what you want π
π DESCRIPTION π
So, like, all configuration options can be defined in different places β it's not just one file, it's a whole ecosystem, and honestly the way it layers? iconic.
- in the main configuration in your working directory (
rbm.conf) - in a module configuration at the root of a module directory (
rbm.module.conf) - in the local configuration in your working directory (
rbm.local.conf) - in the global system configuration (
/etc/rbm.conf) - in a project configuration
- with a command line option
π¦ priority order π¦
when the same option is defined in more than one place, rbm does a little vibe check and picks the winner in this exact order β top of the list is main character energy, bottom is, uh, nobody:
- command line options
- project config for matching step and target
- project config for matching step
- project config for matching target
- project config
- local config for matching step and target
- local config for matching step
- local config for matching target
- local config
- workspace config for matching step and target
- workspace config for matching step
- workspace config for matching target
- workspace config
- modules config for matching step and target
- modules config for matching step
- modules config for matching target
- modules config
- system config for matching step and target
- system config for matching step
- system config for matching target
- system config
- default config
- undefined
like, undefined is literally last place. it's the "left on read" of config values. π
π§ the system config π§
The system configuration is by default located at /etc/rbm.conf, or the path defined in the sysconf_file option. If the path does not exist, it is ignored (no drama, it just moves on). This is where you will put configuration only relevant to your local use of rbm. π«Ά
π the main config π
The main configuration file is rbm.conf, in YAML format. It can be located anywhere on your filesystem, but you will need to run the rbm commands from the same directory, or one of its subdirectories. This is where you will put configuration relevant to all projects under this working directory. All relative paths used in the configuration are relative from the rbm.conf location. no cap, that part matters.
π the local config π
The local configuration file is rbm.local.conf (or the file defined by the localconf_file option), in the same directory as the rbm.conf file. If the file does not exist, it is ignored. The rbm.local.conf file is used to override some options from rbm.conf relevant to your local setup, without modifying the rbm.conf file which is usually maintained in a VCS. it's the "do not touch the sacred file, put your stuff here instead" file. periodt. π
π the module configs π
The module configuration files are rbm.module.conf located at the root of each module directory: a module named A will have its configuration in modules/A/rbm.module.conf. Module configuration is used in alphabetical order: configuration from a module named A will have priority over a module named B. so like, alphabet supremacy but make it config. β¨
π an example, bestie π
An example rbm.conf file will look like this:
compress_tar: xz
output_dir: "out/[% project %]"
π adding projects π
Adding a new project is done by creating a directory with the name of the project inside the projects directory, and adding a config file in this new directory. The config file contains the configuration for the project. At the minimum it should contain the git_url configuration, and any other configuration option you want to set for this project.
Projects can also be defined inside a module. In this case the module directory will include a projects directory working in a similar way to the main projects directory. If a project exists with the same name both in a module and the main projects directory, the module one will be ignored. If a project is defined in multiple modules, only the project from the first module in alphabetic order will be used. first alphabetically wins, everyone else can go home. π
β¨ OPTIONS β¨
The following configuration options are available β and yes, we're doing all of them, no skipping, we're not cowards:
sysconf_fileβ The path to an optional system configuration file. The default is/etc/rbm.conf. This can also be set with the--sysconf-filecommand line parameter. ποΈlocalconf_fileβ The path to an optional local configuration file. The default isrbm.local.conf. If the path is relative, it is relative to the directory where therbm.conffile is located. This can also be set with the--localconf-filecommand line parameter. ποΈprojects_dirβ The directory containing the projects definitions. The default value isprojects.git_clone_dirβ The directory used to store clones of git repositories. The default value isgit_clones.hg_clone_dirβ The directory used to store clones of mercurial repositories. The default value ishg_clones.hg_clone_subdirβ If this option is set, the repository is cloned in a subdirectory with that name. This is useful if a single project requires clones of multiple mercurial repositories, for example using a differenthg_urlin each targets or steps. The default value is., which means that no subdirectory is used.hg_optβ This option contains options that should be passed on the mercurial command line. This can for instance be useful if you want to use the--configoption to enable some mercurial plugins.tmp_dirβ The directory used to create temporary directories and files. This is the directory where builds will be done, so you want to use a directory on a fast device, with enough space available. This directory will contains some scripts that will be executed, so it should not be on a partition mounted asnoexec. π¨
for real for real: not on a noexec partition. scripts gotta run.
rbm_tmp_dirβ A directory created insidetmp_dirusingFile::Temp, that you can use to store temporary files. This directory is removed automatically whenrbmexits. When running scripts, theTMPDIRenvironment variable is also set to this directory. it cleans up after itself, we love a self-aware queen. πrbmdirβ The directory where therbmscript is located.output_dirβ The directory where output files (tarballs, spec files or packages) are created. The default value isout.build_logβ The file where the build logs will be written. If the value is-(the default), the logs will be output onstdoutandstderr.build_log_appendβ If you setbuild_log_appendto0, the log file (defined inbuild_log) will be cleaned when starting a new build. The default is1.fetchβ The value should be0or1, depending on whether the commits from the remote git or hg repository should be fetched automatically. If the value isif_needed, the git or hg repository is fetched only if the selected commit cannot be found in the local clone. The default isif_needed. lazy fetch = bestie fetch π¦ENVβ This option, defined in the workspace config, is a hash containing the environment variables that will be defined whenrbmis starting. This is useful for defining variables that can affect how the templates are processed (for instance theTZvariable if dates are used). If this option is not definedTZwill be set toUTCandLC_ALLtoC.git_urlβ The URL of a git repository that will be cloned and used to create the tarball. If this option is set,git_hashshould be set to select the commit to use.hg_urlβ The URL of a mercurial repository that will be cloned and used to create the tarball. If this option is set,hg_hashshould be set to select the commit to use.git_hashβ A git hash, branch name or tag. This is what is used to create the tarball.hg_hashβ A mercurial changeset hash. This is what is used to create the tarball.git_submoduleβ If this option is enabled, git submodules are fetched and included in the tarball. This option is disabled by default.git_depthβ An integer specifying a depth for shallow Git clone/fetch depth, to decrease network and storage usage. If not set, shallow clone/fetch is disabled.git_branchβ A Git ref name that will be exclusively cloned/fetched, to decrease network and storage usage. Must be a descendent (inclusive) ofgit_hash. If not set, all Git refs are cloned/fetched.compress_tarβ If set, the tarball created will be compressed in the select format. Possible values:xz,gz,bz2,zst. The default isgzbut it can stay empty to disable compression. β¨commit_gpg_idβ If set, the commit selected withgit_hashwill have its signature checked. The tarball will not be created if there is no valid signature, and if the key used to sign it does not match the key ID fromcommit_gpg_id. The option can be set to a single gpg ID, or to a list of gpg IDs. The IDs can be short or long IDs, or full fingerprint (with no spaces). For this to work, the GPG keys should be present in the selected keyring (seekeyringoption). If the option is set to1or an array containing1then any key from the selected keyring is accepted. On command line, the--commit-gpg-idoption can be listed multiple times to define a list of keys. πtag_gpg_idβ If set, the commit selected withgit_hashshould be a tag and will have its signature checked. The tarball will not be created if the tag doesn't have a valid signature, and if the key used to sign it does not match the key ID fromtag_gpg_id. The option can be set to a single gpg ID, or to a list of gpg IDs. The IDs can be short or long IDs, or full fingerprint (with no spaces). For this to work, the GPG keys should be present in the selected keyring (seekeyringoption). If the option is set to1or an array containing1then any key from the selected keyring is accepted. On command line, the--tag-gpg-idoption can be listed multiple times to define a list of keys. πgpg_wrapperβ This is a template for a gpg wrapper script. The default wrapper will callgpgwith the keyring specified by optiongpg_keyringif defined.gpg_keyringβ The filename of the gpg keyring to use. Path is relative to the keyring directory. This can also be an absolute path.gpg_binβ The gpg command to be used. The default isgpg.gpg_argsβ Optional gpg arguments. The default is empty.gpg_allow_expired_keysβ Allowing expired keys to successfully verify e.g. signed git tags. By default this is not allowed. β οΈ expired keys stay expired unless you say otherwise.archβ The architecture, as returned byuname -m.versionβ Version number of the software. This is used to create the tarball, and as the package version number.distributionβ The name of the distribution for which you wish to build a package. The syntax is distribution-release. This value is used by thelsb_releaseoption.
and that's part 1, bestie β there's more coming, so don't go anywhere π
lsb_releaseβ a whole lil hash holdingid(the name of your distribution),codename, andrelease. It's giving "let me branch my template per-distro" π . By default we just use the output of thelsb_releasecommand if it's available. But if thedistributionoption is set, that one wins instead and gets used foridandreleaseβ heads up tho,codenamewill be undefined in that case. πtargetβ the target you wanna build. Usually you just set this on the command line. Seerbm_targets(7)for the details. π―targetsβ the actual targets definitions. Seerbm_targets(7). β¨copy_filesβ a list of files that should be copied when the package gets built. The path is relative to the project's template directory. πinput_filesβ configuration for external input files. Seerbm_input_files(7)for the whole situation.input_files_by_nameβ this one holds a hash of all theinput_filesfilenames, indexed by their name. Input files that have no name are not in this hash, periodt.input_files_idβ the value here is an identifier of theinput_files. Whenever any of the input files changes, this identifier changes too π¦. It's the thing you can drop into a project's filename to trigger a rebuild when any of its input files changes. It's built from: theinput_file_idoption of an input file if that's present, the filename for an input file of typeproject, the value ofexecfor an input file of typeexec, and the filename plus thesha256sumof the file for any other type of input file. And for an input file of typeexec, the value ofexecgets computed withgetting_idset totrue. iykyk π«input_files_pathsβ an array of all the paths of input files that currently exist and are used in the build of the current project and its dependencies. Super useful when you're cleaning out old build files and need to know which ones are still in use. π§Ήlink_input_filesβ when a project builds, the input files get collected in a temporary directory. If you set this to1, we try to use hard links instead of copies. β οΈ Only turn this on if you're not modifying the input files during the build, or if you're usingremote_exec(in which case that temporary directory is only used to copy files over to the remote anyway). It's disabled by default, unlessremote_execis in play.timestampβ the UNIX timestamp that gets set as the modification time on files we create, like the sources tarball. Default is the commit time of the commit being used. If you set it to0, it uses the current time instead. β°notmplβ an array listing options that should not be processed as template (peep the template section below for the tea).stepβ the name of the build script we're about to run (default isbuild, but you could have another one for publishing your build, or for different types of packaging). Read only, bestie β do not touch. π If you want to change it, use the--stepcommand line option, or thepkg_typeoption.stepsβ the steps definitions. Seerbm_steps(7). πbuildβ this is the content of the build script used by thebuildcommand. The default is to include the template file namedbuild.remote_execβ run the build on a remote host. Seerbm_remote(7)for details. πsuexecβ this one takes thesuexec_cmdoptions and makes it run as root. By default it usessudofor that. You only need to set this option if you want some other mechanism to run commands as root. πdebugβ enables or disables debug mode. When it's on, a shell gets opened in the temporary build directory if the build fails. π Very "come look at what went wrong with me" energy.abbrevβ returns the abbreviated commit hash of thegit_hashorhg_hashcommit.abbrev_lengthβ sets the length of those abbreviated commits, when you're using theabbrevoption. πisattyβ true when stdout is connected to a tty. cute lil vibe check.tarβ use this instead oftarin build scripts when you want deterministic tar files. It sets the tar arguments so that owner and group of files are set toroot, andmtimeis set totimestamp. It takes atar_srcargument, which is an array of source files or directories, and atar_argsargument, which is the tar arguments used to create the file (something like-cf filename.tar). By default GNU options are used intarandfind, but you can turn that off withgnu_utils. πzipβ use this instead ofzipin build scripts when you want deterministic zip files. It takes azip_srcargument (an array of source files or directories) and azip_argsargument (usually the destination zip file, optionally plus other zip options). By default GNU options are used infind, but again,gnu_utilsturns that off. Thezipcommand creates the zip file β unlessuse_7zis set, in which case7ztakes over instead. In that case,7z_binlets you pick the 7z command (for when it's7zzinstead of7z) and7z_optslets you set extra options for the 7z command. ποΈβ¨install_packageβ use this in a script when you need to install a package. The packages to install go in thepkg_nameoption. It usesapt-geton Debian/Ubuntu,yumon Fedora,zypperon openSUSE, andurpmion Mageia/Mandriva. it knows every distro fr fr π«Άnum_procsβ lets you specify how many CPUs get used to parallelize the build. By default it's whatever valuenrpocreturns on the build machine. π₯οΈtouchβ use this to set themtimeof files totimestamp. It expects the file to touch as an argument following on the same line.
And here's the fun part: on top of all the config options listed here, you are totally free to add any other options you want and use them in the template files. π¦ The trade-off? You also won't get an error message if you typo an option name. π So like... spell carefully, bestie.
β¨ WRITTING CONFIGURATION IN PERL β¨
So the configuration is YAML, but plot twist β you can also use perl syntax to set some of those config options. π A YAML file can hold multiple documents, separated by a line with three dashes (---). When rbm reads a config file, it reads all the documents in that file, and for each one it will:
- if the document is a hash, use it as configuration
- if the document is a string, evaluate it as perl, and take the return value as a hash containing configuration
If multiple documents define the same options, the value from the last one overrides the values from the previous documents. last one wins, no cap π
A configuration file that includes perl code looks like this:
option_1: value 1
option_2: value 2
option_3: value 3
--- |
(
option_4 => "value 4",
option_5 => "value 5",
)
In this example, option_4 and option_5 are defined using perl syntax. And note β the perl code block needs to be indented with at least one space. π
An interesting little benefit of writing options in perl is that you can define options using a perl function reference. If the value of an option is a function reference, then when that option gets looked up, the function will be executed, and the value of the option becomes the return value of that function. The function receives as parameters the project's name, an options array reference, and the option that is queried. π§
An option defined with a perl function looks like this:
option_1: value 1
--- |
(
option_2 => "value 2",
option_3 => sub {
my ($project, @option) = @_;
return "value 3";
},
)
πΈ SEE ALSO πΈ
rbm(1), rbm_targets(7), rbm_templates(7), rbm_modules(7)
That's the whole page, bestie!! π This was RBM_CONFIG(7) and the version/date stamp on it was 07/25/2025 β go build something iconic with it. πβ¨
π¦ where this page comes from
- fedora 43: rbm 0.4^20241205gitc6a4095-3.fc43 Β· CC0-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms