Add Makefile

This commit is contained in:
graysky 2020-12-18 21:12:42 -05:00
parent 60936bef1d
commit 1ddecd1ea1
2 changed files with 48 additions and 5 deletions

44
Makefile Normal file
View File

@ -0,0 +1,44 @@
PN = kodi-standalone-service
PREFIX ?= /usr
INITDIR = $(PREFIX)/lib/systemd/system
USERDIR = $(PREFIX)/lib/sysusers.d
TMPFDIR = $(PREFIX)/lib/tmpfiles.d
POLKDIR = $(PREFIX)/share/polkit-1/rules.d
RM = rm
INSTALL = install -p
INSTALL_DIR = $(INSTALL) -d
INSTALL_PROGRAM = $(INSTALL) -m755
INSTALL_DATA = $(INSTALL) -m644
INSTALL_POLK = $(INSTALL_DIR) -m750
common/$(PN):
@echo -e '\033[1;32mNothing to be done.\033[0m'
@echo -e '\033[1;32mJust run make install as root.\033[0m'
install-common:
$(INSTALL_POLK) "$(DESTDIR)$(POLKDIR)"
$(INSTALL_DATA) polkit/10-kodi.rules "$(DESTDIR)$(POLKDIR)/10-kodi.rules"
install-init:
$(INSTALL_DIR) "$(DESTDIR)$(INITDIR)"
$(INSTALL_DIR) "$(DESTDIR)$(USERDIR)"
$(INSTALL_DIR) "$(DESTDIR)$(TMPFDIR)"
$(INSTALL_DATA) init/kodi-gbm.service "$(DESTDIR)$(INITDIR)/kodi-gbm.service"
$(INSTALL_DATA) init/kodi-wayland.service "$(DESTDIR)$(INITDIR)/kodi-wayland.service"
$(INSTALL_DATA) init/kodi-x11.service "$(DESTDIR)$(INITDIR)/kodi-x11.service"
$(INSTALL_DATA) init/tmpfiles.conf "$(DESTDIR)$(TMPFDIR)/kodi-standalone.conf"
$(INSTALL_DATA) init/sysusers.conf "$(DESTDIR)$(USERDIR)/kodi-standalone.conf"
uninstall:
$(RM) "$(DESTDIR)$(INITDIR)/kodi-gbm.service"
$(RM) "$(DESTDIR)$(INITDIR)/kodi-wayland.service"
$(RM) "$(DESTDIR)$(INITDIR)/kodi-x11.service"
$(RM) "$(DESTDIR)$(TMPFDIR)/kodi-standalone.conf"
$(RM) "$(DESTDIR)$(USERDIR)/kodi-standalone.conf"
$(RM) "$(DESTDIR)$(POLKDIR)/10-kodi.rules"
install: install-common install-init
.PHONY: install-common install-init uninstall

View File

@ -18,12 +18,11 @@ Users of ARM distros such as Arch ARM, Raspberry Pi OS (formerly Raspbian), etc.
For the kodi user to access devices on `/dev/ttyxxxx`, users will need to edit `init/sysusers.conf` and uncomment the line corresponding to enable membership in the dialout group. For the kodi user to access devices on `/dev/ttyxxxx`, users will need to edit `init/sysusers.conf` and uncomment the line corresponding to enable membership in the dialout group.
### Other distros (manual installation) ### Other distros (manual installation)
Users of other distros should install the following files: Users of other distros can just run `make install` as the root user. Then, as the root user:
* `init/*.service` to `/usr/lib/systemd/system/` * Run `systemd-sysusers`
* `init/sysusers.conf` to `/usr/lib/sysusers.d/`, then run `systemd-sysusers` * Run `systemd-tmpfiles --create`
* `init/tmpfiles.conf` to `/usr/lib/tmpfiles.d/`, then run `systemd-tmpfiles --create` * Run `udevadm control --reload-rules && udevadm trigger`
* `polkit/10-kodi.rules` to `/usr/share/polkit-1/rules.d/`, then run `udevadm control --reload-rules && udevadm trigger`
Note that the kodi user's home directory is `/var/lib/kodi/` in this example, NOT `/home/kodi/` like a regular user. Note that the kodi user's home directory is `/var/lib/kodi/` in this example, NOT `/home/kodi/` like a regular user.