toreanderson/clatd

Improve Makefile for packagers

toreanderson opened this issue · 1 comments

The make install target does stuff like systemctl enable clatd.service and simiar which is not wanted when building distribution packages. It also installs everything with fully qualified paths, whereas package build scripts prefers to install to a designated build area.

So to improve this the make install logic should be split out into separate targets, e.g.:

  • install-clatd: Install clatd + manual page to $(PREFIX) if set, or /
  • install-systemd: Install clatd.service to $(PREFIX) if set, or / (but do not attempt to enable it)
  • install-upstart, install-networkmanager: Idem

install can depend on the targets appropriate for the system and remain suitable for manual user installations, while packagers can directly call the appropriate targets from their .spec or debian/rules files.

The Makefile actually needs to accept three variables in order to make @ingvarha happy:

  • DESTDIR - prepended to all installation paths (empty by default)
  • PREFIX - where clatd and the manual page gets installed (default /usr)
  • SYSCONFDIR - where systemd/upstart/nm files gets installed (default /etc)