RBM_INPUT_FILES(7)

πŸ“¦
version 0.4^20241205gitc6a4095 Β· 2 versions
, in fedora 43

πŸ’– RBM_INPUT_FILES(7) πŸ’–

okay bestie, welcome to the rbm_input_files manual page (section 7 of the rbm manual, yes we're fancy). this is the page about configuring input files, and i promise it's more fun than it sounds 🫢


🌸 NAME 🌸

rbm_input_files β€” rbm input files configuration ✨


πŸŽ€ DESCRIPTION πŸŽ€

so when you build a project with rbm, the input can be a git or mercurial repository β€” rbm makes a tarball out of it and that tarball becomes the input for your build. but here's the tea: on top of that repo, or literally instead of it, you can pull files in from other places and use those as input files too πŸ’…

the input sources you can use are:

  • a URL that gets used to download the file
  • a file that's the output of a command
  • the value of a config value
  • the result of building another project πŸ‘‘

and once a file has been retrieved, you can verify it by:

  • matching a specific sha256 or sha512 checksum
  • a gpg signature file from a specific key or keyring πŸ”

the input files can live in the output directory (that's the case when it's the result of another project's build), or in the project's directory. either way, we're covered πŸ’–


✨ CONFIGURATION ✨

the whole vibe gets configured in the input_files configuration option. this option is an array of file descriptors, and each file descriptor is a hash that can contain some of these options:

  • filename β€” the name of the file that will be fetched. except when an URL or a project is set, this filename is mandatory. if it's not set when an URL is set, the basename of the URL is used as the filename. if it's not set when a project is set, the project's filename option is used. also, the filename can be the name of a directory, in which case all the files from that directory get included πŸ—‚οΈ
  • name β€” optionally your input_file can have a name. this name is used as key in the input_files_by_name option.
  • content β€” the content of the file.
  • URL β€” the URL to download the file from 🌈
  • exec β€” a command or script to execute to produce the file.
  • project β€” the name of another project to build, to create the file. the content of the file descriptor is used as options for the build of that project. you can add config options like version, git_hash or target to configure the build. the command line options are not forwarded. the name of the current project is available to that other project in the origin_project option, and the current step is available in the origin_step option.
  • pkg_type β€” when the input file is another project, this option lets you pick a different type of build (which we call a step). this is equivalent to the --step command line option. the previous step is available in the origin_step option.
  • target β€” an array defining the build targets for the selected project. if this option isn't set, the current build target is forwarded. if it is set, it replaces the current targets.
  • target_append β€” same as target, but instead of replacing the current targets, the new targets get appended. βž•
  • target_prepend β€” same as target, but instead of replacing the current targets, the new targets get prepended. πŸ₯‡
  • target_replace β€” a hash table containing targets to replace. the key is a regular expression, and the value is the replacement. see the perlre manual page for details about the syntax. note that referencing capture groups in the replacement is currently not supported.
  • enable β€” the files are enabled by default. if this option is set to 0, then the file is ignored. 🚫
  • refresh_input β€” by default, if the file is already present, it is not downloaded or created again, except when an sha256sum or sha512sum is defined and the file present is not matching. if this option is set to a true value, the file will be removed and created again on each run, except when an sha256sum or sha512sum is defined and the file present is matching. πŸ”
  • sha256sum β€” the sha256 checksum of the file. the build will fail with an error if the file does not match the expected sha256 checksum. if the value is empty, the checksum is not checked.
  • sha512sum β€” the sha512 checksum of the file. the build will fail with an error if the file does not match the expected sha512 checksum. if the value is empty, the checksum is not checked.
  • file_gpg_id β€” if this option is set to 1, the file is checked for a gpg signature. if it's set to another non zero value, or an array of non zero values, those are expected to be the valid gpg key IDs. the gpg_wrapper, gpg_keyring, gpg_bin, gpg_args options can be used to configure the gpg check. those options can be overridden in the file descriptor.
  • sig_ext β€” an array of file extensions for the gpg signature file. those extensions are used to find the signature file when file_gpg_id is set. if the signature file is missing but an URL is set, the extension is appended to the URL to try to download it. the default value for sig_ext is gpg, asc, sig. the sig_ext can also be set to a single value.
  • urlget β€” a command or script to be used to download files from an URL. it should use filename as the output filename, and URL as the source URL. the default is to use wget.
  • output_dir β€” by default, the files are searched in the project's directory, and its output directory. the generated files are stored in the project's output directory. if you want to store and search a file in a different directory, you can set the output_dir option to a different value. πŸ“

all of those options are templates, and can use other options defined inside or outside the file descriptor. their default values can be defined outside the file descriptor too.

those options can also be defined per target, or per distribution. no cap.

and here's a cute lil plot twist: instead of a file descriptor hash, an element of the input_files array can be a string. in that case the string is the name of the option containing the file descriptor hash. super useful when you're reusing the same file across multiple projects πŸ’…βœ¨


πŸ¦‹ INHERITANCE OF PROJECTS OPTIONS πŸ¦‹

when you define a file of type project, the options defined in the input_files entry get transmitted to the child project. and if that project is also using other projects in its input_files, then the options from the first input_files entry are inherited. it's giving family tree 🌳

in this example, both project B and C are getting the definition of option1:

projects/A/config:
  input_files:
    - project: B
      option1: value1

projects/B/config:
  input_files:
    - project: C

projects/C/config:
  input_files: []

sometimes though, you only want options to apply to the first level of child projects. to do that, you define the options under norec. in this example, only project B is getting the definition of option1:

projects/A/config:
  input_files:
    - project: B
      norec:
        option1: value1

projects/B/config:
  input_files:
    - project: C

projects/C/config:
  input_files: []

🌈 EXAMPLES 🌈

in the following example we define the input_files configuration for the project bundle. this project has two different targets, dev and stable, and it's using input files from different sources:

  • the project A tarball is downloaded from an URL with a known sha256sum.
  • the project B tarball is downloaded from an URL which is different depending on the target. the sha256sum is also different depending on the target.
  • the project C tarball is downloaded from an URL, and checked using a gpg signature. πŸ”
  • the project D tarball is built using rbm. the git_hash used to build it is different depending on the target. the git tag gpg signature is checked only in the stable target.
input_files:
 - filename: project-A.tar.gz
   URL: http://www.project-a.org/project.tar.gz
   sha256sum: 93c4fb2f3d377f41001fe1cf3c806dc9fc926a53dbbf4302838d7ee7c9f17315
 - filename: 'project-B-[% c('project_b_version') %].tar.gz'
   URL: 'http://www.project-b.org/project-b-[% c('project_b_version') %].tar.gz'
   targets:
     dev:
       project_b_version: 0.12
       sha256sum: 5f0ac48598c0a7948bb7da626b0599f121c1365ec53b111b5ba9e9330410fc44
     stable:
       project_b_version: 0.10
       sha256sum: f0f81fbc84992c21bbbcb301c1185ce3d1772f150f57d37530cc9e4b0249a630
 - filename: project-c.tar.gz
   URL: http://www.project-c.org/release-0.1.tar.gz
   file_gpg_id: 1
   gpg_keyring: project-c.gpg
   sig_ext: sig
 - filename: project-D.tar.gz
   project: project_d
   pkg_type: build
   targets:
     dev:
       git_hash: master
     stable:
       git_hash: 2.1
       tag_gpg_id: 1

πŸ‘€ SEE ALSO πŸ‘€

rbm(1), rbm_config(7)


and that's the whole page bestie πŸ’– this one is from the rbm man pages, dated 07/25/2025, and honestly? iconic. go configure your input files, you've got this πŸ‘‘βœ¨πŸŽ€

πŸ“¦ where this page comes from