{
    "content": [
        {
            "type": "text",
            "text": "# deb-substvars (man)\n\n## NAME\n\ndeb-substvars - Debian source substitution variables\n\n## SYNOPSIS\n\ndebian/substvars, debian/binary-package.substvars\n\n## DESCRIPTION\n\nBefore 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\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (14 subsections)\n- **FILES** (1 subsections)\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "deb-substvars",
        "section": "",
        "mode": "man",
        "summary": "deb-substvars - Debian source substitution variables",
        "synopsis": "debian/substvars, debian/binary-package.substvars",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "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": "source",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/source/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 44,
                "subsections": [
                    {
                        "name": "Arch",
                        "lines": 3
                    },
                    {
                        "name": "vendor:Name",
                        "lines": 3
                    },
                    {
                        "name": "vendor:Id",
                        "lines": 3
                    },
                    {
                        "name": "source:Version",
                        "lines": 2
                    },
                    {
                        "name": "source:Upstream-Version",
                        "lines": 3
                    },
                    {
                        "name": "binary:Version",
                        "lines": 3
                    },
                    {
                        "name": "Source-Version",
                        "lines": 4
                    },
                    {
                        "name": "source:Synopsis",
                        "lines": 3
                    },
                    {
                        "name": "source:Extended-Description",
                        "lines": 3
                    },
                    {
                        "name": "Installed-Size",
                        "lines": 12
                    },
                    {
                        "name": "Extra-Size",
                        "lines": 15
                    },
                    {
                        "name": "Format",
                        "lines": 10
                    },
                    {
                        "name": "dpkg:Upstream-Version",
                        "lines": 2
                    },
                    {
                        "name": "dpkg:Version",
                        "lines": 5
                    }
                ]
            },
            {
                "name": "FILES",
                "lines": 1,
                "subsections": [
                    {
                        "name": "debian/substvars",
                        "lines": 2
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 6,
                "subsections": []
            }
        ],
        "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 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\nA 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\nAfter all the substitutions have been done each occurrence of the string ${} (which is not a\nlegal substitution) is replaced with a $ sign.  This can be used as an escape sequence such\nas ${}{VARIABLE} which will end up as ${VARIABLE} on the output.\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\nVariables 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 option). This file\nconsists of lines of the form name=value.  Trailing whitespace on each line, blank lines, and\nlines starting with a # symbol (comments) are ignored.\n\nAdditionally, the following standard variables are available:\n",
                "subsections": [
                    {
                        "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:fieldname\nThe value of the source stanza field fieldname (which must be given in the canonical\ncapitalisation; 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:fieldname\nThe value of the output field fieldname (which must be given in the canonical\ncapitalisation). 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\nIf a variable is referred to but not defined it generates a warning and an empty value is\nassumed.\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), dpkg-\nsource(1).\n\n\n\n1.21.1                                       2025-09-09                             deb-substvars(5)",
                "subsections": []
            }
        }
    }
}