I am trying to build a debian package with systemd scripts and I don't really understand the best way to do it.
My first question is, should I use the --with=systemd option (and override dh_systemd_enable and dh_systemd_start) or is using dh_installinit with the --name option enough? Because both seem to do the same thing.
You definitely need
--with=systemdin yourdhinvocation.As for which combination of overrides you need, it depends.
It sounds like you just need systemd units included, so you don't need to override anything.
Since your question doesn't have much context, I will list some of the use cases for when to override each systemd debhelpder.
When to use override_dh_systemd_enable:
Manual page for dh_systemd_enable
When to use override_dh_systemd_start:
Manual page for dh_systemd_start
When to use override_dh_installinit:
dh_systemd_startanddh_systemd_enablesection above. There are also many things that involve upstart, which is not relevant to this question. Please see the man page, linked below.Manual page for dh_installinit
Also note all these overrides go into your debian control file.