File: 0001-Add-DESTDIR-support.patch

package info (click to toggle)
tf5 5.0beta8-10
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 3,736 kB
  • sloc: ansic: 25,484; perl: 103; makefile: 82; sh: 79
file content (80 lines) | stat: -rw-r--r-- 3,308 bytes parent folder | download | duplicates (3)
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
From: Russ Allbery <rra@debian.org>
Date: Sun, 17 Feb 2008 20:42:29 -0800
Subject: Add DESTDIR support

Original patch taken from Joel Baker's Debian package.  This adds
DESTDIR where needed to the Unix makefile fragment.
---
 unix/unix.mak | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/unix/unix.mak b/unix/unix.mak
index 60f1b18..944e0dd 100644
--- a/unix/unix.mak
+++ b/unix/unix.mak
@@ -87,15 +87,15 @@ TF tf$(X):     $(OBJS) $(BUILDERS) $(PCRE)
 	-test -z "$(STRIP)" || $(STRIP) tf$(X) || true
 
 PREFIXDIRS:
-	test -d "$(bindir)" || mkdir $(bindir)
-	test -d "$(datadir)" || mkdir $(datadir)
+	test -d "$(DESTDIR)$(bindir)" || mkdir $(DESTDIR)$(bindir)
+	test -d "$(DESTDIR)$(datadir)" || mkdir $(DESTDIR)$(datadir)
 
 install_TF $(TF): tf$(X) $(BUILDERS)
-	-@rm -f $(TF)
-	cp tf$(X) $(TF)
-	chmod $(MODE) $(TF)
+	-@rm -f $(DESTDIR)$(TF)
+	cp tf$(X) $(DESTDIR)$(TF)
+	chmod $(MODE) $(DESTDIR)$(TF)
 
-SYMLINK $(SYMLINK): $(TF)
+SYMLINK $(SYMLINK): $(DESTDIR)$(TF)
 	test -z "$(SYMLINK)" || { rm -f $(SYMLINK) && ln -s $(TF) $(SYMLINK); }
 
 LIBRARY $(TF_LIBDIR): ../tf-lib/tf-help ../tf-lib/tf-help.idx
@@ -103,30 +103,30 @@ LIBRARY $(TF_LIBDIR): ../tf-lib/tf-help ../tf-lib/tf-help.idx
 #	@# Overly simplified shell commands, to avoid problems on ultrix
 	-@test -n "$(TF_LIBDIR)" || echo "TF_LIBDIR is undefined."
 	test -n "$(TF_LIBDIR)"
-	test -d "$(TF_LIBDIR)" || mkdir $(TF_LIBDIR)
-	-@test -d "$(TF_LIBDIR)" || echo "Can't make $(TF_LIBDIR) directory.  See if"
-	-@test -d "$(TF_LIBDIR)" || echo "there is already a file with that name."
-	test -d "$(TF_LIBDIR)"
+	test -d "$(DESTDIR)$(TF_LIBDIR)" || mkdir $(DESTDIR)$(TF_LIBDIR)
+	-@test -d "$(DESTDIR)$(TF_LIBDIR)" || echo "Can't make $(TF_LIBDIR) directory.  See if there is already a file with that name."
+	test -d "$(DESTDIR)$(TF_LIBDIR)"
 #
 #	@#rm -f $(TF_LIBDIR)/*;  # wrong: this would remove local.tf, etc.
 	@echo '## Copying library files...'
 	cd ../tf-lib; \
 	for f in *; do test -f $$f && files="$$files $$f"; done; \
-	( cd $(TF_LIBDIR); rm -f $$files tf.help tf.help.index; ); \
-	cp $$files $(TF_LIBDIR); \
-	cd $(TF_LIBDIR); \
+	( cd $(DESTDIR)$(TF_LIBDIR); rm -f $$files tf.help tf.help.index; ); \
+	cp $$files $(DESTDIR)$(TF_LIBDIR); \
+	cd $(DESTDIR)$(TF_LIBDIR); \
 	chmod $(MODE) $$files; chmod ugo-wx $$files
-	-rm -f $(TF_LIBDIR)/CHANGES 
-	cp ../CHANGES $(TF_LIBDIR)
-	chmod $(MODE) $(TF_LIBDIR)/CHANGES; chmod ugo-wx $(TF_LIBDIR)/CHANGES
-	chmod $(MODE) $(TF_LIBDIR)
-	-@cd $(TF_LIBDIR); old=`ls replace.tf 2>/dev/null`; \
+	-rm -f $(DESTDIR)$(TF_LIBDIR)/CHANGES 
+	cp ../CHANGES $(DESTDIR)$(TF_LIBDIR)
+	chmod $(MODE) $(DESTDIR)$(TF_LIBDIR)/CHANGES;
+	chmod ugo-wx $(DESTDIR)$(TF_LIBDIR)/CHANGES
+	chmod $(MODE) $(DESTDIR)$(TF_LIBDIR)
+	-@cd $(DESTDIR)$(TF_LIBDIR); old=`ls replace.tf 2>/dev/null`; \
 	if [ -n "$$old" ]; then \
 	    echo "## WARNING: Obsolete files found in $(TF_LIBDIR): $$old"; \
 	fi
 	@echo '## Creating links so old library names still work...'
 #	@# note: ln -sf isn't portable.
-	@cd $(TF_LIBDIR); \
+	@cd $(DESTDIR)$(TF_LIBDIR); \
 	rm -f bind-bash.tf;    ln -s  kb-bash.tf   bind-bash.tf;    \
 	rm -f bind-emacs.tf;   ln -s  kb-emacs.tf  bind-emacs.tf;   \
 	rm -f completion.tf;   ln -s  complete.tf  completion.tf;   \