1RBM_INPUT_FILES(7)                                          RBM_INPUT_FILES(7)
2
3
4

NAME

6       rbm_input_files - rbm input files configuration
7

DESCRIPTION

9       When building a project with rbm, the input can be a git or mercurial
10       repository from which a tarball will be created and used as input for
11       your build. In addition or instead of this git or mercurial repository,
12       it is possible to retrieved files from other sources to use them as
13       input files.
14
15       The following input sources are available:
16
17       •   a URL which should be used to download the file
18
19       •   a file resulting from the output of a command
20
21       •   the value of a config value
22
23       •   the result of the build of an other project
24
25       The file that has been retrieved can be verified with:
26
27       •   matching a specific sha256 checksum
28
29       •   a gpg signature file from a specific key or keyring
30
31       The input files can be located in the output directory (for the result
32       of an other project’s build), or in the project’s directory.
33

CONFIGURATION

35       The configuration of the input files is done in the input_files
36       configuration option. This option is an array of file descriptors. Each
37       file descriptor is an hash containing some of the following options:
38
39       filename
40           The name of the file that will be fetched. Except when an URL or a
41           project is set, this filename is mandatory. If it is not set when
42           an URL is set, the basename of the URL is used as a filename. If it
43           is not set when a project is set, the project’s filename option is
44           used. The filename can be the name of a directory, in which case
45           all the files from the directory are included.
46
47       name
48           Optionaly the input_file can have a name. This name is used as key
49           in the input_files_by_name option.
50
51       content
52           The content of the file.
53
54       URL
55           The URL from which to download the file.
56
57       exec
58           A command or script to execute to produce the file.
59
60       project
61           The name of an other project to build, to create the file. The
62           content of the file descriptor is used as options for the build of
63           this project. You can add config options such as version, git_hash
64           or target to configure the build. The build is run with an
65           equivalent of rbm pkg, so you should define the pkg_type option if
66           you want to select the type of build. The command line options are
67           not forwarded. The name of the current project is available to that
68           other project in the origin_project option.
69
70       target
71           An array defining the build targets for the selected project. If
72           this option is not set, the current build target is forwarded. If
73           set, this replaces the current targets.
74
75       target_append
76           The same as target, but instead of replacing the current targets,
77           the new targets are appended.
78
79       target_prepend
80           The same as target, but instead of replacing the current targets,
81           the new targets are prepended.
82
83       enable
84           The files are enabled by default. If this option is set to 0, then
85           the file is ignored.
86
87       refresh_input
88           By default, if the file is already present, it is not downloaded or
89           created again, except when an sha256sum is defined and the file
90           present is not matching. If this option is set to a true value, the
91           file will be removed and created again on each run, except when an
92           sha256sum is defined and the file present is matching.
93
94       sha256sum
95           The sha256 checksum of the file. The build will fail with an error
96           if the file does not match the expected sha256 checksum.
97
98       file_gpg_id
99           If this option is set to 1, the file is checked for a gpg
100           signature. If it is set to an other non zero value, or an array of
101           non zero values, those are expected to be the valid gpg key IDs.
102           The gpg_wrapper, gpg_keyring, gpg_keyring_dir, gpg_bin, gpg_args
103           options can be used to configure the gpg check. Those options can
104           be overriden in the file descriptor.
105
106       sig_ext
107           An array of file extensions for the gpg signature file. Those
108           extensions are used to find the signature file when file_gpg_id is
109           set. If the signature file is missing but an URL is set, the
110           extension is appended to the URL to try to download it. The default
111           value for sig_ext is gpg, asc, sig. The sig_ext can also be set to
112           a single value.
113
114       urlget
115           A command or script to be used to download files from an URL. It
116           should use filename as the output filename, and URL as the source
117           URL. The default is to use wget.
118
119       output_dir
120           By default, the files are searched in the project’s directory, and
121           its output directory. The generated files are stored in the
122           project’s output directory. If you want to store and search a file
123           in a different directory, you can set the output_dir option to a
124           different value.
125
126       All those options are templates, and can use other options defined
127       inside or outside the file descriptor. Their default values can be
128       defined outside the file descriptor.
129
130       Those options can also be defined per target, or per distribution.
131
132       Instead of a file descriptor hash, an element of the input_files array
133       can be a string. In that case the string is the name of the option
134       containing the file descriptor hash. This can be useful when you are
135       using the same file in multiple projects.
136

EXAMPLES

138       In the following example we define the input_files configuration for
139       the project bundle. This project has two different targets, dev and
140       stable, and is using input files from different sources :
141
142       •   The project A tarball is downloaded from an URL with an known
143           sha256sum.
144
145       •   The project B tarball is downloaded from an URL which is different
146           depending on the target. The sha256sum is also different depending
147           on the target.
148
149       •   The project C tarball is downloaded from an URL, and checked using
150           a gpg signature.
151
152       •   The project D tarball is built using rbm. The git_hash used to
153           build it is different depending on the target. The git tag gpg
154           signature is checked only in the stable target.
155
156           input_files:
157            - filename: project-A.tar.gz
158              URL: http://www.project-a.org/project.tar.gz
159              sha256sum: 93c4fb2f3d377f41001fe1cf3c806dc9fc926a53dbbf4302838d7ee7c9f17315
160            - filename: 'project-B-[% c('project_b_version') %].tar.gz'
161              URL: 'http://www.project-b.org/project-b-[% c('project_b_version') %].tar.gz'
162              targets:
163                dev:
164                  project_b_version: 0.12
165                  sha256sum: 5f0ac48598c0a7948bb7da626b0599f121c1365ec53b111b5ba9e9330410fc44
166                stable:
167                  project_b_version: 0.10
168                  sha256sum: f0f81fbc84992c21bbbcb301c1185ce3d1772f150f57d37530cc9e4b0249a630
169            - filename: project-c.tar.gz
170              URL: http://www.project-c.org/release-0.1.tar.gz
171              file_gpg_id: 1
172              gpg_keyring: project-c.gpg
173              sig_ext: sig
174            - filename: project-D.tar.gz
175              project: project_d
176              pkg_type: build
177              targets:
178                dev:
179                  git_hash: master
180                stable:
181                  git_hash: 2.1
182                  tag_gpg_id: 1
183

SEE ALSO

185       rbm(1), rbm_config(7)
186
187
188
189                                  01/27/2021                RBM_INPUT_FILES(7)
Impressum