Skip to Content

Using dh_make to generate debian control files

In order to properly deploy software to the production servers ideally it should be packaged as a Debian package. This ensures that I have all the needed dependencies, that the server is restarted and all the files are removed would I ever remove the package.

For Maven based projects such as the DAISY Pipeline this means that you’ll be using a Maven plugin such as jdeb to create the deb automatically. This is fairly straight forward once you get the hang of it. mvn package will then create a deb package that contains all the files and these will be installed in the right places.

So far so good. But now you also want to make sure that the daemon is started after installation. This means you will have to create a postinst file. How do you so that? Use dh_make to create a numer of skeleton files, e.g. a control file, postinst, prerm and a README.Debian.

$ mkdir foo
$ cd foo
$ dh_make -p daisy-pipeline_1.0.0 --createorig --indep --copyright=lgpl3
Maintainer name  : Christian Egli
Email-Address    :
Date             : Thu, 24 Oct 2013 10:13:18 +0200
Package Name     : daisy-pipeline
Version          : 1.0.0
License          : lgpl3
Type of Package  : Independent
Hit <enter> to confirm:
Currently there is no top level Makefile. This may require additional tuning.
Done. Please edit the files in the debian/ subdirectory now. You should also
check that the daisy-pipeline Makefiles install into $DESTDIR and not in / .