2020-12-19 03:12:42 +01:00
|
|
|
PN = kodi-standalone-service
|
|
|
|
|
|
|
|
PREFIX ?= /usr
|
|
|
|
INITDIR = $(PREFIX)/lib/systemd/system
|
|
|
|
USERDIR = $(PREFIX)/lib/sysusers.d
|
|
|
|
TMPFDIR = $(PREFIX)/lib/tmpfiles.d
|
2021-02-16 13:18:17 +01:00
|
|
|
UDEVDIR = $(PREFIX)/lib/udev/rules.d
|
2022-01-17 10:37:11 +01:00
|
|
|
POLKDIR = $(PREFIX)/share/polkit/rules.d
|
2021-03-13 13:31:37 +01:00
|
|
|
MANDIR = $(PREFIX)/share/man/man1
|
2021-05-23 12:38:08 +02:00
|
|
|
ENVDIR = /etc/conf.d
|
2020-12-19 03:12:42 +01:00
|
|
|
|
|
|
|
RM = rm
|
|
|
|
INSTALL = install -p
|
|
|
|
INSTALL_DIR = $(INSTALL) -d
|
|
|
|
INSTALL_PROGRAM = $(INSTALL) -m755
|
|
|
|
INSTALL_DATA = $(INSTALL) -m644
|
|
|
|
|
2022-01-17 10:34:17 +01:00
|
|
|
IS_ARCH_ARM := $(shell grep -q ARM /proc/cpuinfo; echo $$?)
|
|
|
|
ifeq ($(IS_ARCH_ARM), 0)
|
|
|
|
ARCH = arm
|
|
|
|
else
|
|
|
|
ARCH = x86
|
|
|
|
endif
|
|
|
|
|
2020-12-19 03:12:42 +01:00
|
|
|
common/$(PN):
|
|
|
|
@echo -e '\033[1;32mNothing to be done.\033[0m'
|
|
|
|
@echo -e '\033[1;32mJust run make install as root.\033[0m'
|
|
|
|
|
2021-02-16 13:18:17 +01:00
|
|
|
install-common:
|
|
|
|
$(INSTALL_DIR) "$(DESTDIR)$(UDEVDIR)"
|
2021-05-23 12:38:08 +02:00
|
|
|
$(INSTALL_DIR) "$(DESTDIR)$(ENVDIR)"
|
2022-01-17 10:34:17 +01:00
|
|
|
$(INSTALL_DATA) $(ARCH)/udev/99-kodi.rules "$(DESTDIR)$(UDEVDIR)/99-kodi.rules"
|
2021-05-23 12:38:08 +02:00
|
|
|
$(INSTALL_DATA) common/kodi-standalone "$(DESTDIR)$(ENVDIR)/kodi-standalone"
|
2022-01-17 10:34:17 +01:00
|
|
|
ifeq ($(ARCH),arm)
|
|
|
|
$(INSTALL_DIR) "$(DESTDIR)$(POLKDIR)"
|
|
|
|
$(INSTALL_DATA) $(ARCH)/polkit/polkit.rules "$(DESTDIR)$(POLKDIR)/99-kodi.rules"
|
|
|
|
endif
|
2021-02-16 13:18:17 +01:00
|
|
|
|
2020-12-19 03:12:42 +01:00
|
|
|
install-init:
|
|
|
|
$(INSTALL_DIR) "$(DESTDIR)$(INITDIR)"
|
|
|
|
$(INSTALL_DIR) "$(DESTDIR)$(USERDIR)"
|
|
|
|
$(INSTALL_DIR) "$(DESTDIR)$(TMPFDIR)"
|
2022-01-17 10:34:17 +01:00
|
|
|
ifeq ($(ARCH),x86)
|
|
|
|
$(INSTALL_DATA) $(ARCH)/init/kodi-gbm.service "$(DESTDIR)$(INITDIR)/kodi-gbm.service"
|
|
|
|
$(INSTALL_DATA) $(ARCH)/init/kodi-wayland.service "$(DESTDIR)$(INITDIR)/kodi-wayland.service"
|
|
|
|
$(INSTALL_DATA) $(ARCH)/init/kodi-x11.service "$(DESTDIR)$(INITDIR)/kodi-x11.service"
|
|
|
|
else
|
|
|
|
$(INSTALL_DATA) $(ARCH)/init/kodi.service "$(DESTDIR)$(INITDIR)/kodi.service"
|
|
|
|
endif
|
|
|
|
$(INSTALL_DATA) $(ARCH)/init/tmpfiles.conf "$(DESTDIR)$(TMPFDIR)/kodi-standalone.conf"
|
|
|
|
$(INSTALL_DATA) $(ARCH)/init/sysusers.conf "$(DESTDIR)$(USERDIR)/kodi-standalone.conf"
|
2020-12-19 03:12:42 +01:00
|
|
|
|
2021-03-13 13:31:37 +01:00
|
|
|
install-man:
|
|
|
|
$(INSTALL_DIR) "$(DESTDIR)$(MANDIR)"
|
2022-01-17 10:34:17 +01:00
|
|
|
$(INSTALL_DATA) $(ARCH)/doc/kodi.service.1 "$(DESTDIR)$(MANDIR)/kodi.service.1"
|
2021-03-13 13:31:37 +01:00
|
|
|
|
2020-12-19 03:12:42 +01:00
|
|
|
uninstall:
|
2022-01-17 10:34:17 +01:00
|
|
|
ifeq ($(ARCH),x86)
|
2020-12-19 03:12:42 +01:00
|
|
|
$(RM) "$(DESTDIR)$(INITDIR)/kodi-gbm.service"
|
|
|
|
$(RM) "$(DESTDIR)$(INITDIR)/kodi-wayland.service"
|
|
|
|
$(RM) "$(DESTDIR)$(INITDIR)/kodi-x11.service"
|
2022-01-17 10:34:17 +01:00
|
|
|
else
|
|
|
|
$(RM) "$(DESTDIR)$(INITDIR)/kodi.service"
|
2022-01-17 10:37:11 +01:00
|
|
|
$(RM) "$(DESTDIR)$(POLKDIR)/99-kodi.rules"
|
2022-01-17 10:34:17 +01:00
|
|
|
endif
|
2020-12-19 03:12:42 +01:00
|
|
|
$(RM) "$(DESTDIR)$(TMPFDIR)/kodi-standalone.conf"
|
|
|
|
$(RM) "$(DESTDIR)$(USERDIR)/kodi-standalone.conf"
|
2021-02-16 13:18:17 +01:00
|
|
|
$(RM) "$(DESTDIR)$(UDEVDIR)/99-kodi.rules"
|
2021-03-13 13:31:37 +01:00
|
|
|
$(RM) "$(DESTDIR)$(MANDIR)/kodi.service.1"
|
2021-05-23 12:38:08 +02:00
|
|
|
$(RM) "$(DESTDIR)$(ENVDIR)/kodi-standalone"
|
2020-12-19 03:12:42 +01:00
|
|
|
|
2021-03-13 13:31:37 +01:00
|
|
|
install: install-common install-init install-man
|
2020-12-19 03:12:42 +01:00
|
|
|
|
2021-02-16 13:18:17 +01:00
|
|
|
.PHONY: install-common install-init uninstall
|