summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch
blob: 6c4225a678de2f6765e8ee69e34766906543f0e4 (plain)
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
75
76
77
78
79
80
81
82
83
Upstream-Status: Pending

diff --git a/src/Makefile b/src/Makefile
index e2b8028..3e11e92 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -65,7 +65,14 @@ else
   INSTALL_DATA	= install -m 644
 endif
 INSTALL_DIR	= install -m 755 -d
-MANDIR		= /usr/share/man
+
+ROOT         ?=
+base_bindir  ?= /bin
+base_sbindir ?= /sbin
+bindir       ?= /usr/bin
+sysconfdir   ?= /etc
+includedir   ?= /usr/include
+mandir       ?= /usr/share/man
 
 ifeq ($(WITH_SELINUX),yes)
   SELINUX_DEF	=  -DWITH_SELINUX
@@ -138,39 +145,39 @@ clobber:	cleanobjs
 distclean:	clobber
 
 install:
-		$(INSTALL_DIR) $(ROOT)/bin/ $(ROOT)/sbin/
-		$(INSTALL_DIR) $(ROOT)/usr/bin/
+		$(INSTALL_DIR) $(ROOT)$(base_bindir)/ $(ROOT)$(base_sbindir)/
+		$(INSTALL_DIR) $(ROOT)$(bindir)/
 		for i in $(BIN); do \
-			$(INSTALL_EXEC) $$i $(ROOT)/bin/ ; \
+			$(INSTALL_EXEC) $$i $(ROOT)$(base_bindir)/ ; \
 		done
 		for i in $(SBIN); do \
-			$(INSTALL_EXEC) $$i $(ROOT)/sbin/ ; \
+			$(INSTALL_EXEC) $$i $(ROOT)$(base_sbindir)/ ; \
 		done
 		for i in $(USRBIN); do \
-			$(INSTALL_EXEC) $$i $(ROOT)/usr/bin/ ; \
+			$(INSTALL_EXEC) $$i $(ROOT)$(bindir)/ ; \
 		done
-		# $(INSTALL_DIR) $(ROOT)/etc/
-		# $(INSTALL_EXEC) initscript.sample $(ROOT)/etc/
-		ln -sf halt $(ROOT)/sbin/reboot
-		ln -sf halt $(ROOT)/sbin/poweroff
-		ln -sf init $(ROOT)/sbin/telinit
-		ln -sf /sbin/killall5 $(ROOT)/bin/pidof
-		if [ ! -f $(ROOT)/usr/bin/lastb ]; then \
-			ln -sf last $(ROOT)/usr/bin/lastb; \
+		# $(INSTALL_DIR) $(ROOT)$(sysconfdir)/
+		# $(INSTALL_EXEC) initscript.sample $(ROOT)$(sysconfdir)/
+		ln -sf halt $(ROOT)$(base_sbindir)/reboot
+		ln -sf halt $(ROOT)$(base_sbindir)/poweroff
+		ln -sf init $(ROOT)$(base_sbindir)/telinit
+		ln -sf $(base_sbindir)/killall5 $(ROOT)$(base_bindir)/pidof
+		if [ ! -f $(ROOT)$(bindir)/lastb ]; then \
+			ln -sf last $(ROOT)$(bindir)/lastb; \
 		fi
-		$(INSTALL_DIR) $(ROOT)/usr/include/
-		$(INSTALL_DATA) initreq.h $(ROOT)/usr/include/
-		$(INSTALL_DIR) $(ROOT)$(MANDIR)/man1/
-		$(INSTALL_DIR) $(ROOT)$(MANDIR)/man5/
-		$(INSTALL_DIR) $(ROOT)$(MANDIR)/man8/
+		$(INSTALL_DIR) $(ROOT)$(includedir)/
+		$(INSTALL_DATA) initreq.h $(ROOT)$(includedir)/
+		$(INSTALL_DIR) $(ROOT)$(mandir)/man1/
+		$(INSTALL_DIR) $(ROOT)$(mandir)/man5/
+		$(INSTALL_DIR) $(ROOT)$(mandir)/man8/
 		for i in $(MAN1); do \
-			$(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man1/; \
+			$(INSTALL_DATA) ../man/$$i $(ROOT)$(mandir)/man1/; \
 		done
 		for i in $(MAN5); do \
-			$(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man5/; \
+			$(INSTALL_DATA) ../man/$$i $(ROOT)$(mandir)/man5/; \
 		done
 		for i in $(MAN8); do \
-			$(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man8/; \
+			$(INSTALL_DATA) ../man/$$i $(ROOT)$(mandir)/man8/; \
 		done
 ifeq ($(ROOT),)
 		#