However, my need is to actually *remove* some files from e. g.,
debian/install since they are not built on kfreebsd. How could I do
this?
cat > debian/$FOO.install <<EOF
#!/usr/bin/dh-exec
some/file /usr/bin
some/other/file /usr/lib/somewhere
[linux-any] some/systemd/foo.service /lib/systemd/system
EOF
chmod +x debian/$FOO.install
The file some/systemd/foo.service will only be installed on Linux
platforms.
dh-systemd is a noop on kfreebsd-* and hurd-i386. Also, I just
checked and noticed that I am installing the systemd service in my
packages also on FreeBSD/Hurd so far, and it doesn't FTBFS. I
should probably drop it there (because it's useless), but other
than a tiny amount of disk space it doesn't hurt either. (Obviously
an init script is also present, but not exclusively for non-Linux
ports.)