{
    "mode": "man",
    "parameter": "mk-origtargz",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/mk-origtargz/1/json",
    "generated": "2026-09-01T14:38:34Z",
    "synopsis": "mk-origtargz [options] foo-1.0.tar.gz",
    "sections": {
        "NAME": {
            "content": "mk-origtargz - rename upstream tarball, optionally changing the compression and removing\nunwanted files\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "mk-origtargz [options] foo-1.0.tar.gz",
            "subsections": [
                {
                    "name": "mk-origtargz --help",
                    "content": ""
                }
            ]
        },
        "DESCRIPTION": {
            "content": "mk-origtargz  renames the given file to match what is expected by dpkg-buildpackage, based on\nthe source package name  and  version  in  debian/changelog.  It  can  convert  zip  to  tar,\noptionally  change  the  compression  scheme and remove files according to Files-Excluded and\nFiles-Excluded-component in debian/copyright. The resulting file is placed  in  debian/../...\n(In  debian/copyright,  the Files-Excluded and Files-Excluded-component stanzas are a part of\nthe first paragraph and there is a blank line before the following paragraphs  which  contain\nFiles  and  other  stanzas.  The  Files-Included  stanza  may  be  used  to  ignore  parts of\nsubdirectories specified by the Files-Excluded stanza See uscan(1) \"COPYRIGHT FILE EXAMPLE\".)\n\nThe archive type for zip is detected by \"file --dereference --brief --mime-type\" command.  So\nany zip type archives such as jar and xpi are treated in the same way.\n\nIf the package name is given via the --package option, no information is read  from  debian/,\nand the result file is placed in the current directory.\n\nmk-origtargz is commonly called via uscan, which first obtains the upstream tarball.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "Metadata options",
                    "content": "The following options extend or replace information taken from debian/.\n\n--package package\nUse package as the name of the Debian source package, and do not require or use a debian/\ndirectory. This option can only be used together with --version.\n\nThe default is to use the package name of the first entry in debian/changelog.\n"
                },
                {
                    "name": "-v --version _",
                    "content": "Use  version as the version of the package. This needs to be the upstream version portion\nof a full Debian version, i.e. no Debian revision, no epoch.\n\nThe default is to use the  upstream  portion  of  the  version  of  the  first  entry  in\ndebian/changelog.\n\n--exclude-file glob\nRemove  files  matching  the  given  glob from the tarball, as if it was listed in Files-\nExcluded.\n\n--copyright-file filename\nRemove files matching the patterns found in filename, which should have the format  of  a\nDebian                     copyright                     file                    (Format:\nhttps://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ to be precise). Errors\nparsing that file are silently ignored, exactly as is the case with debian/copyright.\n\nUnmatched patterns will emit a warning so the user can verify whether it is correct.   If\nthere  are  multiple  patterns  which match a file, only the last one will count as being\nmatched.\n\nBoth the --exclude-file and --copyright-file options amend the list of patterns found  in\ndebian/copyright. If you do not want to read that file, you will have to use --package.\n\n--signature signature-mode\nSet signature-mode:\n\n0 for no signature\n1 for normal detached signature\n2 for signature on decompressed\n3 for self signature\n--signature-file signature-file\nUse  signature-file  as  the signature file corresponding to the Debian source package to\ncreate a dpkg-source (post-stretch) compatible signature file.  (optional)\n",
                    "flag": "-v",
                    "long": "--version"
                },
                {
                    "name": "Action options",
                    "content": "These options specify what exactly mk-origtargz should do. The options --copy,  --rename  and\n--symlink are mutually exclusive.\n"
                },
                {
                    "name": "--symlink",
                    "content": "Make  the  resulting  file  a  symlink  to  the given original file. (This is the default\nbehaviour.)\n\nIf the file has to be modified (because it is a zip, xpi or zst file, because of --repack\nor Files-Excluded), this option behaves like --copy.\n",
                    "long": "--symlink"
                },
                {
                    "name": "--copy",
                    "content": "Make the resulting file a copy of the original file (unless it has  to  be  modified,  of\ncourse).\n",
                    "long": "--copy"
                },
                {
                    "name": "--rename",
                    "content": "Rename the original file.\n\nIf  the  file has to be modified (because it is a zip, xpi, zst file, because of --repack\nor Files-Excluded), this implies that the original file is deleted afterwards.\n",
                    "long": "--rename"
                },
                {
                    "name": "--repack",
                    "content": "If the given file is  not  compressed  using  the  desired  format  (see  --compression),\nrecompress it.\n",
                    "long": "--repack"
                },
                {
                    "name": "-S --repack-suffix _",
                    "content": "If  the file has to be modified, because of Files-Excluded, append suffix to the upstream\nversion.\n",
                    "flag": "-S",
                    "long": "--repack-suffix"
                },
                {
                    "name": "--force-repack",
                    "content": "Recompress even if file is compressed using the desired format and no files were deleted.\n",
                    "long": "--force-repack"
                },
                {
                    "name": "-c --component _",
                    "content": "Use <componentname> as the component  name  for  the  secondary  upstream  tarball.   Set\ncomponentname  as  the  component  name.   This  is  used only for the secondary upstream\ntarball of the Debian source package.  Then packagenameversion.orig-componentname.tar.gz\nis created.\n\n--compression [ gzip | bzip2 | lzma | xz | default ]\nThe default method is xz. When mk-origtargz is launched in  a  debian  source  repository\nwhich format is \"1.0\" or undefined, the method switches to gzip.\n",
                    "flag": "-c",
                    "long": "--component"
                },
                {
                    "name": "-C --directory _",
                    "content": "Put the resulting file in the given directory.\n\n--unzipopt options\nAdd the extra options to use with the unzip command such as -a, -aa, and -b.\n",
                    "flag": "-C",
                    "long": "--directory"
                }
            ]
        },
        "SEE ALSO": {
            "content": "uscan(1), uupdate(1)\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "mk-origtargz and this manpage have been written by Joachim Breitner <nomeata@debian.org>.\n\nDebian Utilities                             2026-02-25                              MK-ORIGTARGZ(1)",
            "subsections": []
        }
    },
    "summary": "mk-origtargz - rename upstream tarball, optionally changing the compression and removing unwanted files",
    "flags": [
        {
            "flag": "-v",
            "long": "--version",
            "arg": null,
            "description": "Use version as the version of the package. This needs to be the upstream version portion of a full Debian version, i.e. no Debian revision, no epoch. The default is to use the upstream portion of the version of the first entry in debian/changelog. --exclude-file glob Remove files matching the given glob from the tarball, as if it was listed in Files- Excluded. --copyright-file filename Remove files matching the patterns found in filename, which should have the format of a Debian copyright file (Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ to be precise). Errors parsing that file are silently ignored, exactly as is the case with debian/copyright. Unmatched patterns will emit a warning so the user can verify whether it is correct. If there are multiple patterns which match a file, only the last one will count as being matched. Both the --exclude-file and --copyright-file options amend the list of patterns found in debian/copyright. If you do not want to read that file, you will have to use --package. --signature signature-mode Set signature-mode: 0 for no signature 1 for normal detached signature 2 for signature on decompressed 3 for self signature --signature-file signature-file Use signature-file as the signature file corresponding to the Debian source package to create a dpkg-source (post-stretch) compatible signature file. (optional)"
        },
        {
            "flag": "",
            "long": "--symlink",
            "arg": null,
            "description": "Make the resulting file a symlink to the given original file. (This is the default behaviour.) If the file has to be modified (because it is a zip, xpi or zst file, because of --repack or Files-Excluded), this option behaves like --copy."
        },
        {
            "flag": "",
            "long": "--copy",
            "arg": null,
            "description": "Make the resulting file a copy of the original file (unless it has to be modified, of course)."
        },
        {
            "flag": "",
            "long": "--rename",
            "arg": null,
            "description": "Rename the original file. If the file has to be modified (because it is a zip, xpi, zst file, because of --repack or Files-Excluded), this implies that the original file is deleted afterwards."
        },
        {
            "flag": "",
            "long": "--repack",
            "arg": null,
            "description": "If the given file is not compressed using the desired format (see --compression), recompress it."
        },
        {
            "flag": "-S",
            "long": "--repack-suffix",
            "arg": null,
            "description": "If the file has to be modified, because of Files-Excluded, append suffix to the upstream version."
        },
        {
            "flag": "",
            "long": "--force-repack",
            "arg": null,
            "description": "Recompress even if file is compressed using the desired format and no files were deleted."
        },
        {
            "flag": "-c",
            "long": "--component",
            "arg": null,
            "description": "Use <componentname> as the component name for the secondary upstream tarball. Set componentname as the component name. This is used only for the secondary upstream tarball of the Debian source package. Then packagenameversion.orig-componentname.tar.gz is created. --compression [ gzip | bzip2 | lzma | xz | default ] The default method is xz. When mk-origtargz is launched in a debian source repository which format is \"1.0\" or undefined, the method switches to gzip."
        },
        {
            "flag": "-C",
            "long": "--directory",
            "arg": null,
            "description": "Put the resulting file in the given directory. --unzipopt options Add the extra options to use with the unzip command such as -a, -aa, and -b."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "uscan",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/uscan/1/json"
        },
        {
            "name": "uupdate",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/uupdate/1/json"
        }
    ]
}