1RBM_INPUT_FILES(7) RBM_INPUT_FILES(7)
2
3
4
6 rbm_input_files - rbm input files configuration
7
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
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 enable
89 The files are enabled by default. If this option is set to 0, then
90 the file is ignored.
91
92 refresh_input
93 By default, if the file is already present, it is not downloaded or
94 created again, except when an sha256sum is defined and the file
95 present is not matching. If this option is set to a true value, the
96 file will be removed and created again on each run, except when an
97 sha256sum is defined and the file present is matching.
98
99 sha256sum
100 The sha256 checksum of the file. The build will fail with an error
101 if the file does not match the expected sha256 checksum.
102
103 file_gpg_id
104 If this option is set to 1, the file is checked for a gpg
105 signature. If it is set to an other non zero value, or an array of
106 non zero values, those are expected to be the valid gpg key IDs.
107 The gpg_wrapper, gpg_keyring, gpg_bin, gpg_args options can be used
108 to configure the gpg check. Those options can be overriden in the
109 file descriptor.
110
111 sig_ext
112 An array of file extensions for the gpg signature file. Those
113 extensions are used to find the signature file when file_gpg_id is
114 set. If the signature file is missing but an URL is set, the
115 extension is appended to the URL to try to download it. The default
116 value for sig_ext is gpg, asc, sig. The sig_ext can also be set to
117 a single value.
118
119 urlget
120 A command or script to be used to download files from an URL. It
121 should use filename as the output filename, and URL as the source
122 URL. The default is to use wget.
123
124 output_dir
125 By default, the files are searched in the project’s directory, and
126 its output directory. The generated files are stored in the
127 project’s output directory. If you want to store and search a file
128 in a different directory, you can set the output_dir option to a
129 different value.
130
131 All those options are templates, and can use other options defined
132 inside or outside the file descriptor. Their default values can be
133 defined outside the file descriptor.
134
135 Those options can also be defined per target, or per distribution.
136
137 Instead of a file descriptor hash, an element of the input_files array
138 can be a string. In that case the string is the name of the option
139 containing the file descriptor hash. This can be useful when you are
140 using the same file in multiple projects.
141
143 When defining a file of type project, the options defined in the
144 input_files entry are transmitted to the child project. If this project
145 is also using other projects in its input_files then the options from
146 the first input_files entry are inherited.
147
148 In this example, both project B and C are getting the definition of
149 option1:
150
151 projects/A/config:
152 input_files:
153 - project: B
154 option1: value1
155
156 projects/B/config:
157 input_files:
158 - project: C
159
160 projects/C/config:
161 input_files: []
162
163 In some cases you might want to define options that only apply to the
164 first level of child projects. To do that you can define the options
165 under norec. In this example, only project B is getting the definition
166 of option1:
167
168 projects/A/config:
169 input_files:
170 - project: B
171 norec:
172 option1: value1
173
174 projects/B/config:
175 input_files:
176 - project: C
177
178 projects/C/config:
179 input_files: []
180
182 In the following example we define the input_files configuration for
183 the project bundle. This project has two different targets, dev and
184 stable, and is using input files from different sources :
185
186 • The project A tarball is downloaded from an URL with an known
187 sha256sum.
188
189 • The project B tarball is downloaded from an URL which is different
190 depending on the target. The sha256sum is also different depending
191 on the target.
192
193 • The project C tarball is downloaded from an URL, and checked using
194 a gpg signature.
195
196 • The project D tarball is built using rbm. The git_hash used to
197 build it is different depending on the target. The git tag gpg
198 signature is checked only in the stable target.
199
200 input_files:
201 - filename: project-A.tar.gz
202 URL: http://www.project-a.org/project.tar.gz
203 sha256sum: 93c4fb2f3d377f41001fe1cf3c806dc9fc926a53dbbf4302838d7ee7c9f17315
204 - filename: 'project-B-[% c('project_b_version') %].tar.gz'
205 URL: 'http://www.project-b.org/project-b-[% c('project_b_version') %].tar.gz'
206 targets:
207 dev:
208 project_b_version: 0.12
209 sha256sum: 5f0ac48598c0a7948bb7da626b0599f121c1365ec53b111b5ba9e9330410fc44
210 stable:
211 project_b_version: 0.10
212 sha256sum: f0f81fbc84992c21bbbcb301c1185ce3d1772f150f57d37530cc9e4b0249a630
213 - filename: project-c.tar.gz
214 URL: http://www.project-c.org/release-0.1.tar.gz
215 file_gpg_id: 1
216 gpg_keyring: project-c.gpg
217 sig_ext: sig
218 - filename: project-D.tar.gz
219 project: project_d
220 pkg_type: build
221 targets:
222 dev:
223 git_hash: master
224 stable:
225 git_hash: 2.1
226 tag_gpg_id: 1
227
229 rbm(1), rbm_config(7)
230
231
232
233 07/25/2022 RBM_INPUT_FILES(7)