1From 71d9a23ab6a73ec1287acc683716481090095de0 Mon Sep 17 00:00:00 2001
2From: Peter Korsgaard <jacmet@sunsite.dk>
3Date: Fri, 23 Jul 2021 16:47:56 +0200
4Subject: [PATCH] Makefile.in: fix make install for non-root, don't strip
5
6Buildroot will ensure all files are owned by root and stripped anyway
7(if needed) before the rootfs is created.
8
9Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
10Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
11[Vincent: tweak the patch for the new version]
12Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
13[Giulio: convert patch to git format and rebase to version 3.2.2]
14---
15 Makefile.in | 47 +++++++++++++++++++++++------------------------
16 1 file changed, 23 insertions(+), 24 deletions(-)
17
18diff --git a/Makefile.in b/Makefile.in
19index a7197f2..0b35a67 100644
20--- a/Makefile.in
21+++ b/Makefile.in
22@@ -99,43 +99,42 @@ atrun: atrun.in
23 	$(CC) -c $(CFLAGS) $(DEFS) $*.c
24
25 install: all
26-	$(INSTALL) -g root -o root -m 755 -d $(DESTDIR)$(etcdir)
27-	$(INSTALL) -g root -o root -m 755 -d $(DESTDIR)$(bindir)
28-	$(INSTALL) -g root -o root -m 755 -d $(DESTDIR)$(sbindir)
29-	$(INSTALL) -g root -o root -m 755 -d $(DESTDIR)$(atdatadir)
30-	$(INSTALL) -g root -o root -m 755 -d $(DESTDIR)$(docdir)
31-	$(INSTALL) -g root -o root -m 755 -d $(DESTDIR)$(atdocdir)
32-	$(INSTALL) -g $(DAEMON_GROUPNAME) -o $(DAEMON_USERNAME) -m 755 -d $(DESTDIR)$(ATSPOOL_DIR) $(DESTDIR)$(ATJOB_DIR)
33+	$(INSTALL) -m 755 -d $(DESTDIR)$(etcdir)
34+	$(INSTALL) -m 755 -d $(DESTDIR)$(bindir)
35+	$(INSTALL) -m 755 -d $(DESTDIR)$(sbindir)
36+	$(INSTALL) -m 755 -d $(DESTDIR)$(atdatadir)
37+	$(INSTALL) -m 755 -d $(DESTDIR)$(docdir)
38+	$(INSTALL) -m 755 -d $(DESTDIR)$(atdocdir)
39+	$(INSTALL) -m 755 -d $(DESTDIR)$(ATSPOOL_DIR) $(DESTDIR)$(ATJOB_DIR)
40 	chmod 1770 $(DESTDIR)$(ATSPOOL_DIR) $(DESTDIR)$(ATJOB_DIR)
41 	touch $(DESTDIR)$(LFILE)
42 	chmod 600 $(DESTDIR)$(LFILE)
43-	chown $(DAEMON_USERNAME):$(DAEMON_GROUPNAME) $(DESTDIR)$(LFILE)
44-	test -f $(DESTDIR)$(etcdir)/at.allow || test -f $(DESTDIR)$(etcdir)/at.deny || $(INSTALL) -o root -g $(DAEMON_GROUPNAME) -m 640 at.deny $(DESTDIR)$(etcdir)/
45-	$(INSTALL) -g $(DAEMON_GROUPNAME) -o $(DAEMON_USERNAME) -m 6755 at $(DESTDIR)$(bindir)
46+	test -f $(DESTDIR)$(etcdir)/at.allow || test -f $(DESTDIR)$(etcdir)/at.deny || $(INSTALL) -m 640 at.deny $(DESTDIR)$(etcdir)/
47+	$(INSTALL) -m 6755 at $(DESTDIR)$(bindir)
48 	$(LN_S) -f at $(DESTDIR)$(bindir)/atq
49 	$(LN_S) -f at $(DESTDIR)$(bindir)/atrm
50-	$(INSTALL) -g root -o root -m 755 batch $(DESTDIR)$(bindir)
51-	$(INSTALL) -g root -o root -m 755 batch-job $(DESTDIR)$(atdatadir)
52-	$(INSTALL) -d -o root -g root -m 755 $(DESTDIR)$(man1dir)
53-	$(INSTALL) -d -o root -g root -m 755 $(DESTDIR)$(man5dir)
54-	$(INSTALL) -d -o root -g root -m 755 $(DESTDIR)$(man8dir)
55-	$(INSTALL) -g root -o root -m 755 atd $(DESTDIR)$(sbindir)
56-	$(INSTALL) -g root -o root -m 755 atrun $(DESTDIR)$(sbindir)
57-	$(INSTALL) -g root -o root -m 644 at.1 $(DESTDIR)$(man1dir)/
58+	$(INSTALL) -m 755 batch $(DESTDIR)$(bindir)
59+	$(INSTALL) -m 755 batch-job $(DESTDIR)$(atdatadir)
60+	$(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
61+	$(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
62+	$(INSTALL) -d -m 755 $(DESTDIR)$(man8dir)
63+	$(INSTALL) -m 755 atd $(DESTDIR)$(sbindir)
64+	$(INSTALL) -m 755 atrun $(DESTDIR)$(sbindir)
65+	$(INSTALL) -m 644 at.1 $(DESTDIR)$(man1dir)/
66 	cd $(DESTDIR)$(man1dir) && $(LN_S) -f at.1 atq.1 && $(LN_S) -f at.1 batch.1 && $(LN_S) -f at.1 atrm.1
67-	$(INSTALL) -g root -o root -m 644 atd.8 $(DESTDIR)$(man8dir)/
68+	$(INSTALL) -m 644 atd.8 $(DESTDIR)$(man8dir)/
69 	sed "s,\$${exec_prefix},$(exec_prefix),g" <atrun.8>tmpman
70-	$(INSTALL) -g root -o root -m 644 tmpman $(DESTDIR)$(man8dir)/atrun.8
71+	$(INSTALL) -m 644 tmpman $(DESTDIR)$(man8dir)/atrun.8
72 	rm -f tmpman
73-	$(INSTALL) -g root -o root -m 644 at.allow.5 $(DESTDIR)$(man5dir)/
74+	$(INSTALL) -m 644 at.allow.5 $(DESTDIR)$(man5dir)/
75 	cd $(DESTDIR)$(man5dir) && $(LN_S) -f at.allow.5 at.deny.5
76-	$(INSTALL) -g root -o root -m 644 $(DOCS) $(DESTDIR)$(atdocdir)
77+	$(INSTALL) -m 644 $(DOCS) $(DESTDIR)$(atdocdir)
78 	rm -f $(DESTDIR)$(mandir)/cat1/at.1* $(DESTDIR)$(mandir)/cat1/batch.1* \
79 		$(DESTDIR)$(mandir)/cat1/atq.1*
80 	rm -f $(DESTDIR)$(mandir)/cat1/atd.8*
81 	if test x"$(systemdsystemunitdir)" != xno; then \
82-		$(INSTALL) -o root -g root -m 755 -d $(DESTDIR)$(systemdsystemunitdir); \
83-		$(INSTALL) -o root -g root -m 644 atd.service $(DESTDIR)$(systemdsystemunitdir); \
84+		$(INSTALL) -m 755 -d $(DESTDIR)$(systemdsystemunitdir); \
85+		$(INSTALL) -m 644 atd.service $(DESTDIR)$(systemdsystemunitdir); \
86 	fi
87
88 dist: checkin $(DIST) $(LIST) Filelist.asc
89--
902.25.1
91
92