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 command line options are not
65           forwarded. The name of the current project is available to that
66           other project in the origin_project option, and the current step in
67           the origin_step option.
68
69       pkg_type
70           When the input file is an other project, this option can be used to
71           select a different type of build (which we call a step). This is
72           equivalent to the --step command line option. The previous step is
73           available in the origin_step option.
74
75       target
76           An array defining the build targets for the selected project. If
77           this option is not set, the current build target is forwarded. If
78           set, this replaces the current targets.
79
80       target_append
81           The same as target, but instead of replacing the current targets,
82           the new targets are appended.
83
84       target_prepend
85           The same as target, but instead of replacing the current targets,
86           the new targets are prepended.
87
88       target_replace
89           A hash table containing targets to replace. The key is a regular
90           expression, and the value the replacement. See perlre manual page
91           for details about the syntax. Note that referencing capture groups
92           in the replacement is currently not supported.
93
94       enable
95           The files are enabled by default. If this option is set to 0, then
96           the file is ignored.
97
98       refresh_input
99           By default, if the file is already present, it is not downloaded or
100           created again, except when an sha256sum is defined and the file
101           present is not matching. If this option is set to a true value, the
102           file will be removed and created again on each run, except when an
103           sha256sum is defined and the file present is matching.
104
105       sha256sum
106           The sha256 checksum of the file. The build will fail with an error
107           if the file does not match the expected sha256 checksum.
108
109       file_gpg_id
110           If this option is set to 1, the file is checked for a gpg
111           signature. If it is set to an other non zero value, or an array of
112           non zero values, those are expected to be the valid gpg key IDs.
113           The gpg_wrapper, gpg_keyring, gpg_bin, gpg_args options can be used
114           to configure the gpg check. Those options can be overriden in the
115           file descriptor.
116
117       sig_ext
118           An array of file extensions for the gpg signature file. Those
119           extensions are used to find the signature file when file_gpg_id is
120           set. If the signature file is missing but an URL is set, the
121           extension is appended to the URL to try to download it. The default
122           value for sig_ext is gpg, asc, sig. The sig_ext can also be set to
123           a single value.
124
125       urlget
126           A command or script to be used to download files from an URL. It
127           should use filename as the output filename, and URL as the source
128           URL. The default is to use wget.
129
130       output_dir
131           By default, the files are searched in the project’s directory, and
132           its output directory. The generated files are stored in the
133           project’s output directory. If you want to store and search a file
134           in a different directory, you can set the output_dir option to a
135           different value.
136
137       All those options are templates, and can use other options defined
138       inside or outside the file descriptor. Their default values can be
139       defined outside the file descriptor.
140
141       Those options can also be defined per target, or per distribution.
142
143       Instead of a file descriptor hash, an element of the input_files array
144       can be a string. In that case the string is the name of the option
145       containing the file descriptor hash. This can be useful when you are
146       using the same file in multiple projects.
147

INHERITANCE OF PROJECTS OPTIONS

149       When defining a file of type project, the options defined in the
150       input_files entry are transmitted to the child project. If this project
151       is also using other projects in its input_files then the options from
152       the first input_files entry are inherited.
153
154       In this example, both project B and C are getting the definition of
155       option1:
156
157           projects/A/config:
158             input_files:
159               - project: B
160                 option1: value1
161
162           projects/B/config:
163             input_files:
164               - project: C
165
166           projects/C/config:
167             input_files: []
168
169       In some cases you might want to define options that only apply to the
170       first level of child projects. To do that you can define the options
171       under norec. In this example, only project B is getting the definition
172       of option1:
173
174           projects/A/config:
175             input_files:
176               - project: B
177                 norec:
178                   option1: value1
179
180           projects/B/config:
181             input_files:
182               - project: C
183
184           projects/C/config:
185             input_files: []
186

EXAMPLES

188       In the following example we define the input_files configuration for
189       the project bundle. This project has two different targets, dev and
190       stable, and is using input files from different sources :
191
192       •   The project A tarball is downloaded from an URL with an known
193           sha256sum.
194
195       •   The project B tarball is downloaded from an URL which is different
196           depending on the target. The sha256sum is also different depending
197           on the target.
198
199       •   The project C tarball is downloaded from an URL, and checked using
200           a gpg signature.
201
202       •   The project D tarball is built using rbm. The git_hash used to
203           build it is different depending on the target. The git tag gpg
204           signature is checked only in the stable target.
205
206           input_files:
207            - filename: project-A.tar.gz
208              URL: http://www.project-a.org/project.tar.gz
209              sha256sum: 93c4fb2f3d377f41001fe1cf3c806dc9fc926a53dbbf4302838d7ee7c9f17315
210            - filename: 'project-B-[% c('project_b_version') %].tar.gz'
211              URL: 'http://www.project-b.org/project-b-[% c('project_b_version') %].tar.gz'
212              targets:
213                dev:
214                  project_b_version: 0.12
215                  sha256sum: 5f0ac48598c0a7948bb7da626b0599f121c1365ec53b111b5ba9e9330410fc44
216                stable:
217                  project_b_version: 0.10
218                  sha256sum: f0f81fbc84992c21bbbcb301c1185ce3d1772f150f57d37530cc9e4b0249a630
219            - filename: project-c.tar.gz
220              URL: http://www.project-c.org/release-0.1.tar.gz
221              file_gpg_id: 1
222              gpg_keyring: project-c.gpg
223              sig_ext: sig
224            - filename: project-D.tar.gz
225              project: project_d
226              pkg_type: build
227              targets:
228                dev:
229                  git_hash: master
230                stable:
231                  git_hash: 2.1
232                  tag_gpg_id: 1
233

SEE ALSO

235       rbm(1), rbm_config(7)
236
237
238
239                                  07/28/2023                RBM_INPUT_FILES(7)
Impressum