{
    "mode": "info",
    "parameter": "deb-substvars",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/deb-substvars/json",
    "generated": "2026-07-09T15:22:19Z",
    "synopsis": "debian/substvars, debian/binary-package.substvars",
    "sections": {
        "NAME": {
            "content": "deb-substvars - Debian source substitution variables\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "debian/substvars, debian/binary-package.substvars\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Before dpkg-source, dpkg-gencontrol and dpkg-genchanges write their\ncontrol information (to the source control file .dsc for dpkg-source\nand to standard output for dpkg-gencontrol and dpkg-genchanges) they\nperform some variable substitutions on the output file.\n\nA variable substitution has the form ${variable-name}.  Variable names\nconsist of alphanumerics (a-zA-Z0-9), hyphens (-) and colons (:) and\nstart with an alphanumeric, and are case-sensitive, even though they\nmight refer to other entities which are case-preserving.  Variable\nsubstitutions are performed repeatedly until none are left; the full\ntext of the field after the substitution is rescanned to look for more\nsubstitutions.\n\nAfter all the substitutions have been done each occurrence of the\nstring ${} (which is not a legal substitution) is replaced with a $\nsign.  This can be used as an escape sequence such as ${}{VARIABLE}\nwhich will end up as ${VARIABLE} on the output.\n\nWhile variable substitution is done on all control fields, some of\nthose fields are used and needed during the build when the substitution\ndid not yet occur. That's why you can't use variables in the Package,\nSource and Architecture fields.\n\nVariable substitution happens on the content of the fields after they\nhave been parsed, thus if you want a variable to expand over multiple\nlines you do not have to include a space after the newline. This is\ndone 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\nyou have the following field:\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\nVariables can be set using the -V common option. They can be also\nspecified in the file debian/substvars (or whatever other file is\nspecified using the -T option). This file consists of lines of the form\nname=value.  Trailing whitespace on each line, blank lines, and lines\nstarting with a # symbol (comments) are ignored.\n\nAdditionally, the following standard variables are available:\n\nArch\nThe current host architecture (i.e. the architecture the package is\nbeing built for, the equivalent of DEBHOSTARCH).\n\nvendor:Name\nThe current vendor name (since dpkg 1.20.0).  This value comes from\nthe Vendor field for the current vendor's origin file, as dpkg-\nvendor(1) would retrieve it.\n\nvendor:Id\nThe current vendor ID (since dpkg 1.20.0).  This is just the\nlowercase variant of vendor:Name.\n\nsource:Version\nThe source package version (since dpkg 1.13.19).\n\nsource:Upstream-Version\nThe upstream source package version, including the Debian version\nepoch if any (since dpkg 1.13.19).\n\nbinary:Version\nThe binary package version (which may differ from source:Version in\na binNMU for example; since dpkg 1.13.19).\n\nSource-Version\nThe source package version (from the changelog file). This variable\nis now obsolete and emits an error when used as its meaning is\ndifferent from its function, please use the source:Version or\nbinary:Version as appropriate.\n\nsource:Synopsis\nThe source package synopsis, extracted from the source stanza\nDescription field, if it exists (since dpkg 1.19.0).\n\nsource:Extended-Description\nThe source package extended description, extracted from the source\nstanza Description field, if it exists (since dpkg 1.19.0).\n\nInstalled-Size\nThe approximate total size of the package's installed files. This\nvalue is copied into the corresponding control file field; setting\nit will modify the value of that field. If this variable is not set\ndpkg-gencontrol will compute the default value by accumulating the\nsize of each regular file and symlink rounded to 1 KiB used units,\nand a baseline of 1 KiB for any other filesystem object type.  With\nhardlinks only being counted once as a regular file.\n\nNote: Take into account that this can only ever be an\napproximation, as the actual size used on the installed system will\ndepend greatly on the filesystem used and its parameters, which\nmight end up using either more or less space than the specified in\nthis field.\n\nExtra-Size\nAdditional disk space used when the package is installed. If this\nvariable is set its value is added to that of the Installed-Size\nvariable (whether set explicitly or using the default value) before\nit is copied into the Installed-Size control file field.\n\nS:fieldname\nThe value of the source stanza field fieldname (which must be given\nin the canonical capitalisation; since dpkg 1.18.11).  Setting\nthese variables has no effect other than on places where they are\nexpanded explicitly.  These variables are only available when\ngenerating binary control files.\n\nF:fieldname\nThe value of the output field fieldname (which must be given in the\ncanonical capitalisation). Setting these variables has no effect\nother than on places where they are expanded explicitly.\n\nFormat\nThe .changes file format version generated by this version of the\nsource packaging scripts. If you set this variable the contents of\nthe Format field in the .changes file will 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-\nshlibdeps.\n\ndpkg:Upstream-Version\nThe upstream version of dpkg (since dpkg 1.13.19).\n\ndpkg:Version\nThe full version of dpkg (since dpkg 1.13.19).\n\nIf a variable is referred to but not defined it generates a warning and\nan empty value is assumed.\n",
            "subsections": []
        },
        "FILES": {
            "content": "debian/substvars\nList of substitution variables and values.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "dpkg(1), dpkg-vendor(1), dpkg-genchanges(1), dpkg-gencontrol(1), dpkg-\nshlibdeps(1), dpkg-source(1).\n\n1.21.1                            2025-09-09                  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": "shlibdeps",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/shlibdeps/1/json"
        },
        {
            "name": "dpkg-source",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/dpkg-source/1/json"
        }
    ]
}