← Back to team overview

launchpad-users team mailing list archive

Re: Are packages orig.tar.gz and debian.tar.xz necessary? Can they be empty?


On Tue, May 29, 2018 at 07:59:53AM -0300, Gustavo Benedito Costa wrote:
> I have forked Faenza packages, modified, readjusted, completing the job,
> and compiled and uploaded to Launchpad successfully. And at Launchpad, it
> was built with success without fail and errors.
> I found a sample tutorial the which does not require me to compress the
> folders to .orig.tar.gz and debian.tar.xz. See it:
> https://askubuntu.com/revisions/493577/10

I very strongly recommend against following this tutorial.  It won't
work on Launchpad at all, because it relies on constructing binary
packages by hand rather than constructing a source package and letting
the tools build that; and, more generally, it deliberately works at a
low level rather than taking advantage of lots of useful higher-level

People reinvent this sort of thing from time to time, and there's no way
to stop them, but it's just a really bad idea.  A good rule of thumb is
that if you see anything that involves fiddling with the contents of an
all-caps "DEBIAN" directory, then run away from that document and
pretend you never saw it; it's the equivalent of building your
executables with a hex editor rather than a compiler.  (Working with the
lower-case "debian" directory is fine, though.)

> Is this tutorial useful or are orig.tar.gz and debian.tar.xz necessary? Can
> these compressed files be empty?

In general, I think you're asking these questions because you've made
some kind of mistake that leads you to need to care about the details
too much.

Generally the way it works is that you get an .orig.tar.* from the
upstream of the source code that you're packaging (classically by
something like "make dist", or nowadays maybe something like "git
archive"), you put that in the directory one level above the unpacked
source code, and then you use "debuild -S" (or similar) to build the
source package, which produces all the other necessary files.  If you
find yourself compressing a .debian.tar.* file by hand, then you're
doing it wrong.

There are a few different shapes that a source package can take,
depending on the contents of debian/source/format and on the package's
version number.  It's possible to build a source package with a single
.tar.* rather than .orig.tar.* and .debian.tar.*, which is referred to
as a "native" source package; that's useful in situations where the
package doesn't really have a separate upstream source.  Otherwise,
using separate .orig.tar.* and .debian.tar.* files is normally correct.

Colin Watson                                    [cjwatson@xxxxxxxxxxxxx]

Follow ups