{
    "mode": "man",
    "parameter": "deb-substvars",
    "section": "5",
    "url": "https://www.chedong.com/phpMan.php/man/deb-substvars/5/json",
    "generated": "2026-08-31T22:28:07Z",
    "synopsis": "debian/substvars, debian/binary-package.substvars, variables",
    "sections": {
        "NAME": {
            "content": "deb-substvars - Debian source substitution variables\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "debian/substvars, debian/binary-package.substvars, variables\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Before dpkg-source, dpkg-gencontrol and dpkg-genchanges write their control information (to\nthe source control file .dsc for dpkg-source and to standard output for dpkg-gencontrol and\ndpkg-genchanges) they perform some variable substitutions on the output file.\n",
            "subsections": [
                {
                    "name": "Variable Syntax",
                    "content": "A variable substitution has the form ${variable-name}.  Variable names consist of\nalphanumerics (a-zA-Z0-9), hyphens (-) and colons (:) and start with an alphanumeric, and are\ncase-sensitive, even though they might refer to other entities which are case-preserving.\nVariable substitutions are performed repeatedly until none are left; the full text of the\nfield after the substitution is rescanned to look for more substitutions.\n"
                },
                {
                    "name": "File Syntax",
                    "content": "Substitution variables can be specified in a file.  These files consist of lines of the form\nname=value or name?=value.  The = operator assigns a normal substitution variable, while the\n?= operator (since dpkg 1.21.8) assigns an optional substitution variable which will emit no\nwarnings even if unused.  Trailing whitespace on each line, blank lines, and lines starting\nwith a # symbol (comments) are ignored.\n"
                },
                {
                    "name": "Substitution",
                    "content": "Variables can be set using the -V common option.  They can be also specified in the file\ndebian/substvars (or whatever other file is specified using the -T common option).\n\nAfter all the substitutions have been done each occurrence of the string ${} (which is not an\nactual substitution variable) is replaced with a $ sign.  This can be used as an escape\nsequence such as ${}{VARIABLE} which will end up as ${VARIABLE} on the output.\n\nIf a variable is referred to but not defined it generates a warning and an empty value is\nassumed.\n\nWhile variable substitution is done on all control fields, some of those fields are used and\nneeded during the build when the substitution did not yet occur.  That's why you can't use\nvariables in the Package, Source and Architecture fields.\n\nVariable substitution happens on the content of the fields after they have been parsed, thus\nif you want a variable to expand over multiple lines you do not have to include a space after\nthe newline.  This is done implicitly when the field is output.  For example, if the variable\n${Description} is set to \"foo is bar.${Newline}foo is great.\" and if you have the following\nfield:\n\nDescription: foo application\n${Description}\n.\nMore text.\n\nIt will result in:\n\nDescription: foo application\nfoo is bar.\nfoo is great.\n.\nMore text.\n"
                },
                {
                    "name": "Built-in Variable",
                    "content": "Additionally, the following standard variables are always available:\n"
                },
                {
                    "name": "Arch",
                    "content": "The  current host architecture (i.e. the architecture the package is being built for, the\nequivalent of DEBHOSTARCH).\n"
                },
                {
                    "name": "vendor:Name",
                    "content": "The current vendor name (since dpkg 1.20.0).  This value comes from the Vendor field  for\nthe current vendor's origin file, as dpkg-vendor(1) would retrieve it.\n"
                },
                {
                    "name": "vendor:Id",
                    "content": "The  current  vendor  ID  (since  dpkg  1.20.0).   This  is just the lowercase variant of\nvendor:Name.\n"
                },
                {
                    "name": "source:Version",
                    "content": "The source package version (since dpkg 1.13.19).\n"
                },
                {
                    "name": "source:Upstream-Version",
                    "content": "The upstream source package version, including the Debian version  epoch  if  any  (since\ndpkg 1.13.19).\n"
                },
                {
                    "name": "binary:Version",
                    "content": "The binary package version (which may differ from source:Version in a binNMU for example;\nsince dpkg 1.13.19).\n"
                },
                {
                    "name": "Source-Version",
                    "content": "The  source package version (from the changelog file).  This variable is now obsolete and\nemits an error when used as its meaning is different from its function,  please  use  the\nsource:Version or binary:Version as appropriate.\n"
                },
                {
                    "name": "source:Synopsis",
                    "content": "The  source  package  synopsis, extracted from the source stanza Description field, if it\nexists (since dpkg 1.19.0).\n"
                },
                {
                    "name": "source:Extended-Description",
                    "content": "The source package extended description, extracted from  the  source  stanza  Description\nfield, if it exists (since dpkg 1.19.0).\n"
                },
                {
                    "name": "Installed-Size",
                    "content": "The  approximate  total size of the package's installed files.  This value is copied into\nthe corresponding control file field; setting it will modify the value of that field.  If\nthis variable is not set dpkg-gencontrol will compute the default value  by  accumulating\nthe  size of each regular file and symlink rounded to 1 KiB used units, and a baseline of\n1 KiB for any other filesystem object type.  With hardlinks only being counted once as  a\nregular file.\n\nNote:  Take  into account that this can only ever be an approximation, as the actual size\nused on the installed  system  will  depend  greatly  on  the  filesystem  used  and  its\nparameters, which might end up using either more or less space than the specified in this\nfield.\n"
                },
                {
                    "name": "Extra-Size",
                    "content": "Additional  disk  space  used when the package is installed.  If this variable is set its\nvalue is added to that of the Installed-Size variable (whether set  explicitly  or  using\nthe default value) before it is copied into the Installed-Size control file field.\n\nS:field-name\nThe  value  of  the  source stanza field field-name (which must be given in the canonical\ncapitalization; since dpkg 1.18.11).  Setting these variables has no effect other than on\nplaces where they are expanded explicitly.   These  variables  are  only  available  when\ngenerating binary control files.\n\nF:field-name\nThe  value  of  the  output  field  field-name  (which  must  be  given  in the canonical\ncapitalization).  Setting these variables has no effect other than on places  where  they\nare expanded explicitly.\n"
                },
                {
                    "name": "Format",
                    "content": "The  .changes  file  format  version  generated  by  this version of the source packaging\nscripts.  If you set this variable the contents of the Format field in the .changes  file\nwill change too.\n\nNewline, Space, Tab\nThese variables each hold the corresponding character.\n\nshlibs:dependencyfield\nVariable settings with names of this form are generated by dpkg-shlibdeps.\n"
                },
                {
                    "name": "dpkg:Upstream-Version",
                    "content": "The upstream version of dpkg (since dpkg 1.13.19).\n"
                },
                {
                    "name": "dpkg:Version",
                    "content": "The full version of dpkg (since dpkg 1.13.19).\n"
                }
            ]
        },
        "FILES": {
            "content": "",
            "subsections": [
                {
                    "name": "debian/substvars",
                    "content": "List of substitution variables and values.\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "dpkg(1),    dpkg-vendor(1),    dpkg-genchanges(1),   dpkg-gencontrol(1),   dpkg-shlibdeps(1),\ndpkg-source(1).\n\n1.22.6                                       2026-05-06                             deb-substvars(5)",
            "subsections": []
        }
    },
    "summary": "deb-substvars - Debian source substitution variables",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "dpkg",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/dpkg/1/json"
        },
        {
            "name": "dpkg-vendor",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/dpkg-vendor/1/json"
        },
        {
            "name": "dpkg-genchanges",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/dpkg-genchanges/1/json"
        },
        {
            "name": "dpkg-gencontrol",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/dpkg-gencontrol/1/json"
        },
        {
            "name": "dpkg-shlibdeps",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/dpkg-shlibdeps/1/json"
        },
        {
            "name": "dpkg-source",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/dpkg-source/1/json"
        }
    ]
}