Hi Niels, ma 19.5.2025 klo 8.26 Niels Thykier (ni...@thykier.net) kirjoitti: > Martin-Éric Racine: > > Package: debhelper > > Version: 13.24.2 > > Severity: normal > > X-Debbugs-Cc: martin-eric.rac...@iki.fi > > > > In its current form, dh_installsystemd installs debian/package.unit which > > essentially follows dh_installinit logic. > > > > This doesn't work for packages that ship multiple units, especially timers. > > For instance, src:apt ships the following units via bin:apt: > > > > apt-daily.service > > apt-daily.timer > > apt-daily-upgrade.service > > apt-daily-upgrade.timer > > > > They have to be manually installed via debian/apt.install because > > dh_installsystemd cannot deal with filenames that deviate from the > > package.unit format. > > > > A better logic would be something similar to dh_installcron: > > > > apt.apt-daily.service > > apt.apt-daily.timer > > apt.apt-daily-upgrade.service > > apt.apt-daily-upgrade.timer > > > > This would enable specifying which of the binary targets should ship the > > files. > > > > Basically, if there are package.unit files, ship them with package. If > > there are package.*.unit files, ship them with the binary target specified > > before the first period. > > For what it is worth, I believe you can use `--name` with both scripts > to use `<package>.<name>.<stem>`. I think the hardest part of this for > `dh_installsystemd` is that is generate snippets as well, where > `dh_installcron` does not. This is why `dh_installsystemd` cannot just > glob all the units because you might deliberately want to call > `dh_installsystemd` to have different rules for each unit.
Using --name is a kludge. It requires separately naming the target package via an override in debian/rules and successive runs for each target. Meanwhile, the syntax 'target.foo.helper' is supported by most other helpers but, for some reason, not this one. This is what's needed. Martin-Éric