wpkg --field-variables | -V ...

Short Hand

wpkg -V

The --field-variables option is used to dynamically add field variables to the control file of a package being built.

The syntax is: variable name, equal sign (=), and the value of the variable optionally written between single (') or double (") quotes. The option accepts any number of variable definitions up to the next command, the next option or the end of the command line.

The following example sets FOO to the string "this is my special value" and sets BAR to the value 123:

wpkg --field-variables FOO="this is my special field" BAR=123 ...

Then you can reference those variables from your control files as this:

X-My-Field: ${FOO}-${BAR}

It is customary to add an X- in front of user defined field names, although it is not mandatory, it is recommended to avoid clashes with fields defined by wpkg. Further more, you may want to add the name of your organization as in:

X-m2osw-Support: https://www.m2osw.com/contact

Such fields are not validated by wpkg (it wouldn't know how to.) You may validate them using the --build, --field or --verify commands with the --verify-fields option.

Other variables can be defined in the substvars file.

For pkg-config support, we accept the --define-variable option as an alias of the --field-variables option.

IMPORTANT NOTE

The Debian behavior with field names is different from the wpkg behavior. The wpkg tool never changes the name of a field. Debian will remove the X[BCS]*- prefix. The B letter means that this field is for Binary packages only. The C letter means Change Logs control files (the .changes files) which wpkg doesn't support at all at this point. The S letter means Source packages only. (see Debian Policy Manual - Control Files and Their Fields)