MK-ORIGTARGZ(1)

πŸ‘‘ MK-ORIGTARGZ πŸ’…

okay bestie, welcome to mk-origtargz(1) β€” the girl whose whole job is renaming your upstream tarball so dpkg-buildpackage doesn't side-eye you. she can also ✨change the compression✨ and ✨yeet unwanted files✨, no cap.


✨ SYNOPSIS ✨

mk-origtargz [options] foo-1.0.tar.gz
mk-origtargz --help

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the vibe: mk-origtargz takes the file you hand her and renames it to match whatever dpkg-buildpackage is expecting, based on the source package name and version she finds in debian/changelog. Iconic behavior, honestly.

She can do a whole glow-up on your archive:

  • convert zip to tar πŸŽ€
  • optionally switch up the compression scheme
  • remove files according to Files-Excluded and Files-Excluded-component in debian/copyright

And where does the resulting file go? Into debian/../... πŸ’–

Little side note on the debian/copyright situation, because it's giving specific: the Files-Excluded and Files-Excluded-component stanzas are part of the first paragraph, and there's a blank line before the following paragraphs, which contain Files and other stanzas. Also, the Files-Included stanza can be used to ignore parts of subdirectories specified by the Files-Excluded stanza. Go read uscan(1), section "COPYRIGHT FILE EXAMPLE", iykyk.

Now, the archive type for zip gets detected by running the file --dereference --brief --mime-type command. So literally any zip-type archive β€” jar, xpi, the whole squad β€” gets treated the same way. 🫢

One more thing: if the package name comes in via the --package option, then nothing gets read from debian/, and the result file just chills in the current directory. Simple.

Oh and btw, mk-origtargz is commonly called through uscan, which is the one that goes and fetches the upstream tarball first. She's basically the second act. 🌈


⭐ OPTIONS ⭐

🌸 Metadata options 🌸

These options extend or replace information taken from debian/. Like, they either add to it or override it, depending on the vibe.

  • --package package β€” Use package as the name of the Debian source package, and do not require or use a debian/ directory. This option can only be used together with --version. The default is to use the package name of the first entry in debian/changelog.
  • -v, --version version β€” Use version as the version of the package. Heads up: this needs to be the upstream version portion of a full Debian version, meaning no Debian revision and no epoch. Periodt. 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.
  • --include-file glob β€” Include previously excluded files matching the given glob in the tarball, as if it was listed in Files-Included. (yes she can un-exclude things, she contains multitudes πŸ’œ)
  • --copyright-file filename β€” Remove files matching the patterns found in filename, which should have the format of a Debian copyright file (to be precise: Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/). 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. πŸ’€
Also important: the --exclude-file, --include-file and --copyright-file options amend the list of patterns found in debian/copyright. So 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) πŸŽ€

πŸ”₯ Action options πŸ”₯

These options specify what exactly mk-origtargz should do. The options --copy, --rename and --symlink are mutually exclusive β€” pick one, bestie, you cannot have all three.

  • --symlink β€” 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.

  • --copy β€” Make the resulting file a copy of the original file (unless it has to be modified, of course).
  • --rename β€” 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. πŸ’€ so like, be aware.
  • --repack β€” If the given file is not compressed using the desired format (see --compression), recompress it.
  • -S, --repack-suffix suffix β€” If the file has to be modified, because of Files-Excluded, append suffix to the upstream version.
  • --force-repack β€” Recompress even if the file is compressed using the desired format and no files were deleted. She's doing it because she wants to. πŸ’…
  • -c, --component componentname β€” 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 packagename_version.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.
  • -C, --directory directory β€” 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.

🌈 SEE ALSO 🌈

uscan(1), uupdate(1)


πŸ’œ AUTHOR πŸ’œ

mk-origtargz and this manpage have been written by Joachim Breitner <nomeata@debian.org>. absolute legend, we love to see it. 🫢


okay that's the whole page bestie, go rename some tarballs and slay πŸ’–βœ¨ this one's from Debian Utilities, dated 2026-09-21 β€” mwah, catch you on the next manpage πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from