# mk-origtargz - rename upstream tarball, optionally changing the compr... - man(1) - [phpMan]

[_MK-ORIGTARGZ_(1)](https://www.chedong.com/phpMan.php/man/MK-ORIGTARGZ/1/markdown)                                                                      [_MK-ORIGTARGZ_(1)](https://www.chedong.com/phpMan.php/man/MK-ORIGTARGZ/1/markdown)

## NAME
       mk-origtargz - rename upstream tarball, optionally changing the compression and removing
       unwanted files

## SYNOPSIS
       **mk-origtargz **[_options_] _foo-1.0.tar.gz_
### mk-origtargz --help

## DESCRIPTION
       **mk-origtargz  **renames the given file to match what is expected by **dpkg-buildpackage**, based on
       the source package name  and  version  in  _debian/changelog_.  It  can  convert  **zip  **to  **tar**,
       optionally  change  the  compression  scheme and remove files according to **Files-Excluded **and
       **Files-Excluded-_**component_ in _debian/copyright_. The resulting file is placed  in  _debian/../.._.
       (In  _debian/copyright_,  the **Files-Excluded **and **Files-Excluded-_**component_ stanzas are a part of
       the first paragraph and there is a blank line before the following paragraphs  which  contain
       **Files  **and  other  stanzas.  The  **Files-Included  **stanza  may  be  used  to  ignore  parts of
       subdirectories specified by the **Files-Excluded **stanza See [**uscan**(1)](https://www.chedong.com/phpMan.php/man/uscan/1/markdown) "COPYRIGHT FILE EXAMPLE".)

       The archive type for **zip **is detected by "**file --dereference --brief --mime-type**" command.  So
       any **zip **type archives such as **jar **and **xpi **are treated in the same way.

       If the package name is given via the **--package **option, no information is read  from  _debian/_,
       and the result file is placed in the current directory.

       **mk-origtargz **is commonly called via **uscan**, which first obtains the upstream tarball.

## OPTIONS
### Metadata options
       The following options extend or replace information taken from _debian/_.

       **--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 _
           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)

### Action options
       These options specify what exactly **mk-origtargz **should do. The options **--copy**,  **--rename  **and
       **--symlink **are mutually exclusive.

### --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.

### --repack
           If the given file is  not  compressed  using  the  desired  format  (see  **--compression**),
           recompress it.

### -S --repack-suffix _
           If  the file has to be modified, because of **Files-Excluded**, append _suffix_ to the upstream
           version.

### --force-repack
           Recompress even if file is compressed using the desired format and no files were deleted.

### -c --component _
           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 _
           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)](https://www.chedong.com/phpMan.php/man/uscan/1/markdown), [**uupdate**(1)](https://www.chedong.com/phpMan.php/man/uupdate/1/markdown)

## AUTHOR
       **mk-origtargz **and this manpage have been written by Joachim Breitner <<_nomeata@debian.org_>>.

Debian Utilities                             2026-02-25                              [_MK-ORIGTARGZ_(1)](https://www.chedong.com/phpMan.php/man/MK-ORIGTARGZ/1/markdown)
