summaryrefslogtreecommitdiff
path: root/app-text/lv/files/lv-gentoo.patch
blob: 99724ef9c69ec7e084b9f618e1985f23d97f8229 (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
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -25,6 +25,7 @@
 LDFLAGS=@LDFLAGS@
 INSTALL=@INSTALL@
 PERL=	@PERL@
+DESTDIR=
 
 OBJS=	itable.o ctable.o uty.o istr.o stream.o file.o guess.o decode.o \
 	encode.o escape.o iso2022.o iso8859.o iso2cn.o iso2jp.o iso2kr.o \
@@ -64,18 +65,19 @@
 #
 
 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
-	(cd $(bindir); ln lv lgrep)
-	if test ! -d $(lvlibdir); then \
-		mkdir -p $(lvlibdir); \
+	$(INSTALL) -m 555 lv $(DESTDIR)$(bindir)
+	(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 444 $(srcdir)/../lv.hlp $(DESTDIR)$(lvlibdir)
+	if test ! -d $(DESTDIR)$(mandir)/man1; then \
+		mkdir -p $(DESTDIR)$(mandir)/man1; \
 	fi
+	$(INSTALL) -m 444 $(srcdir)/../lv.1 $(DESTDIR)$(mandir)/man1; \
 
 uninstall::
 	for i in $(bindir)/lv $(bindir)/lgrep $(lvlibdir)/lv.hlp $(mandir)/man1/lv.1; do \