Tag Archives: dh_make

How to build a Debian package from source

There are plenty of articles on the net… but here I’m posting my notes about compiling netatalk.

First of all, you need the minimum packages:

I needed this on my Raspberry Pi for this article, and I didn’t want to make dirty the system using the common “make / make install” commands.

This are the simple steps I’ve followed (all as root – even if it’s not the best practise).

Make sure the folder has this format: <name_of_the_package>-<version> ALL in lowercase!

It will ask for the type of the package. To make things easier, just select single entering s.

Edit the file debian/control adding the missing bits (example below):

Then, add debian/rules adding this line, to pass custom configure parameters:

The <TAB> is what you have to press to indent the code. Without that TAB, the file won’t work properly. Before dh_auto_configure there is a TAB 🙂
MAKE SURE that the syntax gets highlighted like this:

debian_rules

I’ve read that it should be good to run dpkg-depcheck -d ./configure before the next step.
Honestly, I didn’t do that because it requires an extra package called devscripts that installs loads of dependencies, which I didn’t want to add on my Raspberry pi.
In a different situation, I would probably have done that.

Then run:

…and wait.

If you get something like this…

…you’ve been lucky! And you can cd .. and you should have your package .deb created and ready to be installed with a simple dpkg -i .deb

Good luck! 🙂

NOTE: I’ve noticed that the compile might fail due to ‘acl‘ package missing. I’m not a master in compiling, so what I’ve done is the following

Than I’ve modified include/atalk/acl.h start at line 63, adding #define O_IGNORE 0 to make it look like following:

This trick was from here
Than, you need to commit the change with the following command: dpkg-source --commit and save adding a little description like “patch to compile with no ACLs” or something like that.
This made me possible to finish the building of the package and have the deb.

 


 

UPDATE: Debian jessy systemd

# Packages to install

# How to edit debian/rules

And here the already compiled file netatalk_3.1.8