-
Notifications
You must be signed in to change notification settings - Fork 37
/
Makefile
74 lines (64 loc) · 2.44 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
PN = kodi-standalone-service
PREFIX ?= /usr
INITDIR = $(PREFIX)/lib/systemd/system
USERDIR = $(PREFIX)/lib/sysusers.d
TMPFDIR = $(PREFIX)/lib/tmpfiles.d
UDEVDIR = $(PREFIX)/lib/udev/rules.d
POLKDIR = $(PREFIX)/share/polkit/rules.d
MANDIR = $(PREFIX)/share/man/man1
ENVDIR = /etc/conf.d
RM = rm
INSTALL = install -p
INSTALL_DIR = $(INSTALL) -d
INSTALL_PROGRAM = $(INSTALL) -m755
INSTALL_DATA = $(INSTALL) -m644
IS_ARCH_ARM := $(shell uname -m | grep -q -E "^(arm|aarch64)"; echo $$?)
ifeq ($(IS_ARCH_ARM), 0)
ARCH = arm
else
ARCH = x86
endif
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_DIR) "$(DESTDIR)$(UDEVDIR)"
$(INSTALL_DIR) "$(DESTDIR)$(ENVDIR)"
$(INSTALL_DATA) $(ARCH)/udev/99-kodi.rules "$(DESTDIR)$(UDEVDIR)/99-kodi.rules"
$(INSTALL_DATA) common/kodi-standalone "$(DESTDIR)$(ENVDIR)/kodi-standalone"
ifeq ($(ARCH),arm)
$(INSTALL_DIR) "$(DESTDIR)$(POLKDIR)"
$(INSTALL_DATA) $(ARCH)/polkit/polkit.rules "$(DESTDIR)$(POLKDIR)/99-kodi.rules"
endif
install-init:
$(INSTALL_DIR) "$(DESTDIR)$(INITDIR)"
$(INSTALL_DIR) "$(DESTDIR)$(USERDIR)"
$(INSTALL_DIR) "$(DESTDIR)$(TMPFDIR)"
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"
install-man:
$(INSTALL_DIR) "$(DESTDIR)$(MANDIR)"
$(INSTALL_DATA) $(ARCH)/doc/kodi.service.1 "$(DESTDIR)$(MANDIR)/kodi.service.1"
uninstall:
ifeq ($(ARCH),x86)
$(RM) "$(DESTDIR)$(INITDIR)/kodi-gbm.service"
$(RM) "$(DESTDIR)$(INITDIR)/kodi-wayland.service"
$(RM) "$(DESTDIR)$(INITDIR)/kodi-x11.service"
else
$(RM) "$(DESTDIR)$(INITDIR)/kodi.service"
$(RM) "$(DESTDIR)$(POLKDIR)/99-kodi.rules"
endif
$(RM) "$(DESTDIR)$(TMPFDIR)/kodi-standalone.conf"
$(RM) "$(DESTDIR)$(USERDIR)/kodi-standalone.conf"
$(RM) "$(DESTDIR)$(UDEVDIR)/99-kodi.rules"
$(RM) "$(DESTDIR)$(MANDIR)/kodi.service.1"
$(RM) "$(DESTDIR)$(ENVDIR)/kodi-standalone"
install: install-common install-init install-man
.PHONY: install-common install-init uninstall