
Debian Packaging Tutorial – Feedback Welcome - ssundarraj
https://blog.ssundarraj.me/debian-packaging-1b176d03ab0
======
zlatan_todoric
Being a Debian maintainer, that is a very bad and low quality tutorial. You
missed a lot of files in debian directory, even your example of control file
is not good enough, you're using practices to build package which would reject
your package from even entering Debian. Also lintian is a must be if you work
with Debian (and it would really scream with your tutorial).

Better tutorials:

[https://wiki.debian.org/IntroDebianPackaging](https://wiki.debian.org/IntroDebianPackaging)

[https://wiki.debian.org/HowToPackageForDebian](https://wiki.debian.org/HowToPackageForDebian)

[https://people.debian.org/~osamu/maint-
guide.html](https://people.debian.org/~osamu/maint-guide.html)

[https://wiki.debian.org/PackagingWithGit](https://wiki.debian.org/PackagingWithGit)
(because we are all going to git the world).

~~~
regularfry
As a Debian _user_ , it's a fine tutorial. Not every .deb is built for
distribution with Debian itself. The only change I'd make is to clarify that
what's being built here is a "for personal use only" package.

As to the debian.org guides, I've always found them obtuse precisely because
they emphasise what you've got to do to get a package distributed, rather than
the plain technical details of how they work.

~~~
zlatan_todoric
Packaging tutorial shouldn't be technical details how deb package works but
how you build one (if you want those details you can also find them in Debian
documentation but in the end deb package is just an ar file with it's set of
make file that satisfies the installation in specific distro - this is the
simple explanation). And no, the tutorial is misleading because Debian
packaging means doing it for Debian, while creating a deb package for your
personal need is different. You also have Ubuntu packaging guides and so on.

~~~
regularfry
But the guides aren't just how you build a package. They're how you package
something for official distribution. The requirements for the former aren't
_nearly_ as stringent as for the latter, and by obscuring the former behind
the latter, Debian makes its packaging guides less useful.

~~~
zlatan_todoric
Debian packaging guides are less useful because they concentrate on how to
build package for _Debian_?

And nobody is hiding from you any tutorial - Debian is an open community and
the wiki is open to everyone so you can search for what you need but I really
don't see the point in your sentences (are you saying that we should favorite
somehow quick and dirty hacks instead of our strict high-quality ways of
building packages? Because if yes, then Debian wouldn't be what it is
today...)

~~~
regularfry
Yes, that's exactly correct. Debian's tutorials are less generally useful
because, to serve the specific goal of keeping Debian's packages high quality,
they obscure what you _can_ do behind what _Debian_ thinks you _should_.

~~~
zlatan_todoric
First of all (repeating myself again): there is a lot of documentation out
there (already mentioned multiple times in this thread) how you can build debs
quickly. Also, Debian tutorials are _Debian_ tutorials and they should serve
Debian primarily and not some third-party, but still you have all
documentation on Debian wiki (and also manpages of specific packages) - you
just need to do a bit of search.

Second: saying that Debian's tutorials are less useful because they have
specific goal of high quality - makes me really sad. Debian is community and
not corporation, so to see that community has higher standard then any
corporation should be praised. Also Debian's packaging evolved over 20+ years
by thousands of hackers (experts in their field) all over world in their
unique collaboration. I am sure this should be taken as a pride that you can
go on net an read such tutorials.

And really, if someone thinks he is technical but can't read few pages of
_not_ so demanding tutorial, then problem is in them because in software world
you evolve every day and need to read and code a lot to keep a pace. Only
problem that you could say is that maybe isn't that fun to read (because
Debian wikis are old school so the sentences stretch through entire screen
while today's web is focused on centering all which makes it a bit easy to
read and so on).

------
zimbatm
This is a tutorial for building quick one-off packages that won't ever be
accepted by debian but that you can use with your own servers.

If you want to do that, you will be better off using Jordan Sissel's fpm tool:
[https://github.com/jordansissel/fpm](https://github.com/jordansissel/fpm) It
can take any project and quickly package it into a .deb, .rpm, .whatever
package.

~~~
ssundarraj
Agreed, no doubt. Just a quick start guide for beginner packages.

------
robinson-wall
> If you’re using OS X you can install it from homebrew (brew install dpkg).

While you can build a package of something simple like this example (static
html), as soon as you want to compile a binary you're going to need to be
building on the same environment as you're targeting.

I'd suggest removing any mention of OSX from the guide, or making it clear of
the limitations of trying to build debs on it.

~~~
ssundarraj
I've added the limitation of this! Thanks for the feedback. That didn't strike
me at all.

------
perlgeek
If you use the standard debhelper toolchain instead, you get lots of stuff for
free.

Want to ship a systemd service file? include "\--with systemd" in the dh
invocation in debian/rules (and add dh-systemd as a build dependency), and you
can drop your system files in debian/yourpackage.service. The helper will do
all the work for you like copying the service file to the right location,
doing the "daemon-reload" to make sure it is read after it's changed, reload
it after package installation, stop if when the package is uninstalled, and so
on.

Want to create an empty directory? add it to debian/dirs. Want to install
additional files? add them to debian/install.

Want to create a debian package from an existing perl module? "dh-make-perl
--cpan The::Package".

And the nice thing is that all of these mechanisms are composable, and it is
easy to override steps you want to customize.

At first, I found the standard debhelper toolchain to be complex too, but it
actually makes simple things easy, and hard things possible.

Shameless plug: Yesterday I've blogged about debian packaging a simplistic
Perl web application: [http://perlgeek.de/blog-en/automating-
deployments/2016-005-e...](http://perlgeek.de/blog-en/automating-
deployments/2016-005-example-project.html) (not much Perl specific in there).

