File: makefile.diff

package info (click to toggle)
lv 4.51-10.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,992 kB
  • sloc: ansic: 9,055; sh: 1,380; perl: 485; makefile: 254; csh: 4
file content (50 lines) | stat: -rw-r--r-- 1,776 bytes parent folder | download | duplicates (4)
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
Description: "make install": Support DESTDIR, use symlink for lgrep, use more standard default permissions (and make them variables). Create bin/man/lib dirs if they don't already exist.
Author: B. Watson <yahlcru@gmail.com>
Last-Update: 2020-11-12

diff -Naur lv-4.51.orig/src/Makefile.in lv-4.51.orig.patched/src/Makefile.in
--- lv-4.51.orig/src/Makefile.in	2004-01-06 02:22:17.000000000 -0500
+++ lv-4.51.orig.patched/src/Makefile.in	2020-11-12 01:59:50.646022314 -0500
@@ -18,6 +18,10 @@
 lvlibdir=	$(libdir)/lv
 distdir = lv$(VERSION)
 
+DESTDIR=
+BINPERMS= 0755
+DOCPERMS= 0644
+
 PURIFY=	@PURIFY@
 CC=	@CC@
 CFLAGS=	@CFLAGS@ -DLV_HELP_PATH=\"$(lvlibdir)\" -I$(srcdir) @DEFS@
@@ -64,18 +68,22 @@
 #
 
 install::
-	$(INSTALL) -s -m 555 lv $(bindir)
-	if test -f $(bindir)/lgrep; then \
-		/bin/rm -f $(bindir)/lgrep; \
+	if test ! -d $(DESTDIR)$(bindir); then \
+		mkdir -p $(DESTDIR)$(bindir); \
+	fi
+	$(INSTALL) -s -m $(BINPERMS) lv $(DESTDIR)$(bindir)
+	if test -f $(DESTDIR)$(bindir)/lgrep; then \
+		/bin/rm -f $(DESTDIR)$(bindir)/lgrep; \
 	fi
-	(cd $(bindir); ln lv lgrep)
-	if test ! -d $(lvlibdir); then \
-		mkdir -p $(lvlibdir); \
+	(cd $(DESTDIR)$(bindir); ln -s lv lgrep)
+	if test ! -d $(DESTDIR)$(lvlibdir); then \
+		mkdir -p $(DESTDIR)$(lvlibdir); \
 	fi
-	$(INSTALL) -m 444 $(srcdir)/../lv.hlp $(lvlibdir)
-	if test -d $(mandir) -a -d $(mandir)/man1; then \
-		$(INSTALL) -m 444 $(srcdir)/../lv.1 $(mandir)/man1; \
+	$(INSTALL) -m $(DOCPERMS) $(srcdir)/../lv.hlp $(DESTDIR)$(lvlibdir)
+	if test ! -d $(DESTDIR)$(mandir)/man1; then \
+		mkdir -p $(DESTDIR)$(mandir)/man1; \
 	fi
+	$(INSTALL) -m $(DOCPERMS) $(srcdir)/../lv.1 $(DESTDIR)$(mandir)/man1; \
 
 uninstall::
 	for i in $(bindir)/lv $(bindir)/lgrep $(lvlibdir)/lv.hlp $(mandir)/man1/lv.1; do \